dev.crashteam.openapi.keanalytics.api.SellerApi 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 org.springframework.format.annotation.DateTimeFormat;
import dev.crashteam.openapi.keanalytics.model.Error;
import java.time.OffsetDateTime;
import dev.crashteam.openapi.keanalytics.model.ProductSkuHistory400Response;
import dev.crashteam.openapi.keanalytics.model.Seller;
import dev.crashteam.openapi.keanalytics.model.SellerOverallInfo200Response;
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 = "seller", description = "the seller API")
public interface SellerApi {
/**
* GET /seller/link : Получить список магазинов продавца
*
* @param sellerLink (required)
* @return Список магазинов продавца (status code 200)
* or Переданы ошибочные данные (status code 400)
* or Несанкционированный доступ, использовались неверные учетные данные. (status code 401)
* or Access forbidden. (status code 403)
*/
@Operation(
operationId = "getSellerShops",
summary = "Получить список магазинов продавца",
tags = { "seller" },
responses = {
@ApiResponse(responseCode = "200", description = "Список магазинов продавца", content = {
@Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Seller.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))
})
},
security = {
@SecurityRequirement(name = "apiKey")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/seller/link",
produces = { "application/json" }
)
default Mono>> getSellerShops(
@NotNull @Parameter(name = "sellerLink", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "sellerLink", required = true) String sellerLink,
@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 = "[ { \"accountId\" : 5, \"link\" : \"link\", \"title\" : \"title\" }, { \"accountId\" : 5, \"link\" : \"link\", \"title\" : \"title\" } ]";
result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString);
break;
}
}
return result.then(Mono.empty());
}
/**
* GET /seller/{sellerLink}/overall-info : Общая информация по магазину
*
* @param xRequestID Уникальный идентификатор запроса к системе (required)
* @param X_API_KEY Уникальный токен пользователя (required)
* @param sellerLink (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 = "sellerOverallInfo",
summary = "Общая информация по магазину",
tags = { "seller" },
responses = {
@ApiResponse(responseCode = "200", description = "Получены общие аналитические данные по магазину", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = SellerOverallInfo200Response.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 = "/seller/{sellerLink}/overall-info",
produces = { "application/json" }
)
default Mono> sellerOverallInfo(
@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 = "sellerLink", description = "", required = true, in = ParameterIn.PATH) @PathVariable("sellerLink") String sellerLink,
@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, \"productCountWithSales\" : 5, \"salesDynamic\" : [ { \"date\" : \"2023-03-16T00:00:00.000+00:00\", \"orderAmount\" : 2 }, { \"date\" : \"2023-03-16T00:00:00.000+00:00\", \"orderAmount\" : 2 } ], \"orderCount\" : 6, \"averagePrice\" : 10, \"productCount\" : 1, \"productCountWithoutSales\" : 5 }";
result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString);
break;
}
}
return result.then(Mono.empty());
}
}