diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index fed4b17f..97976d55 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.52.0"
+ ".": "0.52.1"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 2262920e..037b2232 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-36a6db97756e8658369c9af3c0ac532ecacb032e5b8f6211094dcb4052943ff3.yml
-openapi_spec_hash: 26886fa8e59fa3674320897e3409e540
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-95a3d7780935a38e0cf076d4ad2d68bd1a5641bced8398d972db2e92751d364a.yml
+openapi_spec_hash: 9ebe818c4ad4f2d9c4e473b5192d7544
config_hash: ec4f1e02d3528e3a93a73e33bca17c2a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8b64a4d3..a4720984 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,18 @@
# Changelog
+## 0.52.1 (2025-03-31)
+
+Full Changelog: [v0.52.0...v0.52.1](https://github.com/orbcorp/orb-java/compare/v0.52.0...v0.52.1)
+
+### Bug Fixes
+
+* **client:** limit json deserialization coercion ([#373](https://github.com/orbcorp/orb-java/issues/373)) ([654e81c](https://github.com/orbcorp/orb-java/commit/654e81cf520631050936ae5cf9397c0e4a9cf02b))
+
+
+### Chores
+
+* **internal:** codegen related update ([#371](https://github.com/orbcorp/orb-java/issues/371)) ([28dbf0a](https://github.com/orbcorp/orb-java/commit/28dbf0a107b892656275633f3805eb2d3c7f93fa))
+
## 0.52.0 (2025-03-26)
Full Changelog: [v0.51.0...v0.52.0](https://github.com/orbcorp/orb-java/compare/v0.51.0...v0.52.0)
diff --git a/README.md b/README.md
index 69c6aa50..ba9c139a 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.52.0)
+[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.52.1)
@@ -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.52.0")
+implementation("com.withorb.api:orb-java:0.52.1")
```
### Maven
@@ -28,7 +28,7 @@ implementation("com.withorb.api:orb-java:0.52.0")
com.withorb.api
orb-java
- 0.52.0
+ 0.52.1
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 3434d43f..3a242454 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,4 +1,4 @@
allprojects {
group = "com.withorb.api"
- version = "0.52.0" // x-release-please-version
+ version = "0.52.1" // x-release-please-version
}
diff --git a/orb-java-core/build.gradle.kts b/orb-java-core/build.gradle.kts
index a0bbeafb..8a8d05d5 100644
--- a/orb-java-core/build.gradle.kts
+++ b/orb-java-core/build.gradle.kts
@@ -34,6 +34,7 @@ dependencies {
testImplementation("org.assertj:assertj-core:3.25.3")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.3")
+ testImplementation("org.junit-pioneer:junit-pioneer:1.9.1")
testImplementation("org.mockito:mockito-core:5.14.2")
testImplementation("org.mockito:mockito-junit-jupiter:5.14.2")
testImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0")
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/BaseDeserializer.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/BaseDeserializer.kt
index 4fc63b4d..2a73d238 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/core/BaseDeserializer.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/BaseDeserializer.kt
@@ -11,6 +11,7 @@ import com.fasterxml.jackson.databind.JsonMappingException
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.deser.ContextualDeserializer
import com.fasterxml.jackson.databind.deser.std.StdDeserializer
+import com.withorb.api.errors.OrbInvalidDataException
import kotlin.reflect.KClass
abstract class BaseDeserializer(type: KClass) :
@@ -29,6 +30,13 @@ abstract class BaseDeserializer(type: KClass) :
protected abstract fun ObjectCodec.deserialize(node: JsonNode): T
+ protected fun ObjectCodec.deserialize(node: JsonNode, type: TypeReference): T =
+ try {
+ readValue(treeAsTokens(node), type)
+ } catch (e: Exception) {
+ throw OrbInvalidDataException("Error deserializing", e)
+ }
+
protected fun ObjectCodec.tryDeserialize(
node: JsonNode,
type: TypeReference,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/ObjectMappers.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/ObjectMappers.kt
index 26311c69..8710064b 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/core/ObjectMappers.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/ObjectMappers.kt
@@ -8,8 +8,11 @@ import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.MapperFeature
import com.fasterxml.jackson.databind.SerializationFeature
import com.fasterxml.jackson.databind.SerializerProvider
+import com.fasterxml.jackson.databind.cfg.CoercionAction
+import com.fasterxml.jackson.databind.cfg.CoercionInputShape
import com.fasterxml.jackson.databind.json.JsonMapper
import com.fasterxml.jackson.databind.module.SimpleModule
+import com.fasterxml.jackson.databind.type.LogicalType
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
import com.fasterxml.jackson.module.kotlin.kotlinModule
@@ -21,6 +24,60 @@ fun jsonMapper(): JsonMapper =
.addModule(Jdk8Module())
.addModule(JavaTimeModule())
.addModule(SimpleModule().addSerializer(InputStreamJsonSerializer))
+ .withCoercionConfig(LogicalType.Boolean) {
+ it.setCoercion(CoercionInputShape.Integer, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Float, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.String, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Array, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Object, CoercionAction.Fail)
+ }
+ .withCoercionConfig(LogicalType.Integer) {
+ it.setCoercion(CoercionInputShape.Boolean, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.String, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Array, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Object, CoercionAction.Fail)
+ }
+ .withCoercionConfig(LogicalType.Float) {
+ it.setCoercion(CoercionInputShape.Boolean, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.String, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Array, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Object, CoercionAction.Fail)
+ }
+ .withCoercionConfig(LogicalType.Textual) {
+ it.setCoercion(CoercionInputShape.Boolean, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Integer, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Float, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Array, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Object, CoercionAction.Fail)
+ }
+ .withCoercionConfig(LogicalType.Array) {
+ it.setCoercion(CoercionInputShape.Boolean, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Integer, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Float, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.String, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Object, CoercionAction.Fail)
+ }
+ .withCoercionConfig(LogicalType.Collection) {
+ it.setCoercion(CoercionInputShape.Boolean, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Integer, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Float, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.String, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Object, CoercionAction.Fail)
+ }
+ .withCoercionConfig(LogicalType.Map) {
+ it.setCoercion(CoercionInputShape.Boolean, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Integer, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Float, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.String, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Object, CoercionAction.Fail)
+ }
+ .withCoercionConfig(LogicalType.POJO) {
+ it.setCoercion(CoercionInputShape.Boolean, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Integer, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Float, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.String, CoercionAction.Fail)
+ .setCoercion(CoercionInputShape.Array, CoercionAction.Fail)
+ }
.serializationInclusion(JsonInclude.Include.NON_ABSENT)
.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)
.disable(SerializationFeature.FLUSH_AFTER_WRITE_VALUE)
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Coupon.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Coupon.kt
index a93fa471..a2c4dac0 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Coupon.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Coupon.kt
@@ -563,16 +563,16 @@ private constructor(
when (discountType) {
"percentage" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Discount(percentage = it, _json = json)
- }
+ return Discount(
+ percentage = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"amount" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Discount(amount = it, _json = json)
- }
+ return Discount(
+ amount = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponCreateParams.kt
index 984ef4f4..19d1b3b2 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponCreateParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponCreateParams.kt
@@ -875,20 +875,18 @@ private constructor(
when (discountType) {
"percentage" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Discount(newCouponPercentage = it, _json = json)
- }
+ return Discount(
+ newCouponPercentage =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"amount" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Discount(newCouponAmount = it, _json = json)
- }
+ return Discount(
+ newCouponAmount =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
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 695b6d9b..794d1fb7 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
@@ -4016,20 +4016,17 @@ private constructor(
when (taxProvider) {
"avalara" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return TaxConfiguration(newAvalara = it, _json = json)
- }
+ return TaxConfiguration(
+ newAvalara =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"taxjar" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return TaxConfiguration(newTaxJar = it, _json = json)
- }
+ return TaxConfiguration(
+ newTaxJar = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdParams.kt
index da41ea92..16b0054d 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdParams.kt
@@ -724,74 +724,56 @@ private constructor(
when (entryType) {
"increment" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Body(
- addIncrementCreditLedgerEntryRequestParams = it,
- _json = json,
- )
- }
+ return Body(
+ addIncrementCreditLedgerEntryRequestParams =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"decrement" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Body(
- addDecrementCreditLedgerEntryRequestParams = it,
- _json = json,
- )
- }
+ return Body(
+ addDecrementCreditLedgerEntryRequestParams =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"expiration_change" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Body(
- addExpirationChangeCreditLedgerEntryRequestParams = it,
- _json = json,
- )
- }
+ return Body(
+ addExpirationChangeCreditLedgerEntryRequestParams =
+ deserialize(
+ node,
+ jacksonTypeRef<
+ AddExpirationChangeCreditLedgerEntryRequestParams
+ >(),
+ ),
+ _json = json,
+ )
}
"void" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Body(
- addVoidCreditLedgerEntryRequestParams = it,
- _json = json,
- )
- }
+ return Body(
+ addVoidCreditLedgerEntryRequestParams =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"amendment" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Body(
- addAmendmentCreditLedgerEntryRequestParams = it,
- _json = json,
- )
- }
+ return Body(
+ addAmendmentCreditLedgerEntryRequestParams =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdResponse.kt
index 07466b18..d724db6f 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdResponse.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdResponse.kt
@@ -302,73 +302,52 @@ private constructor(
when (entryType) {
"increment" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerCreateEntryByExternalIdResponse(
- incrementLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerCreateEntryByExternalIdResponse(
+ incrementLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"decrement" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerCreateEntryByExternalIdResponse(
- decrementLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerCreateEntryByExternalIdResponse(
+ decrementLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"expiration_change" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return CustomerCreditLedgerCreateEntryByExternalIdResponse(
- expirationChangeLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerCreateEntryByExternalIdResponse(
+ expirationChangeLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"credit_block_expiry" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return CustomerCreditLedgerCreateEntryByExternalIdResponse(
- creditBlockExpiryLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerCreateEntryByExternalIdResponse(
+ creditBlockExpiryLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"void" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerCreateEntryByExternalIdResponse(
- voidLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerCreateEntryByExternalIdResponse(
+ voidLedgerEntry = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"void_initiated" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return CustomerCreditLedgerCreateEntryByExternalIdResponse(
- voidInitiatedLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerCreateEntryByExternalIdResponse(
+ voidInitiatedLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"amendment" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerCreateEntryByExternalIdResponse(
- amendmentLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerCreateEntryByExternalIdResponse(
+ amendmentLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryParams.kt
index 4e7639db..9f9f60b6 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryParams.kt
@@ -719,74 +719,56 @@ private constructor(
when (entryType) {
"increment" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Body(
- addIncrementCreditLedgerEntryRequestParams = it,
- _json = json,
- )
- }
+ return Body(
+ addIncrementCreditLedgerEntryRequestParams =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"decrement" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Body(
- addDecrementCreditLedgerEntryRequestParams = it,
- _json = json,
- )
- }
+ return Body(
+ addDecrementCreditLedgerEntryRequestParams =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"expiration_change" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Body(
- addExpirationChangeCreditLedgerEntryRequestParams = it,
- _json = json,
- )
- }
+ return Body(
+ addExpirationChangeCreditLedgerEntryRequestParams =
+ deserialize(
+ node,
+ jacksonTypeRef<
+ AddExpirationChangeCreditLedgerEntryRequestParams
+ >(),
+ ),
+ _json = json,
+ )
}
"void" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Body(
- addVoidCreditLedgerEntryRequestParams = it,
- _json = json,
- )
- }
+ return Body(
+ addVoidCreditLedgerEntryRequestParams =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"amendment" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Body(
- addAmendmentCreditLedgerEntryRequestParams = it,
- _json = json,
- )
- }
+ return Body(
+ addAmendmentCreditLedgerEntryRequestParams =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryResponse.kt
index 3f3a60da..cb660d53 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryResponse.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryResponse.kt
@@ -291,73 +291,52 @@ private constructor(
when (entryType) {
"increment" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerCreateEntryResponse(
- incrementLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerCreateEntryResponse(
+ incrementLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"decrement" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerCreateEntryResponse(
- decrementLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerCreateEntryResponse(
+ decrementLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"expiration_change" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return CustomerCreditLedgerCreateEntryResponse(
- expirationChangeLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerCreateEntryResponse(
+ expirationChangeLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"credit_block_expiry" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return CustomerCreditLedgerCreateEntryResponse(
- creditBlockExpiryLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerCreateEntryResponse(
+ creditBlockExpiryLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"void" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerCreateEntryResponse(
- voidLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerCreateEntryResponse(
+ voidLedgerEntry = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"void_initiated" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return CustomerCreditLedgerCreateEntryResponse(
- voidInitiatedLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerCreateEntryResponse(
+ voidInitiatedLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"amendment" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerCreateEntryResponse(
- amendmentLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerCreateEntryResponse(
+ amendmentLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdResponse.kt
index 3d4acc56..b30e0a89 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdResponse.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdResponse.kt
@@ -300,73 +300,52 @@ private constructor(
when (entryType) {
"increment" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerListByExternalIdResponse(
- incrementLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerListByExternalIdResponse(
+ incrementLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"decrement" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerListByExternalIdResponse(
- decrementLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerListByExternalIdResponse(
+ decrementLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"expiration_change" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return CustomerCreditLedgerListByExternalIdResponse(
- expirationChangeLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerListByExternalIdResponse(
+ expirationChangeLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"credit_block_expiry" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return CustomerCreditLedgerListByExternalIdResponse(
- creditBlockExpiryLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerListByExternalIdResponse(
+ creditBlockExpiryLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"void" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerListByExternalIdResponse(
- voidLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerListByExternalIdResponse(
+ voidLedgerEntry = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"void_initiated" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return CustomerCreditLedgerListByExternalIdResponse(
- voidInitiatedLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerListByExternalIdResponse(
+ voidInitiatedLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"amendment" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerListByExternalIdResponse(
- amendmentLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerListByExternalIdResponse(
+ amendmentLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListResponse.kt
index beb252ff..81c15399 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListResponse.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListResponse.kt
@@ -286,73 +286,52 @@ private constructor(
when (entryType) {
"increment" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerListResponse(
- incrementLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerListResponse(
+ incrementLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"decrement" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerListResponse(
- decrementLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerListResponse(
+ decrementLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"expiration_change" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return CustomerCreditLedgerListResponse(
- expirationChangeLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerListResponse(
+ expirationChangeLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"credit_block_expiry" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return CustomerCreditLedgerListResponse(
- creditBlockExpiryLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerListResponse(
+ creditBlockExpiryLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"void" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerListResponse(
- voidLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerListResponse(
+ voidLedgerEntry = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"void_initiated" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return CustomerCreditLedgerListResponse(
- voidInitiatedLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerListResponse(
+ voidInitiatedLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"amendment" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return CustomerCreditLedgerListResponse(
- amendmentLedgerEntry = it,
- _json = json,
- )
- }
+ return CustomerCreditLedgerListResponse(
+ amendmentLedgerEntry =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
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 adb32522..914eead0 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
@@ -3947,20 +3947,17 @@ private constructor(
when (taxProvider) {
"avalara" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return TaxConfiguration(newAvalara = it, _json = json)
- }
+ return TaxConfiguration(
+ newAvalara =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"taxjar" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return TaxConfiguration(newTaxJar = it, _json = json)
- }
+ return TaxConfiguration(
+ newTaxJar = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
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 af6fcfbe..9f7b8181 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
@@ -3943,20 +3943,17 @@ private constructor(
when (taxProvider) {
"avalara" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return TaxConfiguration(newAvalara = it, _json = json)
- }
+ return TaxConfiguration(
+ newAvalara =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"taxjar" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return TaxConfiguration(newTaxJar = it, _json = json)
- }
+ return TaxConfiguration(
+ newTaxJar = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Discount.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Discount.kt
index 1d7faf7b..109c0639 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Discount.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Discount.kt
@@ -160,28 +160,28 @@ private constructor(
when (discountType) {
"percentage" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Discount(percentage = it, _json = json)
- }
+ return Discount(
+ percentage = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"trial" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Discount(trial = it, _json = json)
- }
+ return Discount(
+ trial = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"usage" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Discount(usage = it, _json = json)
- }
+ return Discount(
+ usage = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"amount" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Discount(amount = it, _json = json)
- }
+ return Discount(
+ amount = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
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 2e62f035..dfbe313d 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
@@ -7435,53 +7435,48 @@ private constructor(
when (adjustmentType) {
"usage_discount" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryUsageDiscount = it, _json = json)
- }
+ return Adjustment(
+ monetaryUsageDiscount =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"amount_discount" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryAmountDiscount = it, _json = json)
- }
+ return Adjustment(
+ monetaryAmountDiscount =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"percentage_discount" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryPercentageDiscount = it, _json = json)
- }
+ return Adjustment(
+ monetaryPercentageDiscount =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"minimum" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryMinimum = it, _json = json)
- }
+ return Adjustment(
+ monetaryMinimum =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"maximum" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryMaximum = it, _json = json)
- }
+ return Adjustment(
+ monetaryMaximum =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
@@ -10803,28 +10798,22 @@ private constructor(
when (type) {
"matrix" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return SubLineItem(matrix = it, _json = json)
- }
+ return SubLineItem(
+ matrix = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"tier" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return SubLineItem(tier = it, _json = json)
- }
+ return SubLineItem(
+ tier = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"'null'" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return SubLineItem(other = it, _json = json)
- }
+ return SubLineItem(
+ other = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
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 0cdcbd06..bc5ee923 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
@@ -7426,53 +7426,48 @@ private constructor(
when (adjustmentType) {
"usage_discount" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryUsageDiscount = it, _json = json)
- }
+ return Adjustment(
+ monetaryUsageDiscount =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"amount_discount" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryAmountDiscount = it, _json = json)
- }
+ return Adjustment(
+ monetaryAmountDiscount =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"percentage_discount" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryPercentageDiscount = it, _json = json)
- }
+ return Adjustment(
+ monetaryPercentageDiscount =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"minimum" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryMinimum = it, _json = json)
- }
+ return Adjustment(
+ monetaryMinimum =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"maximum" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryMaximum = it, _json = json)
- }
+ return Adjustment(
+ monetaryMaximum =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
@@ -10794,28 +10789,22 @@ private constructor(
when (type) {
"matrix" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return SubLineItem(matrix = it, _json = json)
- }
+ return SubLineItem(
+ matrix = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"tier" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return SubLineItem(tier = it, _json = json)
- }
+ return SubLineItem(
+ tier = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"'null'" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return SubLineItem(other = it, _json = json)
- }
+ return SubLineItem(
+ other = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLevelDiscount.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLevelDiscount.kt
index 023e08f8..76dbc4c4 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLevelDiscount.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLevelDiscount.kt
@@ -149,22 +149,22 @@ private constructor(
when (discountType) {
"percentage" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return InvoiceLevelDiscount(percentage = it, _json = json)
- }
+ return InvoiceLevelDiscount(
+ percentage = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"amount" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return InvoiceLevelDiscount(amount = it, _json = json)
- }
+ return InvoiceLevelDiscount(
+ amount = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"trial" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return InvoiceLevelDiscount(trial = it, _json = json)
- }
+ return InvoiceLevelDiscount(
+ trial = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt
index ce4874b9..56b2e6df 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt
@@ -1526,47 +1526,48 @@ private constructor(
when (adjustmentType) {
"usage_discount" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryUsageDiscount = it, _json = json)
- }
+ return Adjustment(
+ monetaryUsageDiscount =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"amount_discount" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryAmountDiscount = it, _json = json)
- }
+ return Adjustment(
+ monetaryAmountDiscount =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"percentage_discount" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryPercentageDiscount = it, _json = json)
- }
+ return Adjustment(
+ monetaryPercentageDiscount =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"minimum" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryMinimum = it, _json = json)
- }
+ return Adjustment(
+ monetaryMinimum =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"maximum" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Adjustment(monetaryMaximum = it, _json = json)
- }
+ return Adjustment(
+ monetaryMaximum =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
@@ -4837,22 +4838,22 @@ private constructor(
when (type) {
"matrix" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return SubLineItem(matrix = it, _json = json)
- }
+ return SubLineItem(
+ matrix = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"tier" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return SubLineItem(tier = it, _json = json)
- }
+ return SubLineItem(
+ tier = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"'null'" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return SubLineItem(other = it, _json = json)
- }
+ return SubLineItem(
+ other = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Plan.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Plan.kt
index 1abbdd01..f8a41c0a 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Plan.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Plan.kt
@@ -1536,47 +1536,48 @@ private constructor(
when (adjustmentType) {
"usage_discount" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Adjustment(planPhaseUsageDiscount = it, _json = json)
- }
+ return Adjustment(
+ planPhaseUsageDiscount =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"amount_discount" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Adjustment(planPhaseAmountDiscount = it, _json = json)
- }
+ return Adjustment(
+ planPhaseAmountDiscount =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"percentage_discount" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Adjustment(planPhasePercentageDiscount = it, _json = json)
- }
+ return Adjustment(
+ planPhasePercentageDiscount =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"minimum" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Adjustment(planPhaseMinimum = it, _json = json)
- }
+ return Adjustment(
+ planPhaseMinimum =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"maximum" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Adjustment(planPhaseMaximum = it, _json = json)
- }
+ return Adjustment(
+ planPhaseMaximum =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
}
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 12e1fd4b..4a3a3455 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
@@ -2003,212 +2003,204 @@ private constructor(
when (modelType) {
"unit" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(newPlanUnit = it, _json = json)
- }
+ return Price(
+ newPlanUnit = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"package" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanPackage = it, _json = json)
- }
+ return Price(
+ newPlanPackage =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"matrix" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(newPlanMatrix = it, _json = json)
- }
+ return Price(
+ newPlanMatrix = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"tiered" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(newPlanTiered = it, _json = json)
- }
+ return Price(
+ newPlanTiered = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"tiered_bps" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanTieredBps = it, _json = json)
- }
+ return Price(
+ newPlanTieredBps =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"bps" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(newPlanBps = it, _json = json)
- }
+ return Price(
+ newPlanBps = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"bulk_bps" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanBulkBps = it, _json = json)
- }
+ return Price(
+ newPlanBulkBps =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"bulk" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(newPlanBulk = it, _json = json)
- }
+ return Price(
+ newPlanBulk = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"threshold_total_amount" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanThresholdTotalAmount = it, _json = json)
- }
+ return Price(
+ newPlanThresholdTotalAmount =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"tiered_package" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanTieredPackage = it, _json = json)
- }
+ return Price(
+ newPlanTieredPackage =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"tiered_with_minimum" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanTieredWithMinimum = it, _json = json)
- }
+ return Price(
+ newPlanTieredWithMinimum =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"unit_with_percent" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanUnitWithPercent = it, _json = json)
- }
+ return Price(
+ newPlanUnitWithPercent =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"package_with_allocation" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanPackageWithAllocation = it, _json = json)
- }
+ return Price(
+ newPlanPackageWithAllocation =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"tiered_with_proration" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanTierWithProration = it, _json = json)
- }
+ return Price(
+ newPlanTierWithProration =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"unit_with_proration" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanUnitWithProration = it, _json = json)
- }
+ return Price(
+ newPlanUnitWithProration =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"grouped_allocation" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanGroupedAllocation = it, _json = json)
- }
+ return Price(
+ newPlanGroupedAllocation =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"grouped_with_prorated_minimum" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Price(newPlanGroupedWithProratedMinimum = it, _json = json)
- }
+ return Price(
+ newPlanGroupedWithProratedMinimum =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"grouped_with_metered_minimum" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Price(newPlanGroupedWithMeteredMinimum = it, _json = json)
- }
+ return Price(
+ newPlanGroupedWithMeteredMinimum =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"matrix_with_display_name" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanMatrixWithDisplayName = it, _json = json)
- }
+ return Price(
+ newPlanMatrixWithDisplayName =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"bulk_with_proration" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanBulkWithProration = it, _json = json)
- }
+ return Price(
+ newPlanBulkWithProration =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"grouped_tiered_package" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanGroupedTieredPackage = it, _json = json)
- }
+ return Price(
+ newPlanGroupedTieredPackage =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"max_group_tiered_package" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanMaxGroupTieredPackage = it, _json = json)
- }
+ return Price(
+ newPlanMaxGroupTieredPackage =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"scalable_matrix_with_unit_pricing" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Price(
- newPlanScalableMatrixWithUnitPricing = it,
- _json = json,
- )
- }
+ return Price(
+ newPlanScalableMatrixWithUnitPricing =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"scalable_matrix_with_tiered_pricing" -> {
- tryDeserialize(
- node,
- jacksonTypeRef(),
- ) {
- it.validate()
- }
- ?.let {
- return Price(
- newPlanScalableMatrixWithTieredPricing = it,
- _json = json,
- )
- }
+ return Price(
+ newPlanScalableMatrixWithTieredPricing =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
"cumulative_grouped_bulk" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanCumulativeGroupedBulk = it, _json = json)
- }
+ return Price(
+ newPlanCumulativeGroupedBulk =
+ deserialize(
+ node,
+ jacksonTypeRef(),
+ ),
+ _json = json,
+ )
}
}
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 6483bd22..e1d5c45a 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
@@ -719,198 +719,189 @@ private constructor(
when (modelType) {
"unit" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(unit = it, _json = json)
- }
+ return Price(
+ unit = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"package" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(packagePrice = it, _json = json)
- }
+ return Price(
+ packagePrice = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"matrix" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(matrix = it, _json = json)
- }
+ return Price(
+ matrix = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"tiered" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(tiered = it, _json = json)
- }
+ return Price(
+ tiered = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"tiered_bps" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(tieredBps = it, _json = json)
- }
+ return Price(
+ tieredBps = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"bps" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(bps = it, _json = json)
- }
+ return Price(bps = deserialize(node, jacksonTypeRef()), _json = json)
}
"bulk_bps" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(bulkBps = it, _json = json)
- }
+ return Price(
+ bulkBps = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"bulk" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(bulk = it, _json = json)
- }
+ return Price(
+ bulk = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"threshold_total_amount" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(thresholdTotalAmount = it, _json = json)
- }
+ return Price(
+ thresholdTotalAmount =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"tiered_package" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(tieredPackage = it, _json = json)
- }
+ return Price(
+ tieredPackage = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"grouped_tiered" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(groupedTiered = it, _json = json)
- }
+ return Price(
+ groupedTiered = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"tiered_with_minimum" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(tieredWithMinimum = it, _json = json)
- }
+ return Price(
+ tieredWithMinimum =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"tiered_package_with_minimum" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(tieredPackageWithMinimum = it, _json = json)
- }
+ return Price(
+ tieredPackageWithMinimum =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"package_with_allocation" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(packageWithAllocation = it, _json = json)
- }
+ return Price(
+ packageWithAllocation =
+ deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"unit_with_percent" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(unitWithPercent = it, _json = json)
- }
+ return Price(
+ unitWithPercent = deserialize(node, jacksonTypeRef()),
+ _json = json,
+ )
}
"matrix_with_allocation" -> {
- tryDeserialize(node, jacksonTypeRef