All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.crashteam.openapi.keanalytics.api.ReportsApi Maven / Gradle / Ivy

Go to download

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.Report;
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 = "report", description = "the report API")
public interface ReportsApi {

    /**
     * GET /reports : Получить список всех отчетов
     *
     * @param fromTime Start date time. (required)
     * @return Список отчетов пользователя (status code 200)
     *         or Переданы ошибочные данные (status code 400)
     *         or Несанкционированный доступ, использовались неверные учетные данные. (status code 401)
     *         or Access forbidden. (status code 403)
     */
    @Operation(
        operationId = "getReports",
        summary = "Получить список всех отчетов",
        tags = { "report" },
        responses = {
            @ApiResponse(responseCode = "200", description = "Список отчетов пользователя", content = {
                @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Report.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 = "/reports",
        produces = { "application/json" }
    )
    default Mono>> getReports(
        @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,
        @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 = "[ { \"reportType\" : \"reportType\", \"jobId\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"createdAt\" : \"2000-01-23T04:56:07.000+00:00\", \"reportId\" : \"61dc6a6a453cd26524fd42b4\", \"sellerLink\" : \"sellerLink\", \"interval\" : 0, \"categoryId\" : 6, \"status\" : \"status\" }, { \"reportType\" : \"reportType\", \"jobId\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\", \"createdAt\" : \"2000-01-23T04:56:07.000+00:00\", \"reportId\" : \"61dc6a6a453cd26524fd42b4\", \"sellerLink\" : \"sellerLink\", \"interval\" : 0, \"categoryId\" : 6, \"status\" : \"status\" } ]";
                result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString);
                break;
            }
        }
        return result.then(Mono.empty());

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy