[BUG][Kotlin] Add default values to optional parameters for jvm-spring-webclient and jvm-spring-restclient (#17393)

* Add default values to optional parameters for jvm-spring-webclient

* Update samples

* Add default values to optional parameters for jvm-spring-restclient
This commit is contained in:
Matthias Gabriel 2024-01-10 06:39:54 +01:00 committed by GitHub
parent 9b7528d8c8
commit e3c0a3e8b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 33 deletions

View File

@ -65,7 +65,7 @@ import {{packageName}}.infrastructure.*
{{#isDeprecated}} {{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.") @Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}} {{/isDeprecated}}
fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} { fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} {
return {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) return {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
.body!! .body!!
} }
@ -74,7 +74,7 @@ import {{packageName}}.infrastructure.*
{{#isDeprecated}} {{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.") @Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}} {{/isDeprecated}}
fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): ResponseEntity<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> { fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): ResponseEntity<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> {
val localVariableConfig = {{operationId}}RequestConfig({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) val localVariableConfig = {{operationId}}RequestConfig({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
return request<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map<String, PartConfig<*>>{{/hasFormParams}}{{/hasBodyParam}}, {{{returnType}}}{{^returnType}}Unit{{/returnType}}>( return request<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map<String, PartConfig<*>>{{/hasFormParams}}{{/hasBodyParam}}, {{{returnType}}}{{^returnType}}Unit{{/returnType}}>(
localVariableConfig localVariableConfig
@ -84,7 +84,7 @@ import {{packageName}}.infrastructure.*
{{#isDeprecated}} {{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.") @Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}} {{/isDeprecated}}
fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map<String, PartConfig<*>>{{/hasFormParams}}{{/hasBodyParam}}> { fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map<String, PartConfig<*>>{{/hasFormParams}}{{/hasBodyParam}}> {
val localVariableBody = {{#hasBodyParam}}{{! val localVariableBody = {{#hasBodyParam}}{{!
}}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{! }}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{!
}}{{^hasFormParams}}null{{/hasFormParams}}{{! }}{{^hasFormParams}}null{{/hasFormParams}}{{!

View File

@ -69,7 +69,7 @@ import {{packageName}}.infrastructure.*
{{#isDeprecated}} {{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.") @Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}} {{/isDeprecated}}
fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): Mono<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> { fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): Mono<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> {
return {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) return {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
.map { it.body } .map { it.body }
} }
@ -78,7 +78,7 @@ import {{packageName}}.infrastructure.*
{{#isDeprecated}} {{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.") @Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}} {{/isDeprecated}}
fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): Mono<ResponseEntity<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}>> { fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): Mono<ResponseEntity<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}>> {
val localVariableConfig = {{operationId}}RequestConfig({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) val localVariableConfig = {{operationId}}RequestConfig({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
return request<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map<String, PartConfig<*>>{{/hasFormParams}}{{/hasBodyParam}}, {{{returnType}}}{{^returnType}}Unit{{/returnType}}>( return request<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map<String, PartConfig<*>>{{/hasFormParams}}{{/hasBodyParam}}, {{{returnType}}}{{^returnType}}Unit{{/returnType}}>(
localVariableConfig localVariableConfig
@ -88,7 +88,7 @@ import {{packageName}}.infrastructure.*
{{#isDeprecated}} {{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.") @Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}} {{/isDeprecated}}
fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map<String, PartConfig<*>>{{/hasFormParams}}{{/hasBodyParam}}> { fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map<String, PartConfig<*>>{{/hasFormParams}}{{/hasBodyParam}}> {
val localVariableBody = {{#hasBodyParam}}{{! val localVariableBody = {{#hasBodyParam}}{{!
}}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{! }}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{!
}}{{^hasFormParams}}null{{/hasFormParams}}{{! }}{{^hasFormParams}}null{{/hasFormParams}}{{!

View File

@ -75,20 +75,20 @@ class PetApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class) @Throws(WebClientResponseException::class)
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Mono<Unit> { fun deletePet(petId: kotlin.Long, apiKey: kotlin.String? = null): Mono<Unit> {
return deletePetWithHttpInfo(petId = petId, apiKey = apiKey) return deletePetWithHttpInfo(petId = petId, apiKey = apiKey)
.map { it.body } .map { it.body }
} }
@Throws(WebClientResponseException::class) @Throws(WebClientResponseException::class)
fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?): Mono<ResponseEntity<Unit>> { fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String? = null): Mono<ResponseEntity<Unit>> {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
return request<Unit, Unit>( return request<Unit, Unit>(
localVariableConfig localVariableConfig
) )
} }
fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig<Unit> { fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String? = null) : RequestConfig<Unit> {
val localVariableBody = null val localVariableBody = null
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>() val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
@ -250,20 +250,20 @@ class PetApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class) @Throws(WebClientResponseException::class)
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Mono<Unit> { fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null): Mono<Unit> {
return updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) return updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status)
.map { it.body } .map { it.body }
} }
@Throws(WebClientResponseException::class) @Throws(WebClientResponseException::class)
fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Mono<ResponseEntity<Unit>> { fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null): Mono<ResponseEntity<Unit>> {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
return request<Map<String, PartConfig<*>>, Unit>( return request<Map<String, PartConfig<*>>, Unit>(
localVariableConfig localVariableConfig
) )
} }
fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig<Map<String, PartConfig<*>>> { fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null) : RequestConfig<Map<String, PartConfig<*>>> {
val localVariableBody = mapOf( val localVariableBody = mapOf(
"name" to PartConfig(body = name, headers = mutableMapOf()), "name" to PartConfig(body = name, headers = mutableMapOf()),
"status" to PartConfig(body = status, headers = mutableMapOf()),) "status" to PartConfig(body = status, headers = mutableMapOf()),)
@ -282,20 +282,20 @@ class PetApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class) @Throws(WebClientResponseException::class)
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?): Mono<ModelApiResponse> { fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null): Mono<ModelApiResponse> {
return uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file)
.map { it.body } .map { it.body }
} }
@Throws(WebClientResponseException::class) @Throws(WebClientResponseException::class)
fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?): Mono<ResponseEntity<ModelApiResponse>> { fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null): Mono<ResponseEntity<ModelApiResponse>> {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
return request<Map<String, PartConfig<*>>, ModelApiResponse>( return request<Map<String, PartConfig<*>>, ModelApiResponse>(
localVariableConfig localVariableConfig
) )
} }
fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig<Map<String, PartConfig<*>>> { fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null) : RequestConfig<Map<String, PartConfig<*>>> {
val localVariableBody = mapOf( val localVariableBody = mapOf(
"additionalMetadata" to PartConfig(body = additionalMetadata, headers = mutableMapOf()), "additionalMetadata" to PartConfig(body = additionalMetadata, headers = mutableMapOf()),
"file" to PartConfig(body = file, headers = mutableMapOf()),) "file" to PartConfig(body = file, headers = mutableMapOf()),)

View File

@ -71,20 +71,20 @@ class PetApi(client: RestClient) : ApiClient(client) {
@Throws(RestClientResponseException::class) @Throws(RestClientResponseException::class)
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit { fun deletePet(petId: kotlin.Long, apiKey: kotlin.String? = null): Unit {
return deletePetWithHttpInfo(petId = petId, apiKey = apiKey) return deletePetWithHttpInfo(petId = petId, apiKey = apiKey)
.body!! .body!!
} }
@Throws(RestClientResponseException::class) @Throws(RestClientResponseException::class)
fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?): ResponseEntity<Unit> { fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String? = null): ResponseEntity<Unit> {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
return request<Unit, Unit>( return request<Unit, Unit>(
localVariableConfig localVariableConfig
) )
} }
fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig<Unit> { fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String? = null) : RequestConfig<Unit> {
val localVariableBody = null val localVariableBody = null
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>() val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
@ -246,20 +246,20 @@ class PetApi(client: RestClient) : ApiClient(client) {
@Throws(RestClientResponseException::class) @Throws(RestClientResponseException::class)
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit { fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null): Unit {
return updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) return updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status)
.body!! .body!!
} }
@Throws(RestClientResponseException::class) @Throws(RestClientResponseException::class)
fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): ResponseEntity<Unit> { fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null): ResponseEntity<Unit> {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
return request<Map<String, PartConfig<*>>, Unit>( return request<Map<String, PartConfig<*>>, Unit>(
localVariableConfig localVariableConfig
) )
} }
fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig<Map<String, PartConfig<*>>> { fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null) : RequestConfig<Map<String, PartConfig<*>>> {
val localVariableBody = mapOf( val localVariableBody = mapOf(
"name" to PartConfig(body = name, headers = mutableMapOf()), "name" to PartConfig(body = name, headers = mutableMapOf()),
"status" to PartConfig(body = status, headers = mutableMapOf()),) "status" to PartConfig(body = status, headers = mutableMapOf()),)
@ -278,20 +278,20 @@ class PetApi(client: RestClient) : ApiClient(client) {
@Throws(RestClientResponseException::class) @Throws(RestClientResponseException::class)
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?): ModelApiResponse { fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null): ModelApiResponse {
return uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file)
.body!! .body!!
} }
@Throws(RestClientResponseException::class) @Throws(RestClientResponseException::class)
fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?): ResponseEntity<ModelApiResponse> { fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null): ResponseEntity<ModelApiResponse> {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
return request<Map<String, PartConfig<*>>, ModelApiResponse>( return request<Map<String, PartConfig<*>>, ModelApiResponse>(
localVariableConfig localVariableConfig
) )
} }
fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig<Map<String, PartConfig<*>>> { fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null) : RequestConfig<Map<String, PartConfig<*>>> {
val localVariableBody = mapOf( val localVariableBody = mapOf(
"additionalMetadata" to PartConfig(body = additionalMetadata, headers = mutableMapOf()), "additionalMetadata" to PartConfig(body = additionalMetadata, headers = mutableMapOf()),
"file" to PartConfig(body = file, headers = mutableMapOf()),) "file" to PartConfig(body = file, headers = mutableMapOf()),)

View File

@ -75,20 +75,20 @@ class PetApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class) @Throws(WebClientResponseException::class)
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Mono<Unit> { fun deletePet(petId: kotlin.Long, apiKey: kotlin.String? = null): Mono<Unit> {
return deletePetWithHttpInfo(petId = petId, apiKey = apiKey) return deletePetWithHttpInfo(petId = petId, apiKey = apiKey)
.map { it.body } .map { it.body }
} }
@Throws(WebClientResponseException::class) @Throws(WebClientResponseException::class)
fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?): Mono<ResponseEntity<Unit>> { fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String? = null): Mono<ResponseEntity<Unit>> {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
return request<Unit, Unit>( return request<Unit, Unit>(
localVariableConfig localVariableConfig
) )
} }
fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig<Unit> { fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String? = null) : RequestConfig<Unit> {
val localVariableBody = null val localVariableBody = null
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>() val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
@ -250,20 +250,20 @@ class PetApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class) @Throws(WebClientResponseException::class)
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Mono<Unit> { fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null): Mono<Unit> {
return updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) return updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status)
.map { it.body } .map { it.body }
} }
@Throws(WebClientResponseException::class) @Throws(WebClientResponseException::class)
fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Mono<ResponseEntity<Unit>> { fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null): Mono<ResponseEntity<Unit>> {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
return request<Map<String, PartConfig<*>>, Unit>( return request<Map<String, PartConfig<*>>, Unit>(
localVariableConfig localVariableConfig
) )
} }
fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig<Map<String, PartConfig<*>>> { fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null) : RequestConfig<Map<String, PartConfig<*>>> {
val localVariableBody = mapOf( val localVariableBody = mapOf(
"name" to PartConfig(body = name, headers = mutableMapOf()), "name" to PartConfig(body = name, headers = mutableMapOf()),
"status" to PartConfig(body = status, headers = mutableMapOf()),) "status" to PartConfig(body = status, headers = mutableMapOf()),)
@ -282,20 +282,20 @@ class PetApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class) @Throws(WebClientResponseException::class)
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?): Mono<ModelApiResponse> { fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null): Mono<ModelApiResponse> {
return uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file)
.map { it.body } .map { it.body }
} }
@Throws(WebClientResponseException::class) @Throws(WebClientResponseException::class)
fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?): Mono<ResponseEntity<ModelApiResponse>> { fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null): Mono<ResponseEntity<ModelApiResponse>> {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
return request<Map<String, PartConfig<*>>, ModelApiResponse>( return request<Map<String, PartConfig<*>>, ModelApiResponse>(
localVariableConfig localVariableConfig
) )
} }
fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig<Map<String, PartConfig<*>>> { fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null) : RequestConfig<Map<String, PartConfig<*>>> {
val localVariableBody = mapOf( val localVariableBody = mapOf(
"additionalMetadata" to PartConfig(body = additionalMetadata, headers = mutableMapOf()), "additionalMetadata" to PartConfig(body = additionalMetadata, headers = mutableMapOf()),
"file" to PartConfig(body = file, headers = mutableMapOf()),) "file" to PartConfig(body = file, headers = mutableMapOf()),)