Skip to content

Commit d521f0e

Browse files
authored
Merge pull request #113 from dodopayments/stlc-generated-27411526694
feat(api): regenerate SDK from latest OpenAPI spec
2 parents 816be7e + 8a9748c commit d521f0e

103 files changed

Lines changed: 121 additions & 348 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dodo-payments-java-client-okhttp/src/main/kotlin/com/dodopayments/api/client/okhttp/DodoPaymentsOkHttpClient.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ class DodoPaymentsOkHttpClient private constructor() {
240240
* Defaults to the live_mode environment: `https://live.dodopayments.com`.
241241
*
242242
* The following other environments, with dedicated builder methods, are available:
243-
*
244243
* - test_mode: `https://test.dodopayments.com`
245244
*/
246245
fun baseUrl(baseUrl: String?) = apply { clientOptions.baseUrl(baseUrl) }

dodo-payments-java-client-okhttp/src/main/kotlin/com/dodopayments/api/client/okhttp/DodoPaymentsOkHttpClientAsync.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ class DodoPaymentsOkHttpClientAsync private constructor() {
240240
* Defaults to the live_mode environment: `https://live.dodopayments.com`.
241241
*
242242
* The following other environments, with dedicated builder methods, are available:
243-
*
244243
* - test_mode: `https://test.dodopayments.com`
245244
*/
246245
fun baseUrl(baseUrl: String?) = apply { clientOptions.baseUrl(baseUrl) }

dodo-payments-java-core/src/main/kotlin/com/dodopayments/api/core/Check.kt

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,39 +24,45 @@ internal fun <T : Any> checkKnown(name: String, value: MultipartField<T>): T =
2424
}
2525

2626
@JvmSynthetic
27-
internal fun checkLength(name: String, value: String, length: Int): String = value.also {
28-
check(it.length == length) { "`$name` must have length $length, but was ${it.length}" }
29-
}
27+
internal fun checkLength(name: String, value: String, length: Int): String =
28+
value.also {
29+
check(it.length == length) { "`$name` must have length $length, but was ${it.length}" }
30+
}
3031

3132
@JvmSynthetic
32-
internal fun checkMinLength(name: String, value: String, minLength: Int): String = value.also {
33-
check(it.length >= minLength) {
34-
if (minLength == 1) "`$name` must be non-empty, but was empty"
35-
else "`$name` must have at least length $minLength, but was ${it.length}"
33+
internal fun checkMinLength(name: String, value: String, minLength: Int): String =
34+
value.also {
35+
check(it.length >= minLength) {
36+
if (minLength == 1) "`$name` must be non-empty, but was empty"
37+
else "`$name` must have at least length $minLength, but was ${it.length}"
38+
}
3639
}
37-
}
3840

3941
@JvmSynthetic
40-
internal fun checkMaxLength(name: String, value: String, maxLength: Int): String = value.also {
41-
check(it.length <= maxLength) {
42-
"`$name` must have at most length $maxLength, but was ${it.length}"
42+
internal fun checkMaxLength(name: String, value: String, maxLength: Int): String =
43+
value.also {
44+
check(it.length <= maxLength) {
45+
"`$name` must have at most length $maxLength, but was ${it.length}"
46+
}
4347
}
44-
}
4548

4649
@JvmSynthetic
4750
internal fun checkJacksonVersionCompatibility() {
48-
val incompatibleJacksonVersions = RUNTIME_JACKSON_VERSIONS.mapNotNull {
49-
val badVersionReason = BAD_JACKSON_VERSIONS[it.toString()]
50-
when {
51-
it.majorVersion != MINIMUM_JACKSON_VERSION.majorVersion ->
52-
it to "incompatible major version"
53-
it.minorVersion < MINIMUM_JACKSON_VERSION.minorVersion -> it to "minor version too low"
54-
it.minorVersion == MINIMUM_JACKSON_VERSION.minorVersion &&
55-
it.patchLevel < MINIMUM_JACKSON_VERSION.patchLevel -> it to "patch version too low"
56-
badVersionReason != null -> it to badVersionReason
57-
else -> null
51+
val incompatibleJacksonVersions =
52+
RUNTIME_JACKSON_VERSIONS.mapNotNull {
53+
val badVersionReason = BAD_JACKSON_VERSIONS[it.toString()]
54+
when {
55+
it.majorVersion != MINIMUM_JACKSON_VERSION.majorVersion ->
56+
it to "incompatible major version"
57+
it.minorVersion < MINIMUM_JACKSON_VERSION.minorVersion ->
58+
it to "minor version too low"
59+
it.minorVersion == MINIMUM_JACKSON_VERSION.minorVersion &&
60+
it.patchLevel < MINIMUM_JACKSON_VERSION.patchLevel ->
61+
it to "patch version too low"
62+
badVersionReason != null -> it to badVersionReason
63+
else -> null
64+
}
5865
}
59-
}
6066
check(incompatibleJacksonVersions.isEmpty()) {
6167
"""
6268
This SDK requires a minimum Jackson version of $MINIMUM_JACKSON_VERSION, but the following incompatible Jackson versions were detected at runtime:

dodo-payments-java-core/src/main/kotlin/com/dodopayments/api/core/ClientOptions.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ private constructor(
136136
* Defaults to the live_mode environment: `https://live.dodopayments.com`.
137137
*
138138
* The following other environments, with dedicated builder methods, are available:
139-
*
140139
* - test_mode: `https://test.dodopayments.com`
141140
*/
142141
fun baseUrl(): String = baseUrl ?: LIVE_MODE_URL
@@ -278,7 +277,6 @@ private constructor(
278277
* Defaults to the live_mode environment: `https://live.dodopayments.com`.
279278
*
280279
* The following other environments, with dedicated builder methods, are available:
281-
*
282280
* - test_mode: `https://test.dodopayments.com`
283281
*/
284282
fun baseUrl(baseUrl: String?) = apply { this.baseUrl = baseUrl }

dodo-payments-java-core/src/main/kotlin/com/dodopayments/api/models/balances/BalanceLedgerEntry.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,11 +688,9 @@ private constructor(
688688
* An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member.
689689
*
690690
* An instance of [EventType] can contain an unknown value in a couple of cases:
691-
*
692691
* - It was deserialized from data that doesn't match any known member. For example, if the
693692
* SDK is on an older version than the API, then the API may respond with new members that
694693
* the SDK is unaware of.
695-
*
696694
* - It was constructed with an arbitrary value using the [of] method.
697695
*/
698696
enum class Value {

dodo-payments-java-core/src/main/kotlin/com/dodopayments/api/models/balances/BalanceRetrieveLedgerParams.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -773,11 +773,9 @@ private constructor(
773773
* An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member.
774774
*
775775
* An instance of [Currency] can contain an unknown value in a couple of cases:
776-
*
777776
* - It was deserialized from data that doesn't match any known member. For example, if the
778777
* SDK is on an older version than the API, then the API may respond with new members that
779778
* the SDK is unaware of.
780-
*
781779
* - It was constructed with an arbitrary value using the [of] method.
782780
*/
783781
enum class Value {
@@ -1401,11 +1399,9 @@ private constructor(
14011399
* An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member.
14021400
*
14031401
* An instance of [EventType] can contain an unknown value in a couple of cases:
1404-
*
14051402
* - It was deserialized from data that doesn't match any known member. For example, if the
14061403
* SDK is on an older version than the API, then the API may respond with new members that
14071404
* the SDK is unaware of.
1408-
*
14091405
* - It was constructed with an arbitrary value using the [of] method.
14101406
*/
14111407
enum class Value {

dodo-payments-java-core/src/main/kotlin/com/dodopayments/api/models/brands/Brand.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,11 +628,9 @@ private constructor(
628628
* An enum containing [VerificationStatus]'s known values, as well as an [_UNKNOWN] member.
629629
*
630630
* An instance of [VerificationStatus] can contain an unknown value in a couple of cases:
631-
*
632631
* - It was deserialized from data that doesn't match any known member. For example, if the
633632
* SDK is on an older version than the API, then the API may respond with new members that
634633
* the SDK is unaware of.
635-
*
636634
* - It was constructed with an arbitrary value using the [of] method.
637635
*/
638636
enum class Value {

dodo-payments-java-core/src/main/kotlin/com/dodopayments/api/models/checkoutsessions/CheckoutSessionCustomization.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,9 @@ private constructor(
385385
* An enum containing [Theme]'s known values, as well as an [_UNKNOWN] member.
386386
*
387387
* An instance of [Theme] can contain an unknown value in a couple of cases:
388-
*
389388
* - It was deserialized from data that doesn't match any known member. For example, if the
390389
* SDK is on an older version than the API, then the API may respond with new members that
391390
* the SDK is unaware of.
392-
*
393391
* - It was constructed with an arbitrary value using the [of] method.
394392
*/
395393
enum class Value {

dodo-payments-java-core/src/main/kotlin/com/dodopayments/api/models/checkoutsessions/CheckoutSessionRequest.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,9 +1393,8 @@ private constructor(
13931393
* Used for best match union deserialization.
13941394
*/
13951395
@JvmSynthetic
1396-
internal fun validity(): Int = additionalProperties.count { (_, value) ->
1397-
!value.isNull() && !value.isMissing()
1398-
}
1396+
internal fun validity(): Int =
1397+
additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() }
13991398

14001399
override fun equals(other: Any?): Boolean {
14011400
if (this === other) {

dodo-payments-java-core/src/main/kotlin/com/dodopayments/api/models/checkoutsessions/CustomField.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,9 @@ private constructor(
416416
* An enum containing [FieldType]'s known values, as well as an [_UNKNOWN] member.
417417
*
418418
* An instance of [FieldType] can contain an unknown value in a couple of cases:
419-
*
420419
* - It was deserialized from data that doesn't match any known member. For example, if the
421420
* SDK is on an older version than the API, then the API may respond with new members that
422421
* the SDK is unaware of.
423-
*
424422
* - It was constructed with an arbitrary value using the [of] method.
425423
*/
426424
enum class Value {

0 commit comments

Comments
 (0)