dev.crashteam.openapi.keanalytics.api.CategoryApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openapi-ke-analytics Show documentation
Show all versions of openapi-ke-analytics Show documentation
Generates jar artifact containing compiled openapi classes based on generated openapi yaml files
The newest version!
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.6.0).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package dev.crashteam.openapi.keanalytics.api;
import dev.crashteam.openapi.keanalytics.model.CategoryOverallInfo200Response;
import dev.crashteam.openapi.keanalytics.model.CategoryProductPosition200Response;
import org.springframework.format.annotation.DateTimeFormat;
import dev.crashteam.openapi.keanalytics.model.Error;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import dev.crashteam.openapi.keanalytics.model.ProductSkuHistory400Response;
import java.util.UUID;
import io.swagger.v3.oas.annotations.ExternalDocumentation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import org.springframework.http.codec.multipart.Part;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Generated;
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-03-26T08:59:12.399131532Z[Etc/UTC]")
@Validated
@Tag(name = "category", description = "the category API")
public interface CategoryApi {
/**
* GET /category/{categoryId}/overall-info : Общая информация по категории
*
* @param xRequestID Уникальный идентификатор запроса к системе (required)
* @param X_API_KEY Уникальный токен пользователя (required)
* @param categoryId (required)
* @param fromTime Start date time. (required)
* @param toTime End date time. (required)
* @return Получены общие аналитические данные по категории (status code 200)
* or Переданы ошибочные данные (status code 400)
* or Несанкционированный доступ, использовались неверные учетные данные. (status code 401)
* or Access forbidden. (status code 403)
* or Данные по категории не найдены (status code 404)
*/
@Operation(
operationId = "categoryOverallInfo",
summary = "Общая информация по категории",
tags = { "category" },
responses = {
@ApiResponse(responseCode = "200", description = "Получены общие аналитические данные по категории", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = CategoryOverallInfo200Response.class))
}),
@ApiResponse(responseCode = "400", description = "Переданы ошибочные данные", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = ProductSkuHistory400Response.class))
}),
@ApiResponse(responseCode = "401", description = "Несанкционированный доступ, использовались неверные учетные данные.", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
}),
@ApiResponse(responseCode = "403", description = "Access forbidden.", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
}),
@ApiResponse(responseCode = "404", description = "Данные по категории не найдены")
},
security = {
@SecurityRequirement(name = "apiKey")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/category/{categoryId}/overall-info",
produces = { "application/json" }
)
default Mono> categoryOverallInfo(
@NotNull @Parameter(name = "X-Request-ID", description = "Уникальный идентификатор запроса к системе", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "X-Request-ID", required = true) UUID xRequestID,
@NotNull @Parameter(name = "X-API-KEY", description = "Уникальный токен пользователя", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "X-API-KEY", required = true) String X_API_KEY,
@Parameter(name = "categoryId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("categoryId") Long categoryId,
@NotNull @Parameter(name = "fromTime", description = "Start date time.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "fromTime", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime fromTime,
@NotNull @Parameter(name = "toTime", description = "End date time.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "toTime", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime toTime,
@Parameter(hidden = true) final ServerWebExchange exchange
) {
Mono result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"revenue\" : 0.8008281904610115, \"sellerCount\" : 1, \"salesPerSeller\" : 10, \"sellersZeroSalesCount\" : 2, \"orderCount\" : 6, \"averagePrice\" : 10, \"productCount\" : 5, \"productZeroSalesCount\" : 5 }";
result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString);
break;
}
}
return result.then(Mono.empty());
}
/**
* GET /category/{categoryId}/product/{productId}/sku/{skuId}/position : Позиция товара в категории
*
* @param xRequestID Уникальный идентификатор запроса к системе (required)
* @param X_API_KEY Уникальный токен пользователя (required)
* @param categoryId (required)
* @param productId (required)
* @param skuId (required)
* @param fromDate Start date. (required)
* @param toDate End date. (required)
* @return Получены данные о позициях товара в категории (status code 200)
* or Переданы ошибочные данные (status code 400)
* or Несанкционированный доступ, использовались неверные учетные данные. (status code 401)
* or Access forbidden. (status code 403)
* or Данные по продукту не найдены (status code 404)
*/
@Operation(
operationId = "categoryProductPosition",
summary = "Позиция товара в категории",
tags = { "product" },
responses = {
@ApiResponse(responseCode = "200", description = "Получены данные о позициях товара в категории", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = CategoryProductPosition200Response.class))
}),
@ApiResponse(responseCode = "400", description = "Переданы ошибочные данные", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = ProductSkuHistory400Response.class))
}),
@ApiResponse(responseCode = "401", description = "Несанкционированный доступ, использовались неверные учетные данные.", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
}),
@ApiResponse(responseCode = "403", description = "Access forbidden.", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
}),
@ApiResponse(responseCode = "404", description = "Данные по продукту не найдены")
},
security = {
@SecurityRequirement(name = "apiKey")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/category/{categoryId}/product/{productId}/sku/{skuId}/position",
produces = { "application/json" }
)
default Mono> categoryProductPosition(
@NotNull @Parameter(name = "X-Request-ID", description = "Уникальный идентификатор запроса к системе", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "X-Request-ID", required = true) UUID xRequestID,
@NotNull @Parameter(name = "X-API-KEY", description = "Уникальный токен пользователя", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "X-API-KEY", required = true) String X_API_KEY,
@Parameter(name = "categoryId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("categoryId") Long categoryId,
@Parameter(name = "productId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("productId") Long productId,
@Parameter(name = "skuId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("skuId") Long skuId,
@NotNull @Pattern(regexp = "YYYY-MM-DD") @Size(min = 0, max = 10) @Parameter(name = "fromDate", description = "Start date.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "fromDate", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate fromDate,
@NotNull @Pattern(regexp = "YYYY-MM-DD") @Size(min = 0, max = 10) @Parameter(name = "toDate", description = "End date.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "toDate", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate toDate,
@Parameter(hidden = true) final ServerWebExchange exchange
) {
Mono result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"productId\" : 6, \"positions\" : \"\", \"categoryId\" : 0, \"skuId\" : 1 }";
result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString);
break;
}
}
return result.then(Mono.empty());
}
}