diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 21fa4455..d940b600 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.54.0"
+ ".": "0.55.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 1e64c91b..88277273 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 103
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-95a3d7780935a38e0cf076d4ad2d68bd1a5641bced8398d972db2e92751d364a.yml
-openapi_spec_hash: 9ebe818c4ad4f2d9c4e473b5192d7544
-config_hash: 54edf41f0377bc235f622fdaa7405f22
+configured_endpoints: 106
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-e8dad7eee5621fe2ba948dfd00dabf170d9d92ce615a9f04b0f546f4d8bf39ba.yml
+openapi_spec_hash: 3f6a98e3a1b3a47acebd67a960090ebf
+config_hash: 7e523cf79552b8936bd772f2e1025e5f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ab22053d..51e113d8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,19 @@
# Changelog
+## 0.55.0 (2025-04-08)
+
+Full Changelog: [v0.54.0...v0.55.0](https://github.com/orbcorp/orb-java/compare/v0.54.0...v0.55.0)
+
+### Features
+
+* **api:** api update ([#391](https://github.com/orbcorp/orb-java/issues/391)) ([7d1978f](https://github.com/orbcorp/orb-java/commit/7d1978fec3bc01cb0a02fff2433dcf4077469f58))
+
+
+### Chores
+
+* **internal:** codegen related update ([#393](https://github.com/orbcorp/orb-java/issues/393)) ([e941542](https://github.com/orbcorp/orb-java/commit/e941542e549401f37058816a428e6d334fa57d01))
+* **tests:** improve enum examples ([#394](https://github.com/orbcorp/orb-java/issues/394)) ([f1c810a](https://github.com/orbcorp/orb-java/commit/f1c810a7fd6a67722803f9baa6182a32d0644f1f))
+
## 0.54.0 (2025-04-07)
Full Changelog: [v0.53.0...v0.54.0](https://github.com/orbcorp/orb-java/compare/v0.53.0...v0.54.0)
diff --git a/README.md b/README.md
index 3c4906c4..9eb20414 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.54.0)
+[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.55.0)
@@ -19,7 +19,7 @@ The REST API documentation can be found on [docs.withorb.com](https://docs.witho
### Gradle
```kotlin
-implementation("com.withorb.api:orb-java:0.54.0")
+implementation("com.withorb.api:orb-java:0.55.0")
```
### Maven
@@ -28,7 +28,7 @@ implementation("com.withorb.api:orb-java:0.54.0")
com.withorb.api
orb-java
- 0.54.0
+ 0.55.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 760b2f73..f2cb58af 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,4 +1,4 @@
allprojects {
group = "com.withorb.api"
- version = "0.54.0" // x-release-please-version
+ version = "0.55.0" // x-release-please-version
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClient.kt b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClient.kt
index a35901a5..5151c17e 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClient.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClient.kt
@@ -14,6 +14,7 @@ import com.withorb.api.services.blocking.ItemService
import com.withorb.api.services.blocking.MetricService
import com.withorb.api.services.blocking.PlanService
import com.withorb.api.services.blocking.PriceService
+import com.withorb.api.services.blocking.SubscriptionChangeService
import com.withorb.api.services.blocking.SubscriptionService
import com.withorb.api.services.blocking.TopLevelService
import com.withorb.api.services.blocking.WebhookService
@@ -77,6 +78,8 @@ interface OrbClient {
fun dimensionalPriceGroups(): DimensionalPriceGroupService
+ fun subscriptionChanges(): SubscriptionChangeService
+
/**
* Closes this client, relinquishing any underlying resources.
*
@@ -120,5 +123,7 @@ interface OrbClient {
fun alerts(): AlertService.WithRawResponse
fun dimensionalPriceGroups(): DimensionalPriceGroupService.WithRawResponse
+
+ fun subscriptionChanges(): SubscriptionChangeService.WithRawResponse
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsync.kt
index 20b04b5c..c4723762 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsync.kt
@@ -14,6 +14,7 @@ import com.withorb.api.services.async.ItemServiceAsync
import com.withorb.api.services.async.MetricServiceAsync
import com.withorb.api.services.async.PlanServiceAsync
import com.withorb.api.services.async.PriceServiceAsync
+import com.withorb.api.services.async.SubscriptionChangeServiceAsync
import com.withorb.api.services.async.SubscriptionServiceAsync
import com.withorb.api.services.async.TopLevelServiceAsync
@@ -74,6 +75,8 @@ interface OrbClientAsync {
fun dimensionalPriceGroups(): DimensionalPriceGroupServiceAsync
+ fun subscriptionChanges(): SubscriptionChangeServiceAsync
+
/**
* Closes this client, relinquishing any underlying resources.
*
@@ -117,5 +120,7 @@ interface OrbClientAsync {
fun alerts(): AlertServiceAsync.WithRawResponse
fun dimensionalPriceGroups(): DimensionalPriceGroupServiceAsync.WithRawResponse
+
+ fun subscriptionChanges(): SubscriptionChangeServiceAsync.WithRawResponse
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsyncImpl.kt
index c74456d9..dffa5fe3 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsyncImpl.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsyncImpl.kt
@@ -28,6 +28,8 @@ import com.withorb.api.services.async.PlanServiceAsync
import com.withorb.api.services.async.PlanServiceAsyncImpl
import com.withorb.api.services.async.PriceServiceAsync
import com.withorb.api.services.async.PriceServiceAsyncImpl
+import com.withorb.api.services.async.SubscriptionChangeServiceAsync
+import com.withorb.api.services.async.SubscriptionChangeServiceAsyncImpl
import com.withorb.api.services.async.SubscriptionServiceAsync
import com.withorb.api.services.async.SubscriptionServiceAsyncImpl
import com.withorb.api.services.async.TopLevelServiceAsync
@@ -102,6 +104,10 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs
DimensionalPriceGroupServiceAsyncImpl(clientOptionsWithUserAgent)
}
+ private val subscriptionChanges: SubscriptionChangeServiceAsync by lazy {
+ SubscriptionChangeServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
override fun sync(): OrbClient = sync
override fun withRawResponse(): OrbClientAsync.WithRawResponse = withRawResponse
@@ -135,6 +141,8 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs
override fun dimensionalPriceGroups(): DimensionalPriceGroupServiceAsync =
dimensionalPriceGroups
+ override fun subscriptionChanges(): SubscriptionChangeServiceAsync = subscriptionChanges
+
override fun close() = clientOptions.httpClient.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -197,6 +205,10 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs
DimensionalPriceGroupServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
+ private val subscriptionChanges: SubscriptionChangeServiceAsync.WithRawResponse by lazy {
+ SubscriptionChangeServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
override fun topLevel(): TopLevelServiceAsync.WithRawResponse = topLevel
override fun coupons(): CouponServiceAsync.WithRawResponse = coupons
@@ -226,5 +238,8 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs
override fun dimensionalPriceGroups(): DimensionalPriceGroupServiceAsync.WithRawResponse =
dimensionalPriceGroups
+
+ override fun subscriptionChanges(): SubscriptionChangeServiceAsync.WithRawResponse =
+ subscriptionChanges
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientImpl.kt
index 1c5d79f4..361ec509 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientImpl.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientImpl.kt
@@ -28,6 +28,8 @@ import com.withorb.api.services.blocking.PlanService
import com.withorb.api.services.blocking.PlanServiceImpl
import com.withorb.api.services.blocking.PriceService
import com.withorb.api.services.blocking.PriceServiceImpl
+import com.withorb.api.services.blocking.SubscriptionChangeService
+import com.withorb.api.services.blocking.SubscriptionChangeServiceImpl
import com.withorb.api.services.blocking.SubscriptionService
import com.withorb.api.services.blocking.SubscriptionServiceImpl
import com.withorb.api.services.blocking.TopLevelService
@@ -94,6 +96,10 @@ class OrbClientImpl(private val clientOptions: ClientOptions) : OrbClient {
private val webhooks: WebhookService by lazy { WebhookServiceImpl(clientOptions) }
+ private val subscriptionChanges: SubscriptionChangeService by lazy {
+ SubscriptionChangeServiceImpl(clientOptionsWithUserAgent)
+ }
+
override fun async(): OrbClientAsync = async
override fun withRawResponse(): OrbClient.WithRawResponse = withRawResponse
@@ -128,6 +134,8 @@ class OrbClientImpl(private val clientOptions: ClientOptions) : OrbClient {
override fun dimensionalPriceGroups(): DimensionalPriceGroupService = dimensionalPriceGroups
+ override fun subscriptionChanges(): SubscriptionChangeService = subscriptionChanges
+
override fun close() = clientOptions.httpClient.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -189,6 +197,10 @@ class OrbClientImpl(private val clientOptions: ClientOptions) : OrbClient {
DimensionalPriceGroupServiceImpl.WithRawResponseImpl(clientOptions)
}
+ private val subscriptionChanges: SubscriptionChangeService.WithRawResponse by lazy {
+ SubscriptionChangeServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
override fun topLevel(): TopLevelService.WithRawResponse = topLevel
override fun coupons(): CouponService.WithRawResponse = coupons
@@ -217,5 +229,8 @@ class OrbClientImpl(private val clientOptions: ClientOptions) : OrbClient {
override fun dimensionalPriceGroups(): DimensionalPriceGroupService.WithRawResponse =
dimensionalPriceGroups
+
+ override fun subscriptionChanges(): SubscriptionChangeService.WithRawResponse =
+ subscriptionChanges
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Customer.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Customer.kt
index 8d475a34..ce484275 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Customer.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Customer.kt
@@ -351,7 +351,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -1068,7 +1068,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -2968,7 +2968,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreateParams.kt
index e17c37dc..c6d81bff 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreateParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreateParams.kt
@@ -254,7 +254,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -934,7 +934,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -1444,7 +1444,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -2198,7 +2198,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -5072,7 +5072,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateByExternalIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateByExternalIdParams.kt
index 49049f7e..abdb287c 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateByExternalIdParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateByExternalIdParams.kt
@@ -251,7 +251,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -925,7 +925,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -1421,7 +1421,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -2155,7 +2155,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -5002,7 +5002,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateParams.kt
index 92a26469..5e40f2bf 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateParams.kt
@@ -252,7 +252,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -923,7 +923,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -1419,7 +1419,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -2151,7 +2151,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -4998,7 +4998,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Invoice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Invoice.kt
index 48c89237..6af774be 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Invoice.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Invoice.kt
@@ -368,7 +368,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -1371,7 +1371,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -4719,7 +4719,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceCreateParams.kt
index 1db25b6e..0a231fd9 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceCreateParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceCreateParams.kt
@@ -111,8 +111,8 @@ private constructor(
fun metadata(): Optional = body.metadata()
/**
- * When true, this invoice will automatically be issued upon creation. When false, the resulting
- * invoice will require manual review to issue. Defaulted to false.
+ * When true, this invoice will be submitted for issuance upon creation. When false, the
+ * resulting invoice will require manual review to issue. Defaulted to false.
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
* responded with an unexpected value).
@@ -422,7 +422,7 @@ private constructor(
fun metadata(metadata: JsonField) = apply { body.metadata(metadata) }
/**
- * When true, this invoice will automatically be issued upon creation. When false, the
+ * When true, this invoice will be submitted for issuance upon creation. When false, the
* resulting invoice will require manual review to issue. Defaulted to false.
*/
fun willAutoIssue(willAutoIssue: Boolean) = apply { body.willAutoIssue(willAutoIssue) }
@@ -720,7 +720,7 @@ private constructor(
fun metadata(): Optional = metadata.getOptional("metadata")
/**
- * When true, this invoice will automatically be issued upon creation. When false, the
+ * When true, this invoice will be submitted for issuance upon creation. When false, the
* resulting invoice will require manual review to issue. Defaulted to false.
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
@@ -1065,7 +1065,7 @@ private constructor(
fun metadata(metadata: JsonField) = apply { this.metadata = metadata }
/**
- * When true, this invoice will automatically be issued upon creation. When false, the
+ * When true, this invoice will be submitted for issuance upon creation. When false, the
* resulting invoice will require manual review to issue. Defaulted to false.
*/
fun willAutoIssue(willAutoIssue: Boolean) = willAutoIssue(JsonField.of(willAutoIssue))
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponse.kt
index f42c44b2..c45d7264 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponse.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponse.kt
@@ -361,7 +361,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -1365,7 +1365,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
@@ -4710,7 +4710,7 @@ private constructor(
* |Norway |`no_voec` |Norwegian VAT on e-commerce Number |
* |Oman |`om_vat` |Omani VAT Number |
* |Peru |`pe_ruc` |Peruvian RUC Number |
- * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
+ * |Philippines |`ph_tin ` |Philippines Tax Identification Number |
* |Poland |`eu_vat` |European VAT Number |
* |Portugal |`eu_vat` |European VAT Number |
* |Romania |`eu_vat` |European VAT Number |
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanCreateParams.kt
index 8864f36f..de56dcf2 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanCreateParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanCreateParams.kt
@@ -10582,7 +10582,7 @@ private constructor(
) : this(firstUnit, unitAmount, lastUnit, mutableMapOf())
/**
- * Inclusive tier starting value
+ * Exclusive tier starting value
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type or
* is unexpectedly missing or null (e.g. if the server responded with an
@@ -10600,7 +10600,7 @@ private constructor(
fun unitAmount(): String = unitAmount.getRequired("unit_amount")
/**
- * Exclusive tier ending value. If null, this is treated as the last tier
+ * Inclusive tier ending value. If null, this is treated as the last tier
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type
* (e.g. if the server responded with an unexpected value).
@@ -10680,7 +10680,7 @@ private constructor(
additionalProperties = tier.additionalProperties.toMutableMap()
}
- /** Inclusive tier starting value */
+ /** Exclusive tier starting value */
fun firstUnit(firstUnit: Double) = firstUnit(JsonField.of(firstUnit))
/**
@@ -10709,7 +10709,7 @@ private constructor(
}
/**
- * Exclusive tier ending value. If null, this is treated as the last tier
+ * Inclusive tier ending value. If null, this is treated as the last tier
*/
fun lastUnit(lastUnit: Double?) = lastUnit(JsonField.ofNullable(lastUnit))
@@ -13038,7 +13038,7 @@ private constructor(
fun bps(): Double = bps.getRequired("bps")
/**
- * Inclusive tier starting value
+ * Exclusive tier starting value
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type or
* is unexpectedly missing or null (e.g. if the server responded with an
@@ -13047,7 +13047,7 @@ private constructor(
fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount")
/**
- * Exclusive tier ending value
+ * Inclusive tier ending value
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type
* (e.g. if the server responded with an unexpected value).
@@ -13159,7 +13159,7 @@ private constructor(
*/
fun bps(bps: JsonField) = apply { this.bps = bps }
- /** Inclusive tier starting value */
+ /** Exclusive tier starting value */
fun minimumAmount(minimumAmount: String) =
minimumAmount(JsonField.of(minimumAmount))
@@ -13174,7 +13174,7 @@ private constructor(
this.minimumAmount = minimumAmount
}
- /** Exclusive tier ending value */
+ /** Inclusive tier ending value */
fun maximumAmount(maximumAmount: String?) =
maximumAmount(JsonField.ofNullable(maximumAmount))
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Price.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Price.kt
index aa281bf9..6aa20c66 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Price.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Price.kt
@@ -16463,7 +16463,7 @@ private constructor(
) : this(firstUnit, unitAmount, lastUnit, mutableMapOf())
/**
- * Inclusive tier starting value
+ * Exclusive tier starting value
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected
@@ -16481,7 +16481,7 @@ private constructor(
fun unitAmount(): String = unitAmount.getRequired("unit_amount")
/**
- * Exclusive tier ending value. If null, this is treated as the last tier
+ * Inclusive tier ending value. If null, this is treated as the last tier
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
@@ -16560,7 +16560,7 @@ private constructor(
additionalProperties = tier.additionalProperties.toMutableMap()
}
- /** Inclusive tier starting value */
+ /** Exclusive tier starting value */
fun firstUnit(firstUnit: Double) = firstUnit(JsonField.of(firstUnit))
/**
@@ -16588,7 +16588,7 @@ private constructor(
this.unitAmount = unitAmount
}
- /** Exclusive tier ending value. If null, this is treated as the last tier */
+ /** Inclusive tier ending value. If null, this is treated as the last tier */
fun lastUnit(lastUnit: Double?) = lastUnit(JsonField.ofNullable(lastUnit))
/**
@@ -20566,7 +20566,7 @@ private constructor(
fun bps(): Double = bps.getRequired("bps")
/**
- * Inclusive tier starting value
+ * Exclusive tier starting value
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected
@@ -20575,7 +20575,7 @@ private constructor(
fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount")
/**
- * Exclusive tier ending value
+ * Inclusive tier ending value
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
@@ -20684,7 +20684,7 @@ private constructor(
*/
fun bps(bps: JsonField) = apply { this.bps = bps }
- /** Inclusive tier starting value */
+ /** Exclusive tier starting value */
fun minimumAmount(minimumAmount: String) =
minimumAmount(JsonField.of(minimumAmount))
@@ -20699,7 +20699,7 @@ private constructor(
this.minimumAmount = minimumAmount
}
- /** Exclusive tier ending value */
+ /** Inclusive tier ending value */
fun maximumAmount(maximumAmount: String?) =
maximumAmount(JsonField.ofNullable(maximumAmount))
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceCreateParams.kt
index d3660f9f..e9b9c86e 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceCreateParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceCreateParams.kt
@@ -12601,7 +12601,7 @@ private constructor(
) : this(firstUnit, unitAmount, lastUnit, mutableMapOf())
/**
- * Inclusive tier starting value
+ * Exclusive tier starting value
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type or
* is unexpectedly missing or null (e.g. if the server responded with an
@@ -12619,7 +12619,7 @@ private constructor(
fun unitAmount(): String = unitAmount.getRequired("unit_amount")
/**
- * Exclusive tier ending value. If null, this is treated as the last tier
+ * Inclusive tier ending value. If null, this is treated as the last tier
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type
* (e.g. if the server responded with an unexpected value).
@@ -12699,7 +12699,7 @@ private constructor(
additionalProperties = tier.additionalProperties.toMutableMap()
}
- /** Inclusive tier starting value */
+ /** Exclusive tier starting value */
fun firstUnit(firstUnit: Double) = firstUnit(JsonField.of(firstUnit))
/**
@@ -12728,7 +12728,7 @@ private constructor(
}
/**
- * Exclusive tier ending value. If null, this is treated as the last tier
+ * Inclusive tier ending value. If null, this is treated as the last tier
*/
fun lastUnit(lastUnit: Double?) = lastUnit(JsonField.ofNullable(lastUnit))
@@ -15055,7 +15055,7 @@ private constructor(
fun bps(): Double = bps.getRequired("bps")
/**
- * Inclusive tier starting value
+ * Exclusive tier starting value
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type or
* is unexpectedly missing or null (e.g. if the server responded with an
@@ -15064,7 +15064,7 @@ private constructor(
fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount")
/**
- * Exclusive tier ending value
+ * Inclusive tier ending value
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type
* (e.g. if the server responded with an unexpected value).
@@ -15176,7 +15176,7 @@ private constructor(
*/
fun bps(bps: JsonField) = apply { this.bps = bps }
- /** Inclusive tier starting value */
+ /** Exclusive tier starting value */
fun minimumAmount(minimumAmount: String) =
minimumAmount(JsonField.of(minimumAmount))
@@ -15191,7 +15191,7 @@ private constructor(
this.minimumAmount = minimumAmount
}
- /** Exclusive tier ending value */
+ /** Inclusive tier ending value */
fun maximumAmount(maximumAmount: String?) =
maximumAmount(JsonField.ofNullable(maximumAmount))
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt
index 0ad51203..94fc2b50 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt
@@ -69,6 +69,7 @@ private constructor(
private val metadata: JsonField,
private val minimumIntervals: JsonField>,
private val netTerms: JsonField,
+ private val pendingSubscriptionChange: JsonField,
private val plan: JsonField,
private val priceIntervals: JsonField>,
private val redeemedCoupon: JsonField,
@@ -130,6 +131,9 @@ private constructor(
@ExcludeMissing
minimumIntervals: JsonField> = JsonMissing.of(),
@JsonProperty("net_terms") @ExcludeMissing netTerms: JsonField = JsonMissing.of(),
+ @JsonProperty("pending_subscription_change")
+ @ExcludeMissing
+ pendingSubscriptionChange: JsonField = JsonMissing.of(),
@JsonProperty("plan") @ExcludeMissing plan: JsonField = JsonMissing.of(),
@JsonProperty("price_intervals")
@ExcludeMissing
@@ -164,6 +168,7 @@ private constructor(
metadata,
minimumIntervals,
netTerms,
+ pendingSubscriptionChange,
plan,
priceIntervals,
redeemedCoupon,
@@ -355,6 +360,15 @@ private constructor(
*/
fun netTerms(): Long = netTerms.getRequired("net_terms")
+ /**
+ * A pending subscription change if one exists on this subscription.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
+ * responded with an unexpected value).
+ */
+ fun pendingSubscriptionChange(): Optional =
+ pendingSubscriptionChange.getOptional("pending_subscription_change")
+
/**
* The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed
* to by a customer. Plans define the billing behavior of the subscription. You can see more
@@ -573,6 +587,17 @@ private constructor(
*/
@JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms
+ /**
+ * Returns the raw JSON value of [pendingSubscriptionChange].
+ *
+ * Unlike [pendingSubscriptionChange], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("pending_subscription_change")
+ @ExcludeMissing
+ fun _pendingSubscriptionChange(): JsonField =
+ pendingSubscriptionChange
+
/**
* Returns the raw JSON value of [plan].
*
@@ -659,6 +684,7 @@ private constructor(
* .metadata()
* .minimumIntervals()
* .netTerms()
+ * .pendingSubscriptionChange()
* .plan()
* .priceIntervals()
* .redeemedCoupon()
@@ -694,6 +720,7 @@ private constructor(
private var metadata: JsonField? = null
private var minimumIntervals: JsonField>? = null
private var netTerms: JsonField? = null
+ private var pendingSubscriptionChange: JsonField? = null
private var plan: JsonField? = null
private var priceIntervals: JsonField>? = null
private var redeemedCoupon: JsonField? = null
@@ -724,6 +751,7 @@ private constructor(
metadata = subscription.metadata
minimumIntervals = subscription.minimumIntervals.map { it.toMutableList() }
netTerms = subscription.netTerms
+ pendingSubscriptionChange = subscription.pendingSubscriptionChange
plan = subscription.plan
priceIntervals = subscription.priceIntervals.map { it.toMutableList() }
redeemedCoupon = subscription.redeemedCoupon
@@ -1174,6 +1202,29 @@ private constructor(
*/
fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms }
+ /** A pending subscription change if one exists on this subscription. */
+ fun pendingSubscriptionChange(pendingSubscriptionChange: PendingSubscriptionChange?) =
+ pendingSubscriptionChange(JsonField.ofNullable(pendingSubscriptionChange))
+
+ /**
+ * Alias for calling [Builder.pendingSubscriptionChange] with
+ * `pendingSubscriptionChange.orElse(null)`.
+ */
+ fun pendingSubscriptionChange(
+ pendingSubscriptionChange: Optional
+ ) = pendingSubscriptionChange(pendingSubscriptionChange.getOrNull())
+
+ /**
+ * Sets [Builder.pendingSubscriptionChange] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.pendingSubscriptionChange] with a well-typed
+ * [PendingSubscriptionChange] value instead. This method is primarily for setting the field
+ * to an undocumented or not yet supported value.
+ */
+ fun pendingSubscriptionChange(
+ pendingSubscriptionChange: JsonField
+ ) = apply { this.pendingSubscriptionChange = pendingSubscriptionChange }
+
/**
* The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
* subscribed to by a customer. Plans define the billing behavior of the subscription. You
@@ -1312,6 +1363,7 @@ private constructor(
* .metadata()
* .minimumIntervals()
* .netTerms()
+ * .pendingSubscriptionChange()
* .plan()
* .priceIntervals()
* .redeemedCoupon()
@@ -1345,6 +1397,7 @@ private constructor(
checkRequired("metadata", metadata),
checkRequired("minimumIntervals", minimumIntervals).map { it.toImmutable() },
checkRequired("netTerms", netTerms),
+ checkRequired("pendingSubscriptionChange", pendingSubscriptionChange),
checkRequired("plan", plan),
checkRequired("priceIntervals", priceIntervals).map { it.toImmutable() },
checkRequired("redeemedCoupon", redeemedCoupon),
@@ -1381,6 +1434,7 @@ private constructor(
metadata().validate()
minimumIntervals().forEach { it.validate() }
netTerms()
+ pendingSubscriptionChange().ifPresent { it.validate() }
plan().validate()
priceIntervals().forEach { it.validate() }
redeemedCoupon().ifPresent { it.validate() }
@@ -1424,6 +1478,7 @@ private constructor(
(metadata.asKnown().getOrNull()?.validity() ?: 0) +
(minimumIntervals.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(if (netTerms.asKnown().isPresent) 1 else 0) +
+ (pendingSubscriptionChange.asKnown().getOrNull()?.validity() ?: 0) +
(plan.asKnown().getOrNull()?.validity() ?: 0) +
(priceIntervals.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(redeemedCoupon.asKnown().getOrNull()?.validity() ?: 0) +
@@ -8516,6 +8571,163 @@ private constructor(
"MinimumInterval{appliesToPriceIds=$appliesToPriceIds, appliesToPriceIntervalIds=$appliesToPriceIntervalIds, endDate=$endDate, minimumAmount=$minimumAmount, startDate=$startDate, additionalProperties=$additionalProperties}"
}
+ /** A pending subscription change if one exists on this subscription. */
+ class PendingSubscriptionChange
+ private constructor(
+ private val id: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of()
+ ) : this(id, mutableMapOf())
+
+ /**
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun id(): String = id.getRequired("id")
+
+ /**
+ * Returns the raw JSON value of [id].
+ *
+ * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [PendingSubscriptionChange].
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [PendingSubscriptionChange]. */
+ class Builder internal constructor() {
+
+ private var id: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(pendingSubscriptionChange: PendingSubscriptionChange) = apply {
+ id = pendingSubscriptionChange.id
+ additionalProperties = pendingSubscriptionChange.additionalProperties.toMutableMap()
+ }
+
+ fun id(id: String) = id(JsonField.of(id))
+
+ /**
+ * Sets [Builder.id] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.id] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun id(id: JsonField) = apply { this.id = id }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [PendingSubscriptionChange].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): PendingSubscriptionChange =
+ PendingSubscriptionChange(
+ checkRequired("id", id),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): PendingSubscriptionChange = apply {
+ if (validated) {
+ return@apply
+ }
+
+ id()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OrbInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic internal fun validity(): Int = (if (id.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is PendingSubscriptionChange && id == other.id && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(id, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "PendingSubscriptionChange{id=$id, additionalProperties=$additionalProperties}"
+ }
+
/**
* The Price Interval resource represents a period of time for which a price will bill on a
* subscription. A subscription’s price intervals define its billing behavior.
@@ -10105,15 +10317,15 @@ private constructor(
return true
}
- return /* spotless:off */ other is Subscription && id == other.id && activePlanPhaseOrder == other.activePlanPhaseOrder && adjustmentIntervals == other.adjustmentIntervals && autoCollection == other.autoCollection && billingCycleAnchorConfiguration == other.billingCycleAnchorConfiguration && billingCycleDay == other.billingCycleDay && createdAt == other.createdAt && currentBillingPeriodEndDate == other.currentBillingPeriodEndDate && currentBillingPeriodStartDate == other.currentBillingPeriodStartDate && customer == other.customer && defaultInvoiceMemo == other.defaultInvoiceMemo && discountIntervals == other.discountIntervals && endDate == other.endDate && fixedFeeQuantitySchedule == other.fixedFeeQuantitySchedule && invoicingThreshold == other.invoicingThreshold && maximumIntervals == other.maximumIntervals && metadata == other.metadata && minimumIntervals == other.minimumIntervals && netTerms == other.netTerms && plan == other.plan && priceIntervals == other.priceIntervals && redeemedCoupon == other.redeemedCoupon && startDate == other.startDate && status == other.status && trialInfo == other.trialInfo && additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Subscription && id == other.id && activePlanPhaseOrder == other.activePlanPhaseOrder && adjustmentIntervals == other.adjustmentIntervals && autoCollection == other.autoCollection && billingCycleAnchorConfiguration == other.billingCycleAnchorConfiguration && billingCycleDay == other.billingCycleDay && createdAt == other.createdAt && currentBillingPeriodEndDate == other.currentBillingPeriodEndDate && currentBillingPeriodStartDate == other.currentBillingPeriodStartDate && customer == other.customer && defaultInvoiceMemo == other.defaultInvoiceMemo && discountIntervals == other.discountIntervals && endDate == other.endDate && fixedFeeQuantitySchedule == other.fixedFeeQuantitySchedule && invoicingThreshold == other.invoicingThreshold && maximumIntervals == other.maximumIntervals && metadata == other.metadata && minimumIntervals == other.minimumIntervals && netTerms == other.netTerms && pendingSubscriptionChange == other.pendingSubscriptionChange && plan == other.plan && priceIntervals == other.priceIntervals && redeemedCoupon == other.redeemedCoupon && startDate == other.startDate && status == other.status && trialInfo == other.trialInfo && additionalProperties == other.additionalProperties /* spotless:on */
}
/* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(id, activePlanPhaseOrder, adjustmentIntervals, autoCollection, billingCycleAnchorConfiguration, billingCycleDay, createdAt, currentBillingPeriodEndDate, currentBillingPeriodStartDate, customer, defaultInvoiceMemo, discountIntervals, endDate, fixedFeeQuantitySchedule, invoicingThreshold, maximumIntervals, metadata, minimumIntervals, netTerms, plan, priceIntervals, redeemedCoupon, startDate, status, trialInfo, additionalProperties) }
+ private val hashCode: Int by lazy { Objects.hash(id, activePlanPhaseOrder, adjustmentIntervals, autoCollection, billingCycleAnchorConfiguration, billingCycleDay, createdAt, currentBillingPeriodEndDate, currentBillingPeriodStartDate, customer, defaultInvoiceMemo, discountIntervals, endDate, fixedFeeQuantitySchedule, invoicingThreshold, maximumIntervals, metadata, minimumIntervals, netTerms, pendingSubscriptionChange, plan, priceIntervals, redeemedCoupon, startDate, status, trialInfo, additionalProperties) }
/* spotless:on */
override fun hashCode(): Int = hashCode
override fun toString() =
- "Subscription{id=$id, activePlanPhaseOrder=$activePlanPhaseOrder, adjustmentIntervals=$adjustmentIntervals, autoCollection=$autoCollection, billingCycleAnchorConfiguration=$billingCycleAnchorConfiguration, billingCycleDay=$billingCycleDay, createdAt=$createdAt, currentBillingPeriodEndDate=$currentBillingPeriodEndDate, currentBillingPeriodStartDate=$currentBillingPeriodStartDate, customer=$customer, defaultInvoiceMemo=$defaultInvoiceMemo, discountIntervals=$discountIntervals, endDate=$endDate, fixedFeeQuantitySchedule=$fixedFeeQuantitySchedule, invoicingThreshold=$invoicingThreshold, maximumIntervals=$maximumIntervals, metadata=$metadata, minimumIntervals=$minimumIntervals, netTerms=$netTerms, plan=$plan, priceIntervals=$priceIntervals, redeemedCoupon=$redeemedCoupon, startDate=$startDate, status=$status, trialInfo=$trialInfo, additionalProperties=$additionalProperties}"
+ "Subscription{id=$id, activePlanPhaseOrder=$activePlanPhaseOrder, adjustmentIntervals=$adjustmentIntervals, autoCollection=$autoCollection, billingCycleAnchorConfiguration=$billingCycleAnchorConfiguration, billingCycleDay=$billingCycleDay, createdAt=$createdAt, currentBillingPeriodEndDate=$currentBillingPeriodEndDate, currentBillingPeriodStartDate=$currentBillingPeriodStartDate, customer=$customer, defaultInvoiceMemo=$defaultInvoiceMemo, discountIntervals=$discountIntervals, endDate=$endDate, fixedFeeQuantitySchedule=$fixedFeeQuantitySchedule, invoicingThreshold=$invoicingThreshold, maximumIntervals=$maximumIntervals, metadata=$metadata, minimumIntervals=$minimumIntervals, netTerms=$netTerms, pendingSubscriptionChange=$pendingSubscriptionChange, plan=$plan, priceIntervals=$priceIntervals, redeemedCoupon=$redeemedCoupon, startDate=$startDate, status=$status, trialInfo=$trialInfo, additionalProperties=$additionalProperties}"
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt
index 1e1202ec..b1147de0 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt
@@ -52,12 +52,14 @@ private constructor(
private val metadata: JsonField,
private val minimumIntervals: JsonField>,
private val netTerms: JsonField,
+ private val pendingSubscriptionChange: JsonField,
private val plan: JsonField,
private val priceIntervals: JsonField>,
private val redeemedCoupon: JsonField,
private val startDate: JsonField,
private val status: JsonField,
private val trialInfo: JsonField,
+ private val changedResources: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -113,6 +115,9 @@ private constructor(
@ExcludeMissing
minimumIntervals: JsonField> = JsonMissing.of(),
@JsonProperty("net_terms") @ExcludeMissing netTerms: JsonField = JsonMissing.of(),
+ @JsonProperty("pending_subscription_change")
+ @ExcludeMissing
+ pendingSubscriptionChange: JsonField = JsonMissing.of(),
@JsonProperty("plan") @ExcludeMissing plan: JsonField = JsonMissing.of(),
@JsonProperty("price_intervals")
@ExcludeMissing
@@ -127,6 +132,9 @@ private constructor(
@JsonProperty("trial_info")
@ExcludeMissing
trialInfo: JsonField = JsonMissing.of(),
+ @JsonProperty("changed_resources")
+ @ExcludeMissing
+ changedResources: JsonField = JsonMissing.of(),
) : this(
id,
activePlanPhaseOrder,
@@ -147,12 +155,14 @@ private constructor(
metadata,
minimumIntervals,
netTerms,
+ pendingSubscriptionChange,
plan,
priceIntervals,
redeemedCoupon,
startDate,
status,
trialInfo,
+ changedResources,
mutableMapOf(),
)
@@ -338,6 +348,15 @@ private constructor(
*/
fun netTerms(): Long = netTerms.getRequired("net_terms")
+ /**
+ * A pending subscription change if one exists on this subscription.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
+ * responded with an unexpected value).
+ */
+ fun pendingSubscriptionChange(): Optional =
+ pendingSubscriptionChange.getOptional("pending_subscription_change")
+
/**
* The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed
* to by a customer. Plans define the billing behavior of the subscription. You can see more
@@ -382,6 +401,17 @@ private constructor(
*/
fun trialInfo(): TrialInfo = trialInfo.getRequired("trial_info")
+ /**
+ * The resources that were changed as part of this operation. Only present when fetched through
+ * the subscription changes API or if the `include_changed_resources` parameter was passed in
+ * the request.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
+ * responded with an unexpected value).
+ */
+ fun changedResources(): Optional =
+ changedResources.getOptional("changed_resources")
+
/**
* Returns the raw JSON value of [id].
*
@@ -556,6 +586,17 @@ private constructor(
*/
@JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms
+ /**
+ * Returns the raw JSON value of [pendingSubscriptionChange].
+ *
+ * Unlike [pendingSubscriptionChange], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("pending_subscription_change")
+ @ExcludeMissing
+ fun _pendingSubscriptionChange(): JsonField =
+ pendingSubscriptionChange
+
/**
* Returns the raw JSON value of [plan].
*
@@ -604,6 +645,16 @@ private constructor(
*/
@JsonProperty("trial_info") @ExcludeMissing fun _trialInfo(): JsonField = trialInfo
+ /**
+ * Returns the raw JSON value of [changedResources].
+ *
+ * Unlike [changedResources], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("changed_resources")
+ @ExcludeMissing
+ fun _changedResources(): JsonField = changedResources
+
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
@@ -642,6 +693,7 @@ private constructor(
* .metadata()
* .minimumIntervals()
* .netTerms()
+ * .pendingSubscriptionChange()
* .plan()
* .priceIntervals()
* .redeemedCoupon()
@@ -677,12 +729,14 @@ private constructor(
private var metadata: JsonField? = null
private var minimumIntervals: JsonField>? = null
private var netTerms: JsonField? = null
+ private var pendingSubscriptionChange: JsonField? = null
private var plan: JsonField? = null
private var priceIntervals: JsonField>? = null
private var redeemedCoupon: JsonField? = null
private var startDate: JsonField? = null
private var status: JsonField? = null
private var trialInfo: JsonField? = null
+ private var changedResources: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -712,12 +766,14 @@ private constructor(
minimumIntervals =
subscriptionCancelResponse.minimumIntervals.map { it.toMutableList() }
netTerms = subscriptionCancelResponse.netTerms
+ pendingSubscriptionChange = subscriptionCancelResponse.pendingSubscriptionChange
plan = subscriptionCancelResponse.plan
priceIntervals = subscriptionCancelResponse.priceIntervals.map { it.toMutableList() }
redeemedCoupon = subscriptionCancelResponse.redeemedCoupon
startDate = subscriptionCancelResponse.startDate
status = subscriptionCancelResponse.status
trialInfo = subscriptionCancelResponse.trialInfo
+ changedResources = subscriptionCancelResponse.changedResources
additionalProperties = subscriptionCancelResponse.additionalProperties.toMutableMap()
}
@@ -1162,6 +1218,29 @@ private constructor(
*/
fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms }
+ /** A pending subscription change if one exists on this subscription. */
+ fun pendingSubscriptionChange(pendingSubscriptionChange: PendingSubscriptionChange?) =
+ pendingSubscriptionChange(JsonField.ofNullable(pendingSubscriptionChange))
+
+ /**
+ * Alias for calling [Builder.pendingSubscriptionChange] with
+ * `pendingSubscriptionChange.orElse(null)`.
+ */
+ fun pendingSubscriptionChange(
+ pendingSubscriptionChange: Optional
+ ) = pendingSubscriptionChange(pendingSubscriptionChange.getOrNull())
+
+ /**
+ * Sets [Builder.pendingSubscriptionChange] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.pendingSubscriptionChange] with a well-typed
+ * [PendingSubscriptionChange] value instead. This method is primarily for setting the field
+ * to an undocumented or not yet supported value.
+ */
+ fun pendingSubscriptionChange(
+ pendingSubscriptionChange: JsonField
+ ) = apply { this.pendingSubscriptionChange = pendingSubscriptionChange }
+
/**
* The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
* subscribed to by a customer. Plans define the billing behavior of the subscription. You
@@ -1255,6 +1334,29 @@ private constructor(
*/
fun trialInfo(trialInfo: JsonField) = apply { this.trialInfo = trialInfo }
+ /**
+ * The resources that were changed as part of this operation. Only present when fetched
+ * through the subscription changes API or if the `include_changed_resources` parameter was
+ * passed in the request.
+ */
+ fun changedResources(changedResources: ChangedResources?) =
+ changedResources(JsonField.ofNullable(changedResources))
+
+ /** Alias for calling [Builder.changedResources] with `changedResources.orElse(null)`. */
+ fun changedResources(changedResources: Optional) =
+ changedResources(changedResources.getOrNull())
+
+ /**
+ * Sets [Builder.changedResources] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.changedResources] with a well-typed [ChangedResources]
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun changedResources(changedResources: JsonField) = apply {
+ this.changedResources = changedResources
+ }
+
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -1300,6 +1402,7 @@ private constructor(
* .metadata()
* .minimumIntervals()
* .netTerms()
+ * .pendingSubscriptionChange()
* .plan()
* .priceIntervals()
* .redeemedCoupon()
@@ -1333,12 +1436,14 @@ private constructor(
checkRequired("metadata", metadata),
checkRequired("minimumIntervals", minimumIntervals).map { it.toImmutable() },
checkRequired("netTerms", netTerms),
+ checkRequired("pendingSubscriptionChange", pendingSubscriptionChange),
checkRequired("plan", plan),
checkRequired("priceIntervals", priceIntervals).map { it.toImmutable() },
checkRequired("redeemedCoupon", redeemedCoupon),
checkRequired("startDate", startDate),
checkRequired("status", status),
checkRequired("trialInfo", trialInfo),
+ changedResources,
additionalProperties.toMutableMap(),
)
}
@@ -1369,12 +1474,14 @@ private constructor(
metadata().validate()
minimumIntervals().forEach { it.validate() }
netTerms()
+ pendingSubscriptionChange().ifPresent { it.validate() }
plan().validate()
priceIntervals().forEach { it.validate() }
redeemedCoupon().ifPresent { it.validate() }
startDate()
status().validate()
trialInfo().validate()
+ changedResources().ifPresent { it.validate() }
validated = true
}
@@ -1412,12 +1519,14 @@ private constructor(
(metadata.asKnown().getOrNull()?.validity() ?: 0) +
(minimumIntervals.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(if (netTerms.asKnown().isPresent) 1 else 0) +
+ (pendingSubscriptionChange.asKnown().getOrNull()?.validity() ?: 0) +
(plan.asKnown().getOrNull()?.validity() ?: 0) +
(priceIntervals.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(redeemedCoupon.asKnown().getOrNull()?.validity() ?: 0) +
(if (startDate.asKnown().isPresent) 1 else 0) +
(status.asKnown().getOrNull()?.validity() ?: 0) +
- (trialInfo.asKnown().getOrNull()?.validity() ?: 0)
+ (trialInfo.asKnown().getOrNull()?.validity() ?: 0) +
+ (changedResources.asKnown().getOrNull()?.validity() ?: 0)
class AdjustmentInterval
private constructor(
@@ -8504,6 +8613,163 @@ private constructor(
"MinimumInterval{appliesToPriceIds=$appliesToPriceIds, appliesToPriceIntervalIds=$appliesToPriceIntervalIds, endDate=$endDate, minimumAmount=$minimumAmount, startDate=$startDate, additionalProperties=$additionalProperties}"
}
+ /** A pending subscription change if one exists on this subscription. */
+ class PendingSubscriptionChange
+ private constructor(
+ private val id: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of()
+ ) : this(id, mutableMapOf())
+
+ /**
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun id(): String = id.getRequired("id")
+
+ /**
+ * Returns the raw JSON value of [id].
+ *
+ * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [PendingSubscriptionChange].
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [PendingSubscriptionChange]. */
+ class Builder internal constructor() {
+
+ private var id: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(pendingSubscriptionChange: PendingSubscriptionChange) = apply {
+ id = pendingSubscriptionChange.id
+ additionalProperties = pendingSubscriptionChange.additionalProperties.toMutableMap()
+ }
+
+ fun id(id: String) = id(JsonField.of(id))
+
+ /**
+ * Sets [Builder.id] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.id] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun id(id: JsonField) = apply { this.id = id }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [PendingSubscriptionChange].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): PendingSubscriptionChange =
+ PendingSubscriptionChange(
+ checkRequired("id", id),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): PendingSubscriptionChange = apply {
+ if (validated) {
+ return@apply
+ }
+
+ id()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OrbInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic internal fun validity(): Int = (if (id.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is PendingSubscriptionChange && id == other.id && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(id, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "PendingSubscriptionChange{id=$id, additionalProperties=$additionalProperties}"
+ }
+
/**
* The Price Interval resource represents a period of time for which a price will bill on a
* subscription. A subscription’s price intervals define its billing behavior.
@@ -10088,20 +10354,383 @@ private constructor(
"TrialInfo{endDate=$endDate, additionalProperties=$additionalProperties}"
}
+ /**
+ * The resources that were changed as part of this operation. Only present when fetched through
+ * the subscription changes API or if the `include_changed_resources` parameter was passed in
+ * the request.
+ */
+ class ChangedResources
+ private constructor(
+ private val createdCreditNotes: JsonField>,
+ private val createdInvoices: JsonField>,
+ private val voidedCreditNotes: JsonField>,
+ private val voidedInvoices: JsonField>,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("created_credit_notes")
+ @ExcludeMissing
+ createdCreditNotes: JsonField> = JsonMissing.of(),
+ @JsonProperty("created_invoices")
+ @ExcludeMissing
+ createdInvoices: JsonField> = JsonMissing.of(),
+ @JsonProperty("voided_credit_notes")
+ @ExcludeMissing
+ voidedCreditNotes: JsonField> = JsonMissing.of(),
+ @JsonProperty("voided_invoices")
+ @ExcludeMissing
+ voidedInvoices: JsonField> = JsonMissing.of(),
+ ) : this(
+ createdCreditNotes,
+ createdInvoices,
+ voidedCreditNotes,
+ voidedInvoices,
+ mutableMapOf(),
+ )
+
+ /**
+ * The credit notes that were created as part of this operation.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun createdCreditNotes(): List =
+ createdCreditNotes.getRequired("created_credit_notes")
+
+ /**
+ * The invoices that were created as part of this operation.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun createdInvoices(): List = createdInvoices.getRequired("created_invoices")
+
+ /**
+ * The credit notes that were voided as part of this operation.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun voidedCreditNotes(): List =
+ voidedCreditNotes.getRequired("voided_credit_notes")
+
+ /**
+ * The invoices that were voided as part of this operation.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun voidedInvoices(): List = voidedInvoices.getRequired("voided_invoices")
+
+ /**
+ * Returns the raw JSON value of [createdCreditNotes].
+ *
+ * Unlike [createdCreditNotes], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("created_credit_notes")
+ @ExcludeMissing
+ fun _createdCreditNotes(): JsonField> = createdCreditNotes
+
+ /**
+ * Returns the raw JSON value of [createdInvoices].
+ *
+ * Unlike [createdInvoices], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("created_invoices")
+ @ExcludeMissing
+ fun _createdInvoices(): JsonField> = createdInvoices
+
+ /**
+ * Returns the raw JSON value of [voidedCreditNotes].
+ *
+ * Unlike [voidedCreditNotes], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("voided_credit_notes")
+ @ExcludeMissing
+ fun _voidedCreditNotes(): JsonField> = voidedCreditNotes
+
+ /**
+ * Returns the raw JSON value of [voidedInvoices].
+ *
+ * Unlike [voidedInvoices], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("voided_invoices")
+ @ExcludeMissing
+ fun _voidedInvoices(): JsonField> = voidedInvoices
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [ChangedResources].
+ *
+ * The following fields are required:
+ * ```java
+ * .createdCreditNotes()
+ * .createdInvoices()
+ * .voidedCreditNotes()
+ * .voidedInvoices()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [ChangedResources]. */
+ class Builder internal constructor() {
+
+ private var createdCreditNotes: JsonField>? = null
+ private var createdInvoices: JsonField>? = null
+ private var voidedCreditNotes: JsonField>? = null
+ private var voidedInvoices: JsonField>? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(changedResources: ChangedResources) = apply {
+ createdCreditNotes = changedResources.createdCreditNotes.map { it.toMutableList() }
+ createdInvoices = changedResources.createdInvoices.map { it.toMutableList() }
+ voidedCreditNotes = changedResources.voidedCreditNotes.map { it.toMutableList() }
+ voidedInvoices = changedResources.voidedInvoices.map { it.toMutableList() }
+ additionalProperties = changedResources.additionalProperties.toMutableMap()
+ }
+
+ /** The credit notes that were created as part of this operation. */
+ fun createdCreditNotes(createdCreditNotes: List) =
+ createdCreditNotes(JsonField.of(createdCreditNotes))
+
+ /**
+ * Sets [Builder.createdCreditNotes] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.createdCreditNotes] with a well-typed
+ * `List` value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun createdCreditNotes(createdCreditNotes: JsonField>) = apply {
+ this.createdCreditNotes = createdCreditNotes.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [CreditNote] to [createdCreditNotes].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addCreatedCreditNote(createdCreditNote: CreditNote) = apply {
+ createdCreditNotes =
+ (createdCreditNotes ?: JsonField.of(mutableListOf())).also {
+ checkKnown("createdCreditNotes", it).add(createdCreditNote)
+ }
+ }
+
+ /** The invoices that were created as part of this operation. */
+ fun createdInvoices(createdInvoices: List) =
+ createdInvoices(JsonField.of(createdInvoices))
+
+ /**
+ * Sets [Builder.createdInvoices] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.createdInvoices] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun createdInvoices(createdInvoices: JsonField>) = apply {
+ this.createdInvoices = createdInvoices.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Invoice] to [createdInvoices].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addCreatedInvoice(createdInvoice: Invoice) = apply {
+ createdInvoices =
+ (createdInvoices ?: JsonField.of(mutableListOf())).also {
+ checkKnown("createdInvoices", it).add(createdInvoice)
+ }
+ }
+
+ /** The credit notes that were voided as part of this operation. */
+ fun voidedCreditNotes(voidedCreditNotes: List) =
+ voidedCreditNotes(JsonField.of(voidedCreditNotes))
+
+ /**
+ * Sets [Builder.voidedCreditNotes] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.voidedCreditNotes] with a well-typed
+ * `List` value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun voidedCreditNotes(voidedCreditNotes: JsonField>) = apply {
+ this.voidedCreditNotes = voidedCreditNotes.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [CreditNote] to [voidedCreditNotes].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addVoidedCreditNote(voidedCreditNote: CreditNote) = apply {
+ voidedCreditNotes =
+ (voidedCreditNotes ?: JsonField.of(mutableListOf())).also {
+ checkKnown("voidedCreditNotes", it).add(voidedCreditNote)
+ }
+ }
+
+ /** The invoices that were voided as part of this operation. */
+ fun voidedInvoices(voidedInvoices: List) =
+ voidedInvoices(JsonField.of(voidedInvoices))
+
+ /**
+ * Sets [Builder.voidedInvoices] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.voidedInvoices] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun voidedInvoices(voidedInvoices: JsonField>) = apply {
+ this.voidedInvoices = voidedInvoices.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Invoice] to [voidedInvoices].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addVoidedInvoice(voidedInvoice: Invoice) = apply {
+ voidedInvoices =
+ (voidedInvoices ?: JsonField.of(mutableListOf())).also {
+ checkKnown("voidedInvoices", it).add(voidedInvoice)
+ }
+ }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [ChangedResources].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .createdCreditNotes()
+ * .createdInvoices()
+ * .voidedCreditNotes()
+ * .voidedInvoices()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): ChangedResources =
+ ChangedResources(
+ checkRequired("createdCreditNotes", createdCreditNotes).map {
+ it.toImmutable()
+ },
+ checkRequired("createdInvoices", createdInvoices).map { it.toImmutable() },
+ checkRequired("voidedCreditNotes", voidedCreditNotes).map { it.toImmutable() },
+ checkRequired("voidedInvoices", voidedInvoices).map { it.toImmutable() },
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): ChangedResources = apply {
+ if (validated) {
+ return@apply
+ }
+
+ createdCreditNotes().forEach { it.validate() }
+ createdInvoices().forEach { it.validate() }
+ voidedCreditNotes().forEach { it.validate() }
+ voidedInvoices().forEach { it.validate() }
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OrbInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (createdCreditNotes.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (createdInvoices.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (voidedCreditNotes.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (voidedInvoices.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is ChangedResources && createdCreditNotes == other.createdCreditNotes && createdInvoices == other.createdInvoices && voidedCreditNotes == other.voidedCreditNotes && voidedInvoices == other.voidedInvoices && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(createdCreditNotes, createdInvoices, voidedCreditNotes, voidedInvoices, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "ChangedResources{createdCreditNotes=$createdCreditNotes, createdInvoices=$createdInvoices, voidedCreditNotes=$voidedCreditNotes, voidedInvoices=$voidedInvoices, additionalProperties=$additionalProperties}"
+ }
+
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
- return /* spotless:off */ other is SubscriptionCancelResponse && id == other.id && activePlanPhaseOrder == other.activePlanPhaseOrder && adjustmentIntervals == other.adjustmentIntervals && autoCollection == other.autoCollection && billingCycleAnchorConfiguration == other.billingCycleAnchorConfiguration && billingCycleDay == other.billingCycleDay && createdAt == other.createdAt && currentBillingPeriodEndDate == other.currentBillingPeriodEndDate && currentBillingPeriodStartDate == other.currentBillingPeriodStartDate && customer == other.customer && defaultInvoiceMemo == other.defaultInvoiceMemo && discountIntervals == other.discountIntervals && endDate == other.endDate && fixedFeeQuantitySchedule == other.fixedFeeQuantitySchedule && invoicingThreshold == other.invoicingThreshold && maximumIntervals == other.maximumIntervals && metadata == other.metadata && minimumIntervals == other.minimumIntervals && netTerms == other.netTerms && plan == other.plan && priceIntervals == other.priceIntervals && redeemedCoupon == other.redeemedCoupon && startDate == other.startDate && status == other.status && trialInfo == other.trialInfo && additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is SubscriptionCancelResponse && id == other.id && activePlanPhaseOrder == other.activePlanPhaseOrder && adjustmentIntervals == other.adjustmentIntervals && autoCollection == other.autoCollection && billingCycleAnchorConfiguration == other.billingCycleAnchorConfiguration && billingCycleDay == other.billingCycleDay && createdAt == other.createdAt && currentBillingPeriodEndDate == other.currentBillingPeriodEndDate && currentBillingPeriodStartDate == other.currentBillingPeriodStartDate && customer == other.customer && defaultInvoiceMemo == other.defaultInvoiceMemo && discountIntervals == other.discountIntervals && endDate == other.endDate && fixedFeeQuantitySchedule == other.fixedFeeQuantitySchedule && invoicingThreshold == other.invoicingThreshold && maximumIntervals == other.maximumIntervals && metadata == other.metadata && minimumIntervals == other.minimumIntervals && netTerms == other.netTerms && pendingSubscriptionChange == other.pendingSubscriptionChange && plan == other.plan && priceIntervals == other.priceIntervals && redeemedCoupon == other.redeemedCoupon && startDate == other.startDate && status == other.status && trialInfo == other.trialInfo && changedResources == other.changedResources && additionalProperties == other.additionalProperties /* spotless:on */
}
/* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(id, activePlanPhaseOrder, adjustmentIntervals, autoCollection, billingCycleAnchorConfiguration, billingCycleDay, createdAt, currentBillingPeriodEndDate, currentBillingPeriodStartDate, customer, defaultInvoiceMemo, discountIntervals, endDate, fixedFeeQuantitySchedule, invoicingThreshold, maximumIntervals, metadata, minimumIntervals, netTerms, plan, priceIntervals, redeemedCoupon, startDate, status, trialInfo, additionalProperties) }
+ private val hashCode: Int by lazy { Objects.hash(id, activePlanPhaseOrder, adjustmentIntervals, autoCollection, billingCycleAnchorConfiguration, billingCycleDay, createdAt, currentBillingPeriodEndDate, currentBillingPeriodStartDate, customer, defaultInvoiceMemo, discountIntervals, endDate, fixedFeeQuantitySchedule, invoicingThreshold, maximumIntervals, metadata, minimumIntervals, netTerms, pendingSubscriptionChange, plan, priceIntervals, redeemedCoupon, startDate, status, trialInfo, changedResources, additionalProperties) }
/* spotless:on */
override fun hashCode(): Int = hashCode
override fun toString() =
- "SubscriptionCancelResponse{id=$id, activePlanPhaseOrder=$activePlanPhaseOrder, adjustmentIntervals=$adjustmentIntervals, autoCollection=$autoCollection, billingCycleAnchorConfiguration=$billingCycleAnchorConfiguration, billingCycleDay=$billingCycleDay, createdAt=$createdAt, currentBillingPeriodEndDate=$currentBillingPeriodEndDate, currentBillingPeriodStartDate=$currentBillingPeriodStartDate, customer=$customer, defaultInvoiceMemo=$defaultInvoiceMemo, discountIntervals=$discountIntervals, endDate=$endDate, fixedFeeQuantitySchedule=$fixedFeeQuantitySchedule, invoicingThreshold=$invoicingThreshold, maximumIntervals=$maximumIntervals, metadata=$metadata, minimumIntervals=$minimumIntervals, netTerms=$netTerms, plan=$plan, priceIntervals=$priceIntervals, redeemedCoupon=$redeemedCoupon, startDate=$startDate, status=$status, trialInfo=$trialInfo, additionalProperties=$additionalProperties}"
+ "SubscriptionCancelResponse{id=$id, activePlanPhaseOrder=$activePlanPhaseOrder, adjustmentIntervals=$adjustmentIntervals, autoCollection=$autoCollection, billingCycleAnchorConfiguration=$billingCycleAnchorConfiguration, billingCycleDay=$billingCycleDay, createdAt=$createdAt, currentBillingPeriodEndDate=$currentBillingPeriodEndDate, currentBillingPeriodStartDate=$currentBillingPeriodStartDate, customer=$customer, defaultInvoiceMemo=$defaultInvoiceMemo, discountIntervals=$discountIntervals, endDate=$endDate, fixedFeeQuantitySchedule=$fixedFeeQuantitySchedule, invoicingThreshold=$invoicingThreshold, maximumIntervals=$maximumIntervals, metadata=$metadata, minimumIntervals=$minimumIntervals, netTerms=$netTerms, pendingSubscriptionChange=$pendingSubscriptionChange, plan=$plan, priceIntervals=$priceIntervals, redeemedCoupon=$redeemedCoupon, startDate=$startDate, status=$status, trialInfo=$trialInfo, changedResources=$changedResources, additionalProperties=$additionalProperties}"
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionChangeApplyParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionChangeApplyParams.kt
new file mode 100644
index 00000000..986120fa
--- /dev/null
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionChangeApplyParams.kt
@@ -0,0 +1,522 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.withorb.api.models
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.withorb.api.core.ExcludeMissing
+import com.withorb.api.core.JsonField
+import com.withorb.api.core.JsonMissing
+import com.withorb.api.core.JsonValue
+import com.withorb.api.core.Params
+import com.withorb.api.core.checkRequired
+import com.withorb.api.core.http.Headers
+import com.withorb.api.core.http.QueryParams
+import com.withorb.api.errors.OrbInvalidDataException
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/**
+ * Apply a subscription change to perform the intended action. If a positive amount is passed with a
+ * request to this endpoint, any eligible invoices that were created will be issued immediately if
+ * they only contain in-advance fees.
+ */
+class SubscriptionChangeApplyParams
+private constructor(
+ private val subscriptionChangeId: String,
+ private val body: Body,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ fun subscriptionChangeId(): String = subscriptionChangeId
+
+ /**
+ * Description to apply to the balance transaction representing this credit.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
+ * responded with an unexpected value).
+ */
+ fun description(): Optional = body.description()
+
+ /**
+ * Amount already collected to apply to the customer's balance.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
+ * responded with an unexpected value).
+ */
+ fun previouslyCollectedAmount(): Optional = body.previouslyCollectedAmount()
+
+ /**
+ * Returns the raw JSON value of [description].
+ *
+ * Unlike [description], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _description(): JsonField = body._description()
+
+ /**
+ * Returns the raw JSON value of [previouslyCollectedAmount].
+ *
+ * Unlike [previouslyCollectedAmount], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ fun _previouslyCollectedAmount(): JsonField = body._previouslyCollectedAmount()
+
+ fun _additionalBodyProperties(): Map = body._additionalProperties()
+
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [SubscriptionChangeApplyParams].
+ *
+ * The following fields are required:
+ * ```java
+ * .subscriptionChangeId()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [SubscriptionChangeApplyParams]. */
+ class Builder internal constructor() {
+
+ private var subscriptionChangeId: String? = null
+ private var body: Body.Builder = Body.builder()
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(subscriptionChangeApplyParams: SubscriptionChangeApplyParams) = apply {
+ subscriptionChangeId = subscriptionChangeApplyParams.subscriptionChangeId
+ body = subscriptionChangeApplyParams.body.toBuilder()
+ additionalHeaders = subscriptionChangeApplyParams.additionalHeaders.toBuilder()
+ additionalQueryParams = subscriptionChangeApplyParams.additionalQueryParams.toBuilder()
+ }
+
+ fun subscriptionChangeId(subscriptionChangeId: String) = apply {
+ this.subscriptionChangeId = subscriptionChangeId
+ }
+
+ /**
+ * Sets the entire request body.
+ *
+ * This is generally only useful if you are already constructing the body separately.
+ * Otherwise, it's more convenient to use the top-level setters instead:
+ * - [description]
+ * - [previouslyCollectedAmount]
+ */
+ fun body(body: Body) = apply { this.body = body.toBuilder() }
+
+ /** Description to apply to the balance transaction representing this credit. */
+ fun description(description: String?) = apply { body.description(description) }
+
+ /** Alias for calling [Builder.description] with `description.orElse(null)`. */
+ fun description(description: Optional) = description(description.getOrNull())
+
+ /**
+ * Sets [Builder.description] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.description] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun description(description: JsonField) = apply { body.description(description) }
+
+ /** Amount already collected to apply to the customer's balance. */
+ fun previouslyCollectedAmount(previouslyCollectedAmount: String?) = apply {
+ body.previouslyCollectedAmount(previouslyCollectedAmount)
+ }
+
+ /**
+ * Alias for calling [Builder.previouslyCollectedAmount] with
+ * `previouslyCollectedAmount.orElse(null)`.
+ */
+ fun previouslyCollectedAmount(previouslyCollectedAmount: Optional) =
+ previouslyCollectedAmount(previouslyCollectedAmount.getOrNull())
+
+ /**
+ * Sets [Builder.previouslyCollectedAmount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.previouslyCollectedAmount] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun previouslyCollectedAmount(previouslyCollectedAmount: JsonField) = apply {
+ body.previouslyCollectedAmount(previouslyCollectedAmount)
+ }
+
+ fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
+ body.additionalProperties(additionalBodyProperties)
+ }
+
+ fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
+ body.putAdditionalProperty(key, value)
+ }
+
+ fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
+ apply {
+ body.putAllAdditionalProperties(additionalBodyProperties)
+ }
+
+ fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) }
+
+ fun removeAllAdditionalBodyProperties(keys: Set) = apply {
+ body.removeAllAdditionalProperties(keys)
+ }
+
+ fun additionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun additionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun putAdditionalHeader(name: String, value: String) = apply {
+ additionalHeaders.put(name, value)
+ }
+
+ fun putAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.put(name, values)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun replaceAdditionalHeaders(name: String, value: String) = apply {
+ additionalHeaders.replace(name, value)
+ }
+
+ fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.replace(name, values)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
+
+ fun removeAllAdditionalHeaders(names: Set) = apply {
+ additionalHeaders.removeAll(names)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: Map>) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun putAdditionalQueryParam(key: String, value: String) = apply {
+ additionalQueryParams.put(key, value)
+ }
+
+ fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.put(key, values)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, value: String) = apply {
+ additionalQueryParams.replace(key, value)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.replace(key, values)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
+
+ fun removeAllAdditionalQueryParams(keys: Set) = apply {
+ additionalQueryParams.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [SubscriptionChangeApplyParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .subscriptionChangeId()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): SubscriptionChangeApplyParams =
+ SubscriptionChangeApplyParams(
+ checkRequired("subscriptionChangeId", subscriptionChangeId),
+ body.build(),
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ fun _body(): Body = body
+
+ fun _pathParam(index: Int): String =
+ when (index) {
+ 0 -> subscriptionChangeId
+ else -> ""
+ }
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams = additionalQueryParams
+
+ class Body
+ private constructor(
+ private val description: JsonField,
+ private val previouslyCollectedAmount: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("description")
+ @ExcludeMissing
+ description: JsonField = JsonMissing.of(),
+ @JsonProperty("previously_collected_amount")
+ @ExcludeMissing
+ previouslyCollectedAmount: JsonField = JsonMissing.of(),
+ ) : this(description, previouslyCollectedAmount, mutableMapOf())
+
+ /**
+ * Description to apply to the balance transaction representing this credit.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun description(): Optional = description.getOptional("description")
+
+ /**
+ * Amount already collected to apply to the customer's balance.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun previouslyCollectedAmount(): Optional =
+ previouslyCollectedAmount.getOptional("previously_collected_amount")
+
+ /**
+ * Returns the raw JSON value of [description].
+ *
+ * Unlike [description], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("description")
+ @ExcludeMissing
+ fun _description(): JsonField = description
+
+ /**
+ * Returns the raw JSON value of [previouslyCollectedAmount].
+ *
+ * Unlike [previouslyCollectedAmount], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("previously_collected_amount")
+ @ExcludeMissing
+ fun _previouslyCollectedAmount(): JsonField = previouslyCollectedAmount
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /** Returns a mutable builder for constructing an instance of [Body]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Body]. */
+ class Builder internal constructor() {
+
+ private var description: JsonField = JsonMissing.of()
+ private var previouslyCollectedAmount: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(body: Body) = apply {
+ description = body.description
+ previouslyCollectedAmount = body.previouslyCollectedAmount
+ additionalProperties = body.additionalProperties.toMutableMap()
+ }
+
+ /** Description to apply to the balance transaction representing this credit. */
+ fun description(description: String?) = description(JsonField.ofNullable(description))
+
+ /** Alias for calling [Builder.description] with `description.orElse(null)`. */
+ fun description(description: Optional) = description(description.getOrNull())
+
+ /**
+ * Sets [Builder.description] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.description] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun description(description: JsonField) = apply {
+ this.description = description
+ }
+
+ /** Amount already collected to apply to the customer's balance. */
+ fun previouslyCollectedAmount(previouslyCollectedAmount: String?) =
+ previouslyCollectedAmount(JsonField.ofNullable(previouslyCollectedAmount))
+
+ /**
+ * Alias for calling [Builder.previouslyCollectedAmount] with
+ * `previouslyCollectedAmount.orElse(null)`.
+ */
+ fun previouslyCollectedAmount(previouslyCollectedAmount: Optional) =
+ previouslyCollectedAmount(previouslyCollectedAmount.getOrNull())
+
+ /**
+ * Sets [Builder.previouslyCollectedAmount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.previouslyCollectedAmount] with a well-typed
+ * [String] value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun previouslyCollectedAmount(previouslyCollectedAmount: JsonField) = apply {
+ this.previouslyCollectedAmount = previouslyCollectedAmount
+ }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [Body].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Body =
+ Body(description, previouslyCollectedAmount, additionalProperties.toMutableMap())
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Body = apply {
+ if (validated) {
+ return@apply
+ }
+
+ description()
+ previouslyCollectedAmount()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OrbInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (description.asKnown().isPresent) 1 else 0) +
+ (if (previouslyCollectedAmount.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is Body && description == other.description && previouslyCollectedAmount == other.previouslyCollectedAmount && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(description, previouslyCollectedAmount, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Body{description=$description, previouslyCollectedAmount=$previouslyCollectedAmount, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is SubscriptionChangeApplyParams && subscriptionChangeId == other.subscriptionChangeId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ }
+
+ override fun hashCode(): Int = /* spotless:off */ Objects.hash(subscriptionChangeId, body, additionalHeaders, additionalQueryParams) /* spotless:on */
+
+ override fun toString() =
+ "SubscriptionChangeApplyParams{subscriptionChangeId=$subscriptionChangeId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionChangeApplyResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionChangeApplyResponse.kt
new file mode 100644
index 00000000..4943568e
--- /dev/null
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionChangeApplyResponse.kt
@@ -0,0 +1,11498 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.withorb.api.models
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.fasterxml.jackson.core.JsonGenerator
+import com.fasterxml.jackson.core.ObjectCodec
+import com.fasterxml.jackson.databind.JsonNode
+import com.fasterxml.jackson.databind.SerializerProvider
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize
+import com.fasterxml.jackson.databind.annotation.JsonSerialize
+import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
+import com.withorb.api.core.BaseDeserializer
+import com.withorb.api.core.BaseSerializer
+import com.withorb.api.core.Enum
+import com.withorb.api.core.ExcludeMissing
+import com.withorb.api.core.JsonField
+import com.withorb.api.core.JsonMissing
+import com.withorb.api.core.JsonValue
+import com.withorb.api.core.checkKnown
+import com.withorb.api.core.checkRequired
+import com.withorb.api.core.getOrThrow
+import com.withorb.api.core.toImmutable
+import com.withorb.api.errors.OrbInvalidDataException
+import java.time.OffsetDateTime
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/**
+ * A subscription change represents a desired new subscription / pending change to an existing
+ * subscription. It is a way to first preview the effects on the subscription as well as any
+ * changes/creation of invoices (see `subscription.changed_resources`).
+ */
+class SubscriptionChangeApplyResponse
+private constructor(
+ private val id: JsonField,
+ private val expirationTime: JsonField,
+ private val status: JsonField,
+ private val subscription: JsonField,
+ private val appliedAt: JsonField,
+ private val cancelledAt: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
+ @JsonProperty("expiration_time")
+ @ExcludeMissing
+ expirationTime: JsonField = JsonMissing.of(),
+ @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
+ @JsonProperty("subscription")
+ @ExcludeMissing
+ subscription: JsonField = JsonMissing.of(),
+ @JsonProperty("applied_at")
+ @ExcludeMissing
+ appliedAt: JsonField = JsonMissing.of(),
+ @JsonProperty("cancelled_at")
+ @ExcludeMissing
+ cancelledAt: JsonField = JsonMissing.of(),
+ ) : this(id, expirationTime, status, subscription, appliedAt, cancelledAt, mutableMapOf())
+
+ /**
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly
+ * missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun id(): String = id.getRequired("id")
+
+ /**
+ * Subscription change will be cancelled at this time and can no longer be applied.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly
+ * missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun expirationTime(): OffsetDateTime = expirationTime.getRequired("expiration_time")
+
+ /**
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly
+ * missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun status(): Status = status.getRequired("status")
+
+ /**
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
+ * responded with an unexpected value).
+ */
+ fun subscription(): Optional = subscription.getOptional("subscription")
+
+ /**
+ * When this change was applied.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
+ * responded with an unexpected value).
+ */
+ fun appliedAt(): Optional = appliedAt.getOptional("applied_at")
+
+ /**
+ * When this change was cancelled.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
+ * responded with an unexpected value).
+ */
+ fun cancelledAt(): Optional = cancelledAt.getOptional("cancelled_at")
+
+ /**
+ * Returns the raw JSON value of [id].
+ *
+ * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
+
+ /**
+ * Returns the raw JSON value of [expirationTime].
+ *
+ * Unlike [expirationTime], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("expiration_time")
+ @ExcludeMissing
+ fun _expirationTime(): JsonField = expirationTime
+
+ /**
+ * Returns the raw JSON value of [status].
+ *
+ * Unlike [status], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
+
+ /**
+ * Returns the raw JSON value of [subscription].
+ *
+ * Unlike [subscription], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("subscription")
+ @ExcludeMissing
+ fun _subscription(): JsonField = subscription
+
+ /**
+ * Returns the raw JSON value of [appliedAt].
+ *
+ * Unlike [appliedAt], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("applied_at")
+ @ExcludeMissing
+ fun _appliedAt(): JsonField = appliedAt
+
+ /**
+ * Returns the raw JSON value of [cancelledAt].
+ *
+ * Unlike [cancelledAt], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("cancelled_at")
+ @ExcludeMissing
+ fun _cancelledAt(): JsonField = cancelledAt
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [SubscriptionChangeApplyResponse].
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * .expirationTime()
+ * .status()
+ * .subscription()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [SubscriptionChangeApplyResponse]. */
+ class Builder internal constructor() {
+
+ private var id: JsonField? = null
+ private var expirationTime: JsonField? = null
+ private var status: JsonField? = null
+ private var subscription: JsonField? = null
+ private var appliedAt: JsonField = JsonMissing.of()
+ private var cancelledAt: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(subscriptionChangeApplyResponse: SubscriptionChangeApplyResponse) =
+ apply {
+ id = subscriptionChangeApplyResponse.id
+ expirationTime = subscriptionChangeApplyResponse.expirationTime
+ status = subscriptionChangeApplyResponse.status
+ subscription = subscriptionChangeApplyResponse.subscription
+ appliedAt = subscriptionChangeApplyResponse.appliedAt
+ cancelledAt = subscriptionChangeApplyResponse.cancelledAt
+ additionalProperties =
+ subscriptionChangeApplyResponse.additionalProperties.toMutableMap()
+ }
+
+ fun id(id: String) = id(JsonField.of(id))
+
+ /**
+ * Sets [Builder.id] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.id] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun id(id: JsonField) = apply { this.id = id }
+
+ /** Subscription change will be cancelled at this time and can no longer be applied. */
+ fun expirationTime(expirationTime: OffsetDateTime) =
+ expirationTime(JsonField.of(expirationTime))
+
+ /**
+ * Sets [Builder.expirationTime] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.expirationTime] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun expirationTime(expirationTime: JsonField) = apply {
+ this.expirationTime = expirationTime
+ }
+
+ fun status(status: Status) = status(JsonField.of(status))
+
+ /**
+ * Sets [Builder.status] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.status] with a well-typed [Status] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun status(status: JsonField) = apply { this.status = status }
+
+ fun subscription(subscription: Subscription?) =
+ subscription(JsonField.ofNullable(subscription))
+
+ /** Alias for calling [Builder.subscription] with `subscription.orElse(null)`. */
+ fun subscription(subscription: Optional) =
+ subscription(subscription.getOrNull())
+
+ /**
+ * Sets [Builder.subscription] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.subscription] with a well-typed [Subscription] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun subscription(subscription: JsonField) = apply {
+ this.subscription = subscription
+ }
+
+ /** When this change was applied. */
+ fun appliedAt(appliedAt: OffsetDateTime?) = appliedAt(JsonField.ofNullable(appliedAt))
+
+ /** Alias for calling [Builder.appliedAt] with `appliedAt.orElse(null)`. */
+ fun appliedAt(appliedAt: Optional) = appliedAt(appliedAt.getOrNull())
+
+ /**
+ * Sets [Builder.appliedAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.appliedAt] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun appliedAt(appliedAt: JsonField) = apply { this.appliedAt = appliedAt }
+
+ /** When this change was cancelled. */
+ fun cancelledAt(cancelledAt: OffsetDateTime?) =
+ cancelledAt(JsonField.ofNullable(cancelledAt))
+
+ /** Alias for calling [Builder.cancelledAt] with `cancelledAt.orElse(null)`. */
+ fun cancelledAt(cancelledAt: Optional) =
+ cancelledAt(cancelledAt.getOrNull())
+
+ /**
+ * Sets [Builder.cancelledAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.cancelledAt] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun cancelledAt(cancelledAt: JsonField) = apply {
+ this.cancelledAt = cancelledAt
+ }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [SubscriptionChangeApplyResponse].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * .expirationTime()
+ * .status()
+ * .subscription()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): SubscriptionChangeApplyResponse =
+ SubscriptionChangeApplyResponse(
+ checkRequired("id", id),
+ checkRequired("expirationTime", expirationTime),
+ checkRequired("status", status),
+ checkRequired("subscription", subscription),
+ appliedAt,
+ cancelledAt,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): SubscriptionChangeApplyResponse = apply {
+ if (validated) {
+ return@apply
+ }
+
+ id()
+ expirationTime()
+ status().validate()
+ subscription().ifPresent { it.validate() }
+ appliedAt()
+ cancelledAt()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OrbInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (id.asKnown().isPresent) 1 else 0) +
+ (if (expirationTime.asKnown().isPresent) 1 else 0) +
+ (status.asKnown().getOrNull()?.validity() ?: 0) +
+ (subscription.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (appliedAt.asKnown().isPresent) 1 else 0) +
+ (if (cancelledAt.asKnown().isPresent) 1 else 0)
+
+ class Status @JsonCreator private constructor(private val value: JsonField) : Enum {
+
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that doesn't
+ * match any known member, and you want to know that value. For example, if the SDK is on an
+ * older version than the API, then the API may respond with new members that the SDK is
+ * unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val PENDING = of("pending")
+
+ @JvmField val APPLIED = of("applied")
+
+ @JvmField val CANCELLED = of("cancelled")
+
+ @JvmStatic fun of(value: String) = Status(JsonField.of(value))
+ }
+
+ /** An enum containing [Status]'s known values. */
+ enum class Known {
+ PENDING,
+ APPLIED,
+ CANCELLED,
+ }
+
+ /**
+ * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Status] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example, if the
+ * SDK is on an older version than the API, then the API may respond with new members that
+ * the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ PENDING,
+ APPLIED,
+ CANCELLED,
+ /** An enum member indicating that [Status] was instantiated with an unknown value. */
+ _UNKNOWN,
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
+ * if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if you want
+ * to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ PENDING -> Value.PENDING
+ APPLIED -> Value.APPLIED
+ CANCELLED -> Value.CANCELLED
+ else -> Value._UNKNOWN
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and don't
+ * want to throw for the unknown case.
+ *
+ * @throws OrbInvalidDataException if this class instance's value is a not a known member.
+ */
+ fun known(): Known =
+ when (this) {
+ PENDING -> Known.PENDING
+ APPLIED -> Known.APPLIED
+ CANCELLED -> Known.CANCELLED
+ else -> throw OrbInvalidDataException("Unknown Status: $value")
+ }
+
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily for debugging
+ * and generally doesn't throw.
+ *
+ * @throws OrbInvalidDataException if this class instance's value does not have the expected
+ * primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow { OrbInvalidDataException("Value is not a String") }
+
+ private var validated: Boolean = false
+
+ fun validate(): Status = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OrbInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is Status && value == other.value /* spotless:on */
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ class Subscription
+ private constructor(
+ private val id: JsonField,
+ private val activePlanPhaseOrder: JsonField,
+ private val adjustmentIntervals: JsonField>,
+ private val autoCollection: JsonField,
+ private val billingCycleAnchorConfiguration: JsonField,
+ private val billingCycleDay: JsonField,
+ private val createdAt: JsonField,
+ private val currentBillingPeriodEndDate: JsonField,
+ private val currentBillingPeriodStartDate: JsonField,
+ private val customer: JsonField,
+ private val defaultInvoiceMemo: JsonField,
+ private val discountIntervals: JsonField>,
+ private val endDate: JsonField,
+ private val fixedFeeQuantitySchedule: JsonField>,
+ private val invoicingThreshold: JsonField,
+ private val maximumIntervals: JsonField>,
+ private val metadata: JsonField,
+ private val minimumIntervals: JsonField>,
+ private val netTerms: JsonField,
+ private val pendingSubscriptionChange: JsonField,
+ private val plan: JsonField,
+ private val priceIntervals: JsonField>,
+ private val redeemedCoupon: JsonField,
+ private val startDate: JsonField,
+ private val status: JsonField,
+ private val trialInfo: JsonField,
+ private val changedResources: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
+ @JsonProperty("active_plan_phase_order")
+ @ExcludeMissing
+ activePlanPhaseOrder: JsonField = JsonMissing.of(),
+ @JsonProperty("adjustment_intervals")
+ @ExcludeMissing
+ adjustmentIntervals: JsonField> = JsonMissing.of(),
+ @JsonProperty("auto_collection")
+ @ExcludeMissing
+ autoCollection: JsonField = JsonMissing.of(),
+ @JsonProperty("billing_cycle_anchor_configuration")
+ @ExcludeMissing
+ billingCycleAnchorConfiguration: JsonField