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

openapi.templates.kora.kotlinClientApi.mustache Maven / Gradle / Ivy

There is a newer version: 1.1.16
Show newest version
/**
 * NOTE: This class is auto generated by Kora OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
package {{package}}

{{#imports}}import {{import}}
{{/imports}}
import ru.tinkoff.kora.http.client.common.annotation.ResponseCodeMapper
import ru.tinkoff.kora.http.client.common.interceptor.HttpClientInterceptor

@ru.tinkoff.kora.common.annotation.Generated("openapi generator kora client"){{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}
@ru.tinkoff.kora.http.client.common.annotation.HttpClient{{{annotationParams}}}
interface {{classname}} {
{{#operations}}
{{#operation}}
    /**
     * {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}}
    {{#notes}}
     * {{.}}
    {{/notes}}
     *
    {{#allParams}}
     * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
    {{/allParams}}
     * @return {{#responses}}{{message}} (status code {{code}}){{^-last}}
     *         or {{/-last}}{{/responses}}
    {{#isDeprecated}}
     * @deprecated
    {{/isDeprecated}}
    {{#externalDocs}}
     * {{description}}
     * @see {{summary}} Documentation
    {{/externalDocs}}
     */
    {{#koraAdditionalContractAnnotations}}
    {{.}}
    {{/koraAdditionalContractAnnotations}}
    @ru.tinkoff.kora.http.common.annotation.HttpRoute(method = "{{httpMethod}}", path = "{{path}}"){{#implicitHeaders}}
    @ApiImplicitParams({
    {{#headerParams}}
     TODO implisit header
    {{>implicitHeader}}
    {{/headerParams}}
    })
    {{/implicitHeaders}}{{#responses}}
    @ResponseCodeMapper(code = {{#isDefault}}ResponseCodeMapper.DEFAULT{{/isDefault}}{{^isDefault}}{{code}}{{/isDefault}}, mapper = {{classname}}ClientResponseMappers.{{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}{{code}}ApiResponseMapper::class){{/responses}}
    {{#vendorExtensions.authInterceptorTag}}
    @ru.tinkoff.kora.http.common.annotation.InterceptWith(tag = ru.tinkoff.kora.common.Tag(ApiSecurity.{{.}}::class), value = HttpClientInterceptor::class)
    {{/vendorExtensions.authInterceptorTag}}
    {{#koraInterceptors}}
    {{#interceptorTags}}
    @ru.tinkoff.kora.http.common.annotation.InterceptWith(tag = ru.tinkoff.kora.common.Tag(value = [{{interceptorTags}}]), value = {{interceptorImpl}})
    {{/interceptorTags}}
    {{^interceptorTags}}
    @ru.tinkoff.kora.http.common.annotation.InterceptWith({{interceptorImpl}})
    {{/interceptorTags}}
    {{/koraInterceptors}}
    {{#isDeprecated}}
    @Deprecated(message = "Deprecated")
    {{/isDeprecated}}
    {{#isSuspend}}suspend {{/isSuspend}}fun {{operationId}}({{>kotlinAnnotatedParams}}): {{classname}}Responses.{{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}ApiResponse

{{#hasFormParams}}
    @ru.tinkoff.kora.common.annotation.Generated("openapi generator kora client")
    data class {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}FormParam(
      {{#formParams}}
          val {{paramName}}: {{#isFile}}ru.tinkoff.kora.http.common.form.FormMultipart.FormPart{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}}{{^required}}?{{/required}}{{^-last}},{{/-last}}
      {{/formParams}}
    ){}
{{/hasFormParams}}


{{/operation}}
}
{{/operations}}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy