Skip to content

Commit eae1eec

Browse files
committed
Regenerate sample code.
1 parent b02847a commit eae1eec

31 files changed

Lines changed: 429 additions & 270 deletions

File tree

  • samples/client
    • echo_api/kotlin-jvm-okhttp/src/main/kotlin/org/openapitools/client/infrastructure
    • others
      • kotlin-integer-enum/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-jvm-okhttp-non-ascii-headers/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-jvm-okhttp-path-comments/src/main/kotlin/org/openapitools/client/infrastructure
    • petstore
      • kotlin-allOf-discriminator-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-allOf-discriminator/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-array-integer-enum/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-explicit/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure
      • kotlin/src/main/kotlin/org/openapitools/client/infrastructure

samples/client/echo_api/kotlin-jvm-okhttp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,75 +35,80 @@ val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()
3535
open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
3636
companion object {
3737
protected const val CONTENT_TYPE: String = "Content-Type"
38-
protected const val ACCEPT: String = "ACCEPT"
39-
protected const val AUTHORIZATION: String = "AUTHORIZATION"
40-
protected const val JSON_MEDIA_TYPE: String = "application/json"
41-
protected const val FORM_DATA_MEDIA_TYPE: String = "multipart/form-data"
42-
protected const val FORM_URL_ENC_MEDIA_TYPE: String = "application/x-www-form-urlencoded"
43-
protected const val XML_MEDIA_TYPE: String = "application/xml"
44-
protected const val OCTET_MEDIA_TYPE: String = "application/octet-stream"
45-
protected const val TEXT_MEDIA_TYPE: String = "text/plain"
46-
4738
@Deprecated(
4839
message = "Please use the capitalized constant `CONTENT_TYPE` instead.",
4940
replaceWith = ReplaceWith("CONTENT_TYPE")
5041
)
5142
protected const val ContentType: String = CONTENT_TYPE
5243

44+
protected const val ACCEPT: String = "Accept"
5345
@Deprecated(
5446
message = "Please use the capitalized constant `ACCEPT` instead.",
5547
replaceWith = ReplaceWith("ACCEPT")
5648
)
5749
protected const val Accept: String = ACCEPT
5850

51+
protected const val AUTHORIZATION: String = "Authorization"
5952
@Deprecated(
6053
message = "Please use the capitalized constant `AUTHORIZATION` instead.",
6154
replaceWith = ReplaceWith("AUTHORIZATION")
6255
)
6356
protected const val Authorization: String = AUTHORIZATION
6457

58+
protected const val JSON_MEDIA_TYPE: String = "application/json"
6559
@Deprecated(
6660
message = "Please use the capitalized constant `JSON_MEDIA_TYPE` instead.",
6761
replaceWith = ReplaceWith("JSON_MEDIA_TYPE")
6862
)
6963
protected const val JsonMediaType: String = JSON_MEDIA_TYPE
7064

65+
protected const val FORM_DATA_MEDIA_TYPE: String = "multipart/form-data"
7166
@Deprecated(
7267
message = "Please use the capitalized constant `FORM_DATA_MEDIA_TYPE` instead.",
7368
replaceWith = ReplaceWith("FORM_DATA_MEDIA_TYPE")
7469
)
7570
protected const val FormDataMediaType: String = FORM_DATA_MEDIA_TYPE
7671

72+
protected const val FORM_URL_ENC_MEDIA_TYPE: String = "application/x-www-form-urlencoded"
7773
@Deprecated(
7874
message = "Please use the capitalized constant `FORM_URL_ENC_MEDIA_TYPE` instead.",
7975
replaceWith = ReplaceWith("FORM_URL_ENC_MEDIA_TYPE")
8076
)
8177
protected const val FormUrlEncMediaType: String = FORM_URL_ENC_MEDIA_TYPE
8278

79+
protected const val XML_MEDIA_TYPE: String = "application/xml"
8380
@Deprecated(
8481
message = "Please use the capitalized constant `XML_MEDIA_TYPE` instead.",
8582
replaceWith = ReplaceWith("XML_MEDIA_TYPE")
8683
)
8784
protected const val XmlMediaType: String = XML_MEDIA_TYPE
8885

86+
protected const val OCTET_MEDIA_TYPE: String = "application/octet-stream"
8987
@Deprecated(
9088
message = "Please use the capitalized constant `OCTET_MEDIA_TYPE` instead.",
9189
replaceWith = ReplaceWith("OCTET_MEDIA_TYPE")
9290
)
9391
protected const val OctetMediaType: String = OCTET_MEDIA_TYPE
9492

93+
protected const val TEXT_MEDIA_TYPE: String = "text/plain"
9594
@Deprecated(
9695
message = "Please use the capitalized constant `TEXT_MEDIA_TYPE` instead.",
9796
replaceWith = ReplaceWith("TEXT_MEDIA_TYPE")
9897
)
9998
protected const val TextMediaType: String = TEXT_MEDIA_TYPE
10099

100+
const val BASE_URL_KEY: String = "org.openapitools.client.baseUrl"
101+
@Deprecated(
102+
message = "Please use the capitalized constant `BASE_URL_KEY` instead.",
103+
replaceWith = ReplaceWith("BASE_URL_KEY")
104+
)
105+
const val baseUrlKey: String = BASE_URL_KEY
106+
101107
val apiKey: MutableMap<String, String> = mutableMapOf()
102108
val apiKeyPrefix: MutableMap<String, String> = mutableMapOf()
103109
var username: String? = null
104110
var password: String? = null
105111
var accessToken: String? = null
106-
const val BASE_URL_KEY: String = "org.openapitools.client.baseUrl"
107112

108113
@JvmStatic
109114
val defaultClient: OkHttpClient by lazy {

samples/client/others/kotlin-integer-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,75 +35,80 @@ val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()
3535
open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
3636
companion object {
3737
protected const val CONTENT_TYPE: String = "Content-Type"
38-
protected const val ACCEPT: String = "ACCEPT"
39-
protected const val AUTHORIZATION: String = "AUTHORIZATION"
40-
protected const val JSON_MEDIA_TYPE: String = "application/json"
41-
protected const val FORM_DATA_MEDIA_TYPE: String = "multipart/form-data"
42-
protected const val FORM_URL_ENC_MEDIA_TYPE: String = "application/x-www-form-urlencoded"
43-
protected const val XML_MEDIA_TYPE: String = "application/xml"
44-
protected const val OCTET_MEDIA_TYPE: String = "application/octet-stream"
45-
protected const val TEXT_MEDIA_TYPE: String = "text/plain"
46-
4738
@Deprecated(
4839
message = "Please use the capitalized constant `CONTENT_TYPE` instead.",
4940
replaceWith = ReplaceWith("CONTENT_TYPE")
5041
)
5142
protected const val ContentType: String = CONTENT_TYPE
5243

44+
protected const val ACCEPT: String = "Accept"
5345
@Deprecated(
5446
message = "Please use the capitalized constant `ACCEPT` instead.",
5547
replaceWith = ReplaceWith("ACCEPT")
5648
)
5749
protected const val Accept: String = ACCEPT
5850

51+
protected const val AUTHORIZATION: String = "Authorization"
5952
@Deprecated(
6053
message = "Please use the capitalized constant `AUTHORIZATION` instead.",
6154
replaceWith = ReplaceWith("AUTHORIZATION")
6255
)
6356
protected const val Authorization: String = AUTHORIZATION
6457

58+
protected const val JSON_MEDIA_TYPE: String = "application/json"
6559
@Deprecated(
6660
message = "Please use the capitalized constant `JSON_MEDIA_TYPE` instead.",
6761
replaceWith = ReplaceWith("JSON_MEDIA_TYPE")
6862
)
6963
protected const val JsonMediaType: String = JSON_MEDIA_TYPE
7064

65+
protected const val FORM_DATA_MEDIA_TYPE: String = "multipart/form-data"
7166
@Deprecated(
7267
message = "Please use the capitalized constant `FORM_DATA_MEDIA_TYPE` instead.",
7368
replaceWith = ReplaceWith("FORM_DATA_MEDIA_TYPE")
7469
)
7570
protected const val FormDataMediaType: String = FORM_DATA_MEDIA_TYPE
7671

72+
protected const val FORM_URL_ENC_MEDIA_TYPE: String = "application/x-www-form-urlencoded"
7773
@Deprecated(
7874
message = "Please use the capitalized constant `FORM_URL_ENC_MEDIA_TYPE` instead.",
7975
replaceWith = ReplaceWith("FORM_URL_ENC_MEDIA_TYPE")
8076
)
8177
protected const val FormUrlEncMediaType: String = FORM_URL_ENC_MEDIA_TYPE
8278

79+
protected const val XML_MEDIA_TYPE: String = "application/xml"
8380
@Deprecated(
8481
message = "Please use the capitalized constant `XML_MEDIA_TYPE` instead.",
8582
replaceWith = ReplaceWith("XML_MEDIA_TYPE")
8683
)
8784
protected const val XmlMediaType: String = XML_MEDIA_TYPE
8885

86+
protected const val OCTET_MEDIA_TYPE: String = "application/octet-stream"
8987
@Deprecated(
9088
message = "Please use the capitalized constant `OCTET_MEDIA_TYPE` instead.",
9189
replaceWith = ReplaceWith("OCTET_MEDIA_TYPE")
9290
)
9391
protected const val OctetMediaType: String = OCTET_MEDIA_TYPE
9492

93+
protected const val TEXT_MEDIA_TYPE: String = "text/plain"
9594
@Deprecated(
9695
message = "Please use the capitalized constant `TEXT_MEDIA_TYPE` instead.",
9796
replaceWith = ReplaceWith("TEXT_MEDIA_TYPE")
9897
)
9998
protected const val TextMediaType: String = TEXT_MEDIA_TYPE
10099

100+
const val BASE_URL_KEY: String = "org.openapitools.client.baseUrl"
101+
@Deprecated(
102+
message = "Please use the capitalized constant `BASE_URL_KEY` instead.",
103+
replaceWith = ReplaceWith("BASE_URL_KEY")
104+
)
105+
const val baseUrlKey: String = BASE_URL_KEY
106+
101107
val apiKey: MutableMap<String, String> = mutableMapOf()
102108
val apiKeyPrefix: MutableMap<String, String> = mutableMapOf()
103109
var username: String? = null
104110
var password: String? = null
105111
var accessToken: String? = null
106-
const val BASE_URL_KEY: String = "org.openapitools.client.baseUrl"
107112

108113
@JvmStatic
109114
val defaultClient: OkHttpClient by lazy {

samples/client/others/kotlin-jvm-okhttp-non-ascii-headers/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,75 +35,80 @@ val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()
3535
open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
3636
companion object {
3737
protected const val CONTENT_TYPE: String = "Content-Type"
38-
protected const val ACCEPT: String = "ACCEPT"
39-
protected const val AUTHORIZATION: String = "AUTHORIZATION"
40-
protected const val JSON_MEDIA_TYPE: String = "application/json"
41-
protected const val FORM_DATA_MEDIA_TYPE: String = "multipart/form-data"
42-
protected const val FORM_URL_ENC_MEDIA_TYPE: String = "application/x-www-form-urlencoded"
43-
protected const val XML_MEDIA_TYPE: String = "application/xml"
44-
protected const val OCTET_MEDIA_TYPE: String = "application/octet-stream"
45-
protected const val TEXT_MEDIA_TYPE: String = "text/plain"
46-
4738
@Deprecated(
4839
message = "Please use the capitalized constant `CONTENT_TYPE` instead.",
4940
replaceWith = ReplaceWith("CONTENT_TYPE")
5041
)
5142
protected const val ContentType: String = CONTENT_TYPE
5243

44+
protected const val ACCEPT: String = "Accept"
5345
@Deprecated(
5446
message = "Please use the capitalized constant `ACCEPT` instead.",
5547
replaceWith = ReplaceWith("ACCEPT")
5648
)
5749
protected const val Accept: String = ACCEPT
5850

51+
protected const val AUTHORIZATION: String = "Authorization"
5952
@Deprecated(
6053
message = "Please use the capitalized constant `AUTHORIZATION` instead.",
6154
replaceWith = ReplaceWith("AUTHORIZATION")
6255
)
6356
protected const val Authorization: String = AUTHORIZATION
6457

58+
protected const val JSON_MEDIA_TYPE: String = "application/json"
6559
@Deprecated(
6660
message = "Please use the capitalized constant `JSON_MEDIA_TYPE` instead.",
6761
replaceWith = ReplaceWith("JSON_MEDIA_TYPE")
6862
)
6963
protected const val JsonMediaType: String = JSON_MEDIA_TYPE
7064

65+
protected const val FORM_DATA_MEDIA_TYPE: String = "multipart/form-data"
7166
@Deprecated(
7267
message = "Please use the capitalized constant `FORM_DATA_MEDIA_TYPE` instead.",
7368
replaceWith = ReplaceWith("FORM_DATA_MEDIA_TYPE")
7469
)
7570
protected const val FormDataMediaType: String = FORM_DATA_MEDIA_TYPE
7671

72+
protected const val FORM_URL_ENC_MEDIA_TYPE: String = "application/x-www-form-urlencoded"
7773
@Deprecated(
7874
message = "Please use the capitalized constant `FORM_URL_ENC_MEDIA_TYPE` instead.",
7975
replaceWith = ReplaceWith("FORM_URL_ENC_MEDIA_TYPE")
8076
)
8177
protected const val FormUrlEncMediaType: String = FORM_URL_ENC_MEDIA_TYPE
8278

79+
protected const val XML_MEDIA_TYPE: String = "application/xml"
8380
@Deprecated(
8481
message = "Please use the capitalized constant `XML_MEDIA_TYPE` instead.",
8582
replaceWith = ReplaceWith("XML_MEDIA_TYPE")
8683
)
8784
protected const val XmlMediaType: String = XML_MEDIA_TYPE
8885

86+
protected const val OCTET_MEDIA_TYPE: String = "application/octet-stream"
8987
@Deprecated(
9088
message = "Please use the capitalized constant `OCTET_MEDIA_TYPE` instead.",
9189
replaceWith = ReplaceWith("OCTET_MEDIA_TYPE")
9290
)
9391
protected const val OctetMediaType: String = OCTET_MEDIA_TYPE
9492

93+
protected const val TEXT_MEDIA_TYPE: String = "text/plain"
9594
@Deprecated(
9695
message = "Please use the capitalized constant `TEXT_MEDIA_TYPE` instead.",
9796
replaceWith = ReplaceWith("TEXT_MEDIA_TYPE")
9897
)
9998
protected const val TextMediaType: String = TEXT_MEDIA_TYPE
10099

100+
const val BASE_URL_KEY: String = "org.openapitools.client.baseUrl"
101+
@Deprecated(
102+
message = "Please use the capitalized constant `BASE_URL_KEY` instead.",
103+
replaceWith = ReplaceWith("BASE_URL_KEY")
104+
)
105+
const val baseUrlKey: String = BASE_URL_KEY
106+
101107
val apiKey: MutableMap<String, String> = mutableMapOf()
102108
val apiKeyPrefix: MutableMap<String, String> = mutableMapOf()
103109
var username: String? = null
104110
var password: String? = null
105111
var accessToken: String? = null
106-
const val BASE_URL_KEY: String = "org.openapitools.client.baseUrl"
107112

108113
@JvmStatic
109114
val defaultClient: OkHttpClient by lazy {

samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,75 +35,80 @@ val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()
3535
open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
3636
companion object {
3737
protected const val CONTENT_TYPE: String = "Content-Type"
38-
protected const val ACCEPT: String = "ACCEPT"
39-
protected const val AUTHORIZATION: String = "AUTHORIZATION"
40-
protected const val JSON_MEDIA_TYPE: String = "application/json"
41-
protected const val FORM_DATA_MEDIA_TYPE: String = "multipart/form-data"
42-
protected const val FORM_URL_ENC_MEDIA_TYPE: String = "application/x-www-form-urlencoded"
43-
protected const val XML_MEDIA_TYPE: String = "application/xml"
44-
protected const val OCTET_MEDIA_TYPE: String = "application/octet-stream"
45-
protected const val TEXT_MEDIA_TYPE: String = "text/plain"
46-
4738
@Deprecated(
4839
message = "Please use the capitalized constant `CONTENT_TYPE` instead.",
4940
replaceWith = ReplaceWith("CONTENT_TYPE")
5041
)
5142
protected const val ContentType: String = CONTENT_TYPE
5243

44+
protected const val ACCEPT: String = "Accept"
5345
@Deprecated(
5446
message = "Please use the capitalized constant `ACCEPT` instead.",
5547
replaceWith = ReplaceWith("ACCEPT")
5648
)
5749
protected const val Accept: String = ACCEPT
5850

51+
protected const val AUTHORIZATION: String = "Authorization"
5952
@Deprecated(
6053
message = "Please use the capitalized constant `AUTHORIZATION` instead.",
6154
replaceWith = ReplaceWith("AUTHORIZATION")
6255
)
6356
protected const val Authorization: String = AUTHORIZATION
6457

58+
protected const val JSON_MEDIA_TYPE: String = "application/json"
6559
@Deprecated(
6660
message = "Please use the capitalized constant `JSON_MEDIA_TYPE` instead.",
6761
replaceWith = ReplaceWith("JSON_MEDIA_TYPE")
6862
)
6963
protected const val JsonMediaType: String = JSON_MEDIA_TYPE
7064

65+
protected const val FORM_DATA_MEDIA_TYPE: String = "multipart/form-data"
7166
@Deprecated(
7267
message = "Please use the capitalized constant `FORM_DATA_MEDIA_TYPE` instead.",
7368
replaceWith = ReplaceWith("FORM_DATA_MEDIA_TYPE")
7469
)
7570
protected const val FormDataMediaType: String = FORM_DATA_MEDIA_TYPE
7671

72+
protected const val FORM_URL_ENC_MEDIA_TYPE: String = "application/x-www-form-urlencoded"
7773
@Deprecated(
7874
message = "Please use the capitalized constant `FORM_URL_ENC_MEDIA_TYPE` instead.",
7975
replaceWith = ReplaceWith("FORM_URL_ENC_MEDIA_TYPE")
8076
)
8177
protected const val FormUrlEncMediaType: String = FORM_URL_ENC_MEDIA_TYPE
8278

79+
protected const val XML_MEDIA_TYPE: String = "application/xml"
8380
@Deprecated(
8481
message = "Please use the capitalized constant `XML_MEDIA_TYPE` instead.",
8582
replaceWith = ReplaceWith("XML_MEDIA_TYPE")
8683
)
8784
protected const val XmlMediaType: String = XML_MEDIA_TYPE
8885

86+
protected const val OCTET_MEDIA_TYPE: String = "application/octet-stream"
8987
@Deprecated(
9088
message = "Please use the capitalized constant `OCTET_MEDIA_TYPE` instead.",
9189
replaceWith = ReplaceWith("OCTET_MEDIA_TYPE")
9290
)
9391
protected const val OctetMediaType: String = OCTET_MEDIA_TYPE
9492

93+
protected const val TEXT_MEDIA_TYPE: String = "text/plain"
9594
@Deprecated(
9695
message = "Please use the capitalized constant `TEXT_MEDIA_TYPE` instead.",
9796
replaceWith = ReplaceWith("TEXT_MEDIA_TYPE")
9897
)
9998
protected const val TextMediaType: String = TEXT_MEDIA_TYPE
10099

100+
const val BASE_URL_KEY: String = "org.openapitools.client.baseUrl"
101+
@Deprecated(
102+
message = "Please use the capitalized constant `BASE_URL_KEY` instead.",
103+
replaceWith = ReplaceWith("BASE_URL_KEY")
104+
)
105+
const val baseUrlKey: String = BASE_URL_KEY
106+
101107
val apiKey: MutableMap<String, String> = mutableMapOf()
102108
val apiKeyPrefix: MutableMap<String, String> = mutableMapOf()
103109
var username: String? = null
104110
var password: String? = null
105111
var accessToken: String? = null
106-
const val BASE_URL_KEY: String = "org.openapitools.client.baseUrl"
107112

108113
@JvmStatic
109114
val defaultClient: OkHttpClient by lazy {

0 commit comments

Comments
 (0)