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

openapi.templates.kora.kotlinApiResponses.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}}

@ru.tinkoff.kora.common.annotation.Generated("openapi generator kora client"){{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}
interface {{classname}}Responses {
{{#operations}}
{{#operation}}{{#vendorExtensions.singleResponse}}{{#responses}}
  /**
  * {{message}} (status code {{code}})
  */
  {{#vendorExtensions.hasData}}data {{/vendorExtensions.hasData}}class {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}ApiResponse(
    {{#dataType}}{{#isDefault}}val statusCode: Int,
    {{/isDefault}}val content: {{{dataType}}}{{#hasHeaders}},{{/hasHeaders}}{{/dataType}}
    {{^dataType}}{{#isDefault}}val statusCode: Int{{#hasHeaders}},{{/hasHeaders}}{{/isDefault}}{{/dataType}}
    {{#headers}}
    val {{#lambda.camelcase}}{{nameInCamelCase}}{{/lambda.camelcase}}: String{{^required}}?{{/required}}{{^-last}},{{/-last}}
    {{/headers}}
  )
{{/responses}}{{/vendorExtensions.singleResponse}}{{^vendorExtensions.singleResponse}}
  sealed interface {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}ApiResponse {
    {{#responses}}
      /**
      * {{message}} (status code {{code}})
      */
      {{#vendorExtensions.hasData}}data {{/vendorExtensions.hasData}}class {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}{{#isDefault}}Default{{/isDefault}}{{^isDefault}}{{code}}{{/isDefault}}ApiResponse(
        {{#dataType}}{{#isDefault}}val statusCode: Int,
        {{/isDefault}}val content: {{{dataType}}}{{#hasHeaders}},{{/hasHeaders}}{{/dataType}}
        {{^dataType}}{{#isDefault}}val statusCode: Int{{#hasHeaders}},{{/hasHeaders}}{{/isDefault}}{{/dataType}}
        {{#headers}}
        val {{#lambda.camelcase}}{{nameInCamelCase}}{{/lambda.camelcase}}: String{{^required}}?{{/required}}{{^-last}},{{/-last}}
        {{/headers}}
      ) : {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}ApiResponse

    {{/responses}}
  }
{{/vendorExtensions.singleResponse}}
{{/operation}}
{{/operations}}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy