diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 354c2fa8..d2d60a3d 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.23.1"
+ ".": "0.24.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index f878d0a8..efeca04e 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 101
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-e480186cdd0e2cc631befa7e2c6ba5f2d7ae52052f0e79a748214f3ade8a98ee.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-7fca89ba5a0b4997358c25e6cdfb616a1d8b93a6820e25078f3fa5f61110bfe6.yml
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c902b9da..e844aa13 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 0.24.0 (2025-01-21)
+
+Full Changelog: [v0.23.1...v0.24.0](https://github.com/orbcorp/orb-java/compare/v0.23.1...v0.24.0)
+
+### Features
+
+* **api:** api update ([#211](https://github.com/orbcorp/orb-java/issues/211)) ([b543b72](https://github.com/orbcorp/orb-java/commit/b543b72b81d84461d748c99fb2e450877e382d4b))
+
## 0.23.1 (2025-01-20)
Full Changelog: [v0.23.0...v0.23.1](https://github.com/orbcorp/orb-java/compare/v0.23.0...v0.23.1)
diff --git a/README.md b/README.md
index c3e17b2f..ce6557db 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.23.1)
+[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.24.0)
@@ -25,7 +25,7 @@ The REST API documentation can be foundĀ on [docs.withorb.com](https://docs.with
```kotlin
-implementation("com.withorb.api:orb-java:0.23.1")
+implementation("com.withorb.api:orb-java:0.24.0")
```
#### Maven
@@ -34,7 +34,7 @@ implementation("com.withorb.api:orb-java:0.23.1")
com.withorb.api
orb-java
- 0.23.1
+ 0.24.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 92759855..2d0d6c4f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,4 +1,4 @@
allprojects {
group = "com.withorb.api"
- version = "0.23.1" // x-release-please-version
+ version = "0.24.0" // x-release-please-version
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListByExternalIdResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListByExternalIdResponse.kt
index 5b7b26ce..3083c1f0 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListByExternalIdResponse.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListByExternalIdResponse.kt
@@ -778,6 +778,21 @@ private constructor(
fun price(groupedTieredPackagePrice: Price.GroupedTieredPackagePrice) =
price(Price.ofGroupedTieredPackagePrice(groupedTieredPackagePrice))
+ /**
+ * The Price resource represents a price that can be billed on a subscription,
+ * resulting in a charge on an invoice in the form of an invoice line item. Prices
+ * take a quantity and determine an amount to bill.
+ *
+ * Orb supports a few different pricing models out of the box. Each of these models
+ * is serialized differently in a given Price object. The model_type field
+ * determines the key for the configuration object that is present.
+ *
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(maxGroupTieredPrice: Price.MaxGroupTieredPrice) =
+ price(Price.ofMaxGroupTieredPrice(maxGroupTieredPrice))
+
/**
* Price's contributions for the timeframe, excluding any minimums and discounts.
*/
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListResponse.kt
index 4ac301b3..73da1212 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListResponse.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListResponse.kt
@@ -775,6 +775,21 @@ private constructor(
fun price(groupedTieredPackagePrice: Price.GroupedTieredPackagePrice) =
price(Price.ofGroupedTieredPackagePrice(groupedTieredPackagePrice))
+ /**
+ * The Price resource represents a price that can be billed on a subscription,
+ * resulting in a charge on an invoice in the form of an invoice line item. Prices
+ * take a quantity and determine an amount to bill.
+ *
+ * Orb supports a few different pricing models out of the box. Each of these models
+ * is serialized differently in a given Price object. The model_type field
+ * determines the key for the configuration object that is present.
+ *
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(maxGroupTieredPrice: Price.MaxGroupTieredPrice) =
+ price(Price.ofMaxGroupTieredPrice(maxGroupTieredPrice))
+
/**
* Price's contributions for the timeframe, excluding any minimums and discounts.
*/
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerDeleteParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerDeleteParams.kt
index 03f54896..e031db39 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerDeleteParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerDeleteParams.kt
@@ -15,8 +15,9 @@ import java.util.Optional
* This performs a deletion of this customer, its subscriptions, and its invoices, provided the
* customer does not have any issued invoices. Customers with issued invoices cannot be deleted.
* This operation is irreversible. Note that this is a _soft_ deletion, but the data will be
- * inaccessible through the API and Orb dashboard. For a hard-deletion, please reach out to the Orb
- * team directly.
+ * inaccessible through the API and Orb dashboard.
+ *
+ * For a hard-deletion, please reach out to the Orb team directly.
*
* **Note**: This operation happens asynchronously and can be expected to take a few minutes to
* propagate to related resources. However, querying for the customer on subsequent GET requests
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCreateParams.kt
index bd09a919..fd028924 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCreateParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCreateParams.kt
@@ -44,7 +44,7 @@ import java.util.Optional
* for that customer. If neither is specified, the backfill will affect all customers.
*
* When `replace_existing_events` is `true`, this indicates that existing events in the timeframe
- * should no longer be counter towards invoiced usage. In this scenario, the parameter `filter` can
+ * should no longer be counted towards invoiced usage. In this scenario, the parameter `filter` can
* be optionally added which enables filtering using
* [computed properties](/extensibility/advanced-metrics#computed-properties). The expressiveness of
* computed properties allows you to deprecate existing events based on both a period of time and
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 2e7e99df..635a8032 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
@@ -5293,6 +5293,21 @@ private constructor(
fun price(groupedTieredPackagePrice: Price.GroupedTieredPackagePrice) =
price(Price.ofGroupedTieredPackagePrice(groupedTieredPackagePrice))
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting
+ * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
+ * and determine an amount to bill.
+ *
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the
+ * key for the configuration object that is present.
+ *
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(maxGroupTieredPrice: Price.MaxGroupTieredPrice) =
+ price(Price.ofMaxGroupTieredPrice(maxGroupTieredPrice))
+
fun quantity(quantity: Double) = quantity(JsonField.of(quantity))
fun quantity(quantity: JsonField) = apply { this.quantity = quantity }
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 bdef266e..058c8322 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
@@ -5287,6 +5287,21 @@ private constructor(
fun price(groupedTieredPackagePrice: Price.GroupedTieredPackagePrice) =
price(Price.ofGroupedTieredPackagePrice(groupedTieredPackagePrice))
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting
+ * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
+ * and determine an amount to bill.
+ *
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the
+ * key for the configuration object that is present.
+ *
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(maxGroupTieredPrice: Price.MaxGroupTieredPrice) =
+ price(Price.ofMaxGroupTieredPrice(maxGroupTieredPrice))
+
fun quantity(quantity: Double) = quantity(JsonField.of(quantity))
fun quantity(quantity: JsonField) = apply { this.quantity = quantity }
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 386d63f1..5731aea3 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
@@ -784,6 +784,21 @@ private constructor(
fun price(groupedTieredPackagePrice: Price.GroupedTieredPackagePrice) =
price(Price.ofGroupedTieredPackagePrice(groupedTieredPackagePrice))
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting in
+ * a charge on an invoice in the form of an invoice line item. Prices take a quantity and
+ * determine an amount to bill.
+ *
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the key
+ * for the configuration object that is present.
+ *
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(maxGroupTieredPrice: Price.MaxGroupTieredPrice) =
+ price(Price.ofMaxGroupTieredPrice(maxGroupTieredPrice))
+
fun quantity(quantity: Double) = quantity(JsonField.of(quantity))
fun quantity(quantity: JsonField) = apply { this.quantity = quantity }
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 266c3e04..8ec2ce13 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
@@ -898,6 +898,13 @@ private constructor(
fun addPrice(groupedTieredPackagePrice: Price.GroupedTieredPackagePrice) =
addPrice(Price.ofGroupedTieredPackagePrice(groupedTieredPackagePrice))
+ /**
+ * Prices for this plan. If the plan has phases, this includes prices across all phases of
+ * the plan.
+ */
+ fun addPrice(maxGroupTieredPrice: Price.MaxGroupTieredPrice) =
+ addPrice(Price.ofMaxGroupTieredPrice(maxGroupTieredPrice))
+
fun product(product: Product) = product(JsonField.of(product))
fun product(product: JsonField) = apply { this.product = product }
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 89a78812..2e4b9a3e 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
@@ -492,6 +492,13 @@ constructor(
fun addPrice(newPlanGroupedTieredPackagePrice: Price.NewPlanGroupedTieredPackagePrice) =
addPrice(Price.ofNewPlanGroupedTieredPackagePrice(newPlanGroupedTieredPackagePrice))
+ /**
+ * Prices for this plan. If the plan has phases, this includes prices across all phases
+ * of the plan.
+ */
+ fun addPrice(newPlanMaxGroupTieredPrice: Price.NewPlanMaxGroupTieredPrice) =
+ addPrice(Price.ofNewPlanMaxGroupTieredPrice(newPlanMaxGroupTieredPrice))
+
/** Free-form text which is available on the invoice PDF and the Orb invoice portal. */
fun defaultInvoiceMemo(defaultInvoiceMemo: String?) =
defaultInvoiceMemo(JsonField.ofNullable(defaultInvoiceMemo))
@@ -845,6 +852,14 @@ constructor(
body.addPrice(newPlanGroupedTieredPackagePrice)
}
+ /**
+ * Prices for this plan. If the plan has phases, this includes prices across all phases of
+ * the plan.
+ */
+ fun addPrice(newPlanMaxGroupTieredPrice: Price.NewPlanMaxGroupTieredPrice) = apply {
+ body.addPrice(newPlanMaxGroupTieredPrice)
+ }
+
/** Free-form text which is available on the invoice PDF and the Orb invoice portal. */
fun defaultInvoiceMemo(defaultInvoiceMemo: String?) = apply {
body.defaultInvoiceMemo(defaultInvoiceMemo)
@@ -1079,6 +1094,7 @@ constructor(
private val newPlanMatrixWithDisplayNamePrice: NewPlanMatrixWithDisplayNamePrice? = null,
private val newPlanBulkWithProrationPrice: NewPlanBulkWithProrationPrice? = null,
private val newPlanGroupedTieredPackagePrice: NewPlanGroupedTieredPackagePrice? = null,
+ private val newPlanMaxGroupTieredPrice: NewPlanMaxGroupTieredPrice? = null,
private val _json: JsonValue? = null,
) {
@@ -1144,6 +1160,9 @@ constructor(
fun newPlanGroupedTieredPackagePrice(): Optional =
Optional.ofNullable(newPlanGroupedTieredPackagePrice)
+ fun newPlanMaxGroupTieredPrice(): Optional =
+ Optional.ofNullable(newPlanMaxGroupTieredPrice)
+
fun isNewPlanUnitPrice(): Boolean = newPlanUnitPrice != null
fun isNewPlanPackagePrice(): Boolean = newPlanPackagePrice != null
@@ -1190,6 +1209,8 @@ constructor(
fun isNewPlanGroupedTieredPackagePrice(): Boolean = newPlanGroupedTieredPackagePrice != null
+ fun isNewPlanMaxGroupTieredPrice(): Boolean = newPlanMaxGroupTieredPrice != null
+
fun asNewPlanUnitPrice(): NewPlanUnitPrice = newPlanUnitPrice.getOrThrow("newPlanUnitPrice")
fun asNewPlanPackagePrice(): NewPlanPackagePrice =
@@ -1254,6 +1275,9 @@ constructor(
fun asNewPlanGroupedTieredPackagePrice(): NewPlanGroupedTieredPackagePrice =
newPlanGroupedTieredPackagePrice.getOrThrow("newPlanGroupedTieredPackagePrice")
+ fun asNewPlanMaxGroupTieredPrice(): NewPlanMaxGroupTieredPrice =
+ newPlanMaxGroupTieredPrice.getOrThrow("newPlanMaxGroupTieredPrice")
+
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T {
@@ -1301,6 +1325,8 @@ constructor(
visitor.visitNewPlanBulkWithProrationPrice(newPlanBulkWithProrationPrice)
newPlanGroupedTieredPackagePrice != null ->
visitor.visitNewPlanGroupedTieredPackagePrice(newPlanGroupedTieredPackagePrice)
+ newPlanMaxGroupTieredPrice != null ->
+ visitor.visitNewPlanMaxGroupTieredPrice(newPlanMaxGroupTieredPrice)
else -> visitor.unknown(_json)
}
}
@@ -1430,6 +1456,12 @@ constructor(
) {
newPlanGroupedTieredPackagePrice.validate()
}
+
+ override fun visitNewPlanMaxGroupTieredPrice(
+ newPlanMaxGroupTieredPrice: NewPlanMaxGroupTieredPrice
+ ) {
+ newPlanMaxGroupTieredPrice.validate()
+ }
}
)
validated = true
@@ -1440,10 +1472,10 @@ constructor(
return true
}
- return /* spotless:off */ other is Price && newPlanUnitPrice == other.newPlanUnitPrice && newPlanPackagePrice == other.newPlanPackagePrice && newPlanMatrixPrice == other.newPlanMatrixPrice && newPlanTieredPrice == other.newPlanTieredPrice && newPlanTieredBpsPrice == other.newPlanTieredBpsPrice && newPlanBpsPrice == other.newPlanBpsPrice && newPlanBulkBpsPrice == other.newPlanBulkBpsPrice && newPlanBulkPrice == other.newPlanBulkPrice && newPlanThresholdTotalAmountPrice == other.newPlanThresholdTotalAmountPrice && newPlanTieredPackagePrice == other.newPlanTieredPackagePrice && newPlanTieredWithMinimumPrice == other.newPlanTieredWithMinimumPrice && newPlanUnitWithPercentPrice == other.newPlanUnitWithPercentPrice && newPlanPackageWithAllocationPrice == other.newPlanPackageWithAllocationPrice && newPlanTierWithProrationPrice == other.newPlanTierWithProrationPrice && newPlanUnitWithProrationPrice == other.newPlanUnitWithProrationPrice && newPlanGroupedAllocationPrice == other.newPlanGroupedAllocationPrice && newPlanGroupedWithProratedMinimumPrice == other.newPlanGroupedWithProratedMinimumPrice && newPlanGroupedWithMeteredMinimumPrice == other.newPlanGroupedWithMeteredMinimumPrice && newPlanMatrixWithDisplayNamePrice == other.newPlanMatrixWithDisplayNamePrice && newPlanBulkWithProrationPrice == other.newPlanBulkWithProrationPrice && newPlanGroupedTieredPackagePrice == other.newPlanGroupedTieredPackagePrice /* spotless:on */
+ return /* spotless:off */ other is Price && newPlanUnitPrice == other.newPlanUnitPrice && newPlanPackagePrice == other.newPlanPackagePrice && newPlanMatrixPrice == other.newPlanMatrixPrice && newPlanTieredPrice == other.newPlanTieredPrice && newPlanTieredBpsPrice == other.newPlanTieredBpsPrice && newPlanBpsPrice == other.newPlanBpsPrice && newPlanBulkBpsPrice == other.newPlanBulkBpsPrice && newPlanBulkPrice == other.newPlanBulkPrice && newPlanThresholdTotalAmountPrice == other.newPlanThresholdTotalAmountPrice && newPlanTieredPackagePrice == other.newPlanTieredPackagePrice && newPlanTieredWithMinimumPrice == other.newPlanTieredWithMinimumPrice && newPlanUnitWithPercentPrice == other.newPlanUnitWithPercentPrice && newPlanPackageWithAllocationPrice == other.newPlanPackageWithAllocationPrice && newPlanTierWithProrationPrice == other.newPlanTierWithProrationPrice && newPlanUnitWithProrationPrice == other.newPlanUnitWithProrationPrice && newPlanGroupedAllocationPrice == other.newPlanGroupedAllocationPrice && newPlanGroupedWithProratedMinimumPrice == other.newPlanGroupedWithProratedMinimumPrice && newPlanGroupedWithMeteredMinimumPrice == other.newPlanGroupedWithMeteredMinimumPrice && newPlanMatrixWithDisplayNamePrice == other.newPlanMatrixWithDisplayNamePrice && newPlanBulkWithProrationPrice == other.newPlanBulkWithProrationPrice && newPlanGroupedTieredPackagePrice == other.newPlanGroupedTieredPackagePrice && newPlanMaxGroupTieredPrice == other.newPlanMaxGroupTieredPrice /* spotless:on */
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPlanUnitPrice, newPlanPackagePrice, newPlanMatrixPrice, newPlanTieredPrice, newPlanTieredBpsPrice, newPlanBpsPrice, newPlanBulkBpsPrice, newPlanBulkPrice, newPlanThresholdTotalAmountPrice, newPlanTieredPackagePrice, newPlanTieredWithMinimumPrice, newPlanUnitWithPercentPrice, newPlanPackageWithAllocationPrice, newPlanTierWithProrationPrice, newPlanUnitWithProrationPrice, newPlanGroupedAllocationPrice, newPlanGroupedWithProratedMinimumPrice, newPlanGroupedWithMeteredMinimumPrice, newPlanMatrixWithDisplayNamePrice, newPlanBulkWithProrationPrice, newPlanGroupedTieredPackagePrice) /* spotless:on */
+ override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPlanUnitPrice, newPlanPackagePrice, newPlanMatrixPrice, newPlanTieredPrice, newPlanTieredBpsPrice, newPlanBpsPrice, newPlanBulkBpsPrice, newPlanBulkPrice, newPlanThresholdTotalAmountPrice, newPlanTieredPackagePrice, newPlanTieredWithMinimumPrice, newPlanUnitWithPercentPrice, newPlanPackageWithAllocationPrice, newPlanTierWithProrationPrice, newPlanUnitWithProrationPrice, newPlanGroupedAllocationPrice, newPlanGroupedWithProratedMinimumPrice, newPlanGroupedWithMeteredMinimumPrice, newPlanMatrixWithDisplayNamePrice, newPlanBulkWithProrationPrice, newPlanGroupedTieredPackagePrice, newPlanMaxGroupTieredPrice) /* spotless:on */
override fun toString(): String =
when {
@@ -1482,6 +1514,8 @@ constructor(
"Price{newPlanBulkWithProrationPrice=$newPlanBulkWithProrationPrice}"
newPlanGroupedTieredPackagePrice != null ->
"Price{newPlanGroupedTieredPackagePrice=$newPlanGroupedTieredPackagePrice}"
+ newPlanMaxGroupTieredPrice != null ->
+ "Price{newPlanMaxGroupTieredPrice=$newPlanMaxGroupTieredPrice}"
_json != null -> "Price{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Price")
}
@@ -1586,6 +1620,11 @@ constructor(
fun ofNewPlanGroupedTieredPackagePrice(
newPlanGroupedTieredPackagePrice: NewPlanGroupedTieredPackagePrice
) = Price(newPlanGroupedTieredPackagePrice = newPlanGroupedTieredPackagePrice)
+
+ @JvmStatic
+ fun ofNewPlanMaxGroupTieredPrice(
+ newPlanMaxGroupTieredPrice: NewPlanMaxGroupTieredPrice
+ ) = Price(newPlanMaxGroupTieredPrice = newPlanMaxGroupTieredPrice)
}
interface Visitor {
@@ -1658,6 +1697,10 @@ constructor(
newPlanGroupedTieredPackagePrice: NewPlanGroupedTieredPackagePrice
): T
+ fun visitNewPlanMaxGroupTieredPrice(
+ newPlanMaxGroupTieredPrice: NewPlanMaxGroupTieredPrice
+ ): T
+
fun unknown(json: JsonValue?): T {
throw OrbInvalidDataException("Unknown Price: $json")
}
@@ -1841,6 +1884,14 @@ constructor(
return Price(newPlanGroupedTieredPackagePrice = it, _json = json)
}
}
+ "max_group_tiered" -> {
+ tryDeserialize(node, jacksonTypeRef()) {
+ it.validate()
+ }
+ ?.let {
+ return Price(newPlanMaxGroupTieredPrice = it, _json = json)
+ }
+ }
}
return Price(_json = json)
@@ -1894,6 +1945,8 @@ constructor(
generator.writeObject(value.newPlanBulkWithProrationPrice)
value.newPlanGroupedTieredPackagePrice != null ->
generator.writeObject(value.newPlanGroupedTieredPackagePrice)
+ value.newPlanMaxGroupTieredPrice != null ->
+ generator.writeObject(value.newPlanMaxGroupTieredPrice)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Price")
}
@@ -30294,6 +30347,1296 @@ constructor(
override fun toString() =
"NewPlanGroupedTieredPackagePrice{cadence=$cadence, groupedTieredPackageConfig=$groupedTieredPackageConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, currency=$currency, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}"
}
+
+ @NoAutoDetect
+ class NewPlanMaxGroupTieredPrice
+ @JsonCreator
+ private constructor(
+ @JsonProperty("cadence")
+ @ExcludeMissing
+ private val cadence: JsonField = JsonMissing.of(),
+ @JsonProperty("item_id")
+ @ExcludeMissing
+ private val itemId: JsonField = JsonMissing.of(),
+ @JsonProperty("max_group_tiered_config")
+ @ExcludeMissing
+ private val maxGroupTieredConfig: JsonField = JsonMissing.of(),
+ @JsonProperty("model_type")
+ @ExcludeMissing
+ private val modelType: JsonField = JsonMissing.of(),
+ @JsonProperty("name")
+ @ExcludeMissing
+ private val name: JsonField = JsonMissing.of(),
+ @JsonProperty("billable_metric_id")
+ @ExcludeMissing
+ private val billableMetricId: JsonField = JsonMissing.of(),
+ @JsonProperty("billed_in_advance")
+ @ExcludeMissing
+ private val billedInAdvance: JsonField = JsonMissing.of(),
+ @JsonProperty("billing_cycle_configuration")
+ @ExcludeMissing
+ private val billingCycleConfiguration: JsonField =
+ JsonMissing.of(),
+ @JsonProperty("conversion_rate")
+ @ExcludeMissing
+ private val conversionRate: JsonField = JsonMissing.of(),
+ @JsonProperty("currency")
+ @ExcludeMissing
+ private val currency: JsonField = JsonMissing.of(),
+ @JsonProperty("external_price_id")
+ @ExcludeMissing
+ private val externalPriceId: JsonField = JsonMissing.of(),
+ @JsonProperty("fixed_price_quantity")
+ @ExcludeMissing
+ private val fixedPriceQuantity: JsonField = JsonMissing.of(),
+ @JsonProperty("invoice_grouping_key")
+ @ExcludeMissing
+ private val invoiceGroupingKey: JsonField = JsonMissing.of(),
+ @JsonProperty("invoicing_cycle_configuration")
+ @ExcludeMissing
+ private val invoicingCycleConfiguration: JsonField =
+ JsonMissing.of(),
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ private val metadata: JsonField = JsonMissing.of(),
+ @JsonAnySetter
+ private val additionalProperties: Map = immutableEmptyMap(),
+ ) {
+
+ /** The cadence to bill for this price on. */
+ fun cadence(): Cadence = cadence.getRequired("cadence")
+
+ /** The id of the item the plan will be associated with. */
+ fun itemId(): String = itemId.getRequired("item_id")
+
+ fun maxGroupTieredConfig(): MaxGroupTieredConfig =
+ maxGroupTieredConfig.getRequired("max_group_tiered_config")
+
+ fun modelType(): ModelType = modelType.getRequired("model_type")
+
+ /** The name of the price. */
+ fun name(): String = name.getRequired("name")
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is usage-based.
+ */
+ fun billableMetricId(): Optional =
+ Optional.ofNullable(billableMetricId.getNullable("billable_metric_id"))
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if this is
+ * true, and in-arrears if this is false.
+ */
+ fun billedInAdvance(): Optional =
+ Optional.ofNullable(billedInAdvance.getNullable("billed_in_advance"))
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or months.
+ */
+ fun billingCycleConfiguration(): Optional =
+ Optional.ofNullable(
+ billingCycleConfiguration.getNullable("billing_cycle_configuration")
+ )
+
+ /** The per unit conversion rate of the price currency to the invoicing currency. */
+ fun conversionRate(): Optional =
+ Optional.ofNullable(conversionRate.getNullable("conversion_rate"))
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this price
+ * is billed.
+ */
+ fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency"))
+
+ /** An alias for the price. */
+ fun externalPriceId(): Optional =
+ Optional.ofNullable(externalPriceId.getNullable("external_price_id"))
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units applied.
+ */
+ fun fixedPriceQuantity(): Optional =
+ Optional.ofNullable(fixedPriceQuantity.getNullable("fixed_price_quantity"))
+
+ /** The property used to group this price on an invoice */
+ fun invoiceGroupingKey(): Optional =
+ Optional.ofNullable(invoiceGroupingKey.getNullable("invoice_grouping_key"))
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced. If
+ * unspecified, a single invoice is produced per billing cycle.
+ */
+ fun invoicingCycleConfiguration(): Optional =
+ Optional.ofNullable(
+ invoicingCycleConfiguration.getNullable("invoicing_cycle_configuration")
+ )
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed by
+ * setting the value to `null`, and the entire metadata mapping can be cleared by
+ * setting `metadata` to `null`.
+ */
+ fun metadata(): Optional =
+ Optional.ofNullable(metadata.getNullable("metadata"))
+
+ /** The cadence to bill for this price on. */
+ @JsonProperty("cadence") @ExcludeMissing fun _cadence(): JsonField = cadence
+
+ /** The id of the item the plan will be associated with. */
+ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId
+
+ @JsonProperty("max_group_tiered_config")
+ @ExcludeMissing
+ fun _maxGroupTieredConfig(): JsonField = maxGroupTieredConfig
+
+ @JsonProperty("model_type")
+ @ExcludeMissing
+ fun _modelType(): JsonField = modelType
+
+ /** The name of the price. */
+ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is usage-based.
+ */
+ @JsonProperty("billable_metric_id")
+ @ExcludeMissing
+ fun _billableMetricId(): JsonField = billableMetricId
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if this is
+ * true, and in-arrears if this is false.
+ */
+ @JsonProperty("billed_in_advance")
+ @ExcludeMissing
+ fun _billedInAdvance(): JsonField = billedInAdvance
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or months.
+ */
+ @JsonProperty("billing_cycle_configuration")
+ @ExcludeMissing
+ fun _billingCycleConfiguration(): JsonField =
+ billingCycleConfiguration
+
+ /** The per unit conversion rate of the price currency to the invoicing currency. */
+ @JsonProperty("conversion_rate")
+ @ExcludeMissing
+ fun _conversionRate(): JsonField = conversionRate
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this price
+ * is billed.
+ */
+ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency
+
+ /** An alias for the price. */
+ @JsonProperty("external_price_id")
+ @ExcludeMissing
+ fun _externalPriceId(): JsonField = externalPriceId
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units applied.
+ */
+ @JsonProperty("fixed_price_quantity")
+ @ExcludeMissing
+ fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity
+
+ /** The property used to group this price on an invoice */
+ @JsonProperty("invoice_grouping_key")
+ @ExcludeMissing
+ fun _invoiceGroupingKey(): JsonField = invoiceGroupingKey
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced. If
+ * unspecified, a single invoice is produced per billing cycle.
+ */
+ @JsonProperty("invoicing_cycle_configuration")
+ @ExcludeMissing
+ fun _invoicingCycleConfiguration(): JsonField =
+ invoicingCycleConfiguration
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed by
+ * setting the value to `null`, and the entire metadata mapping can be cleared by
+ * setting `metadata` to `null`.
+ */
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ fun _metadata(): JsonField = metadata
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ private var validated: Boolean = false
+
+ fun validate(): NewPlanMaxGroupTieredPrice = apply {
+ if (validated) {
+ return@apply
+ }
+
+ cadence()
+ itemId()
+ maxGroupTieredConfig().validate()
+ modelType()
+ name()
+ billableMetricId()
+ billedInAdvance()
+ billingCycleConfiguration().ifPresent { it.validate() }
+ conversionRate()
+ currency()
+ externalPriceId()
+ fixedPriceQuantity()
+ invoiceGroupingKey()
+ invoicingCycleConfiguration().ifPresent { it.validate() }
+ metadata().ifPresent { it.validate() }
+ validated = true
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var cadence: JsonField? = null
+ private var itemId: JsonField? = null
+ private var maxGroupTieredConfig: JsonField? = null
+ private var modelType: JsonField? = null
+ private var name: JsonField? = null
+ private var billableMetricId: JsonField = JsonMissing.of()
+ private var billedInAdvance: JsonField = JsonMissing.of()
+ private var billingCycleConfiguration: JsonField =
+ JsonMissing.of()
+ private var conversionRate: JsonField = JsonMissing.of()
+ private var currency: JsonField = JsonMissing.of()
+ private var externalPriceId: JsonField = JsonMissing.of()
+ private var fixedPriceQuantity: JsonField = JsonMissing.of()
+ private var invoiceGroupingKey: JsonField = JsonMissing.of()
+ private var invoicingCycleConfiguration: JsonField =
+ JsonMissing.of()
+ private var metadata: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(newPlanMaxGroupTieredPrice: NewPlanMaxGroupTieredPrice) = apply {
+ cadence = newPlanMaxGroupTieredPrice.cadence
+ itemId = newPlanMaxGroupTieredPrice.itemId
+ maxGroupTieredConfig = newPlanMaxGroupTieredPrice.maxGroupTieredConfig
+ modelType = newPlanMaxGroupTieredPrice.modelType
+ name = newPlanMaxGroupTieredPrice.name
+ billableMetricId = newPlanMaxGroupTieredPrice.billableMetricId
+ billedInAdvance = newPlanMaxGroupTieredPrice.billedInAdvance
+ billingCycleConfiguration = newPlanMaxGroupTieredPrice.billingCycleConfiguration
+ conversionRate = newPlanMaxGroupTieredPrice.conversionRate
+ currency = newPlanMaxGroupTieredPrice.currency
+ externalPriceId = newPlanMaxGroupTieredPrice.externalPriceId
+ fixedPriceQuantity = newPlanMaxGroupTieredPrice.fixedPriceQuantity
+ invoiceGroupingKey = newPlanMaxGroupTieredPrice.invoiceGroupingKey
+ invoicingCycleConfiguration =
+ newPlanMaxGroupTieredPrice.invoicingCycleConfiguration
+ metadata = newPlanMaxGroupTieredPrice.metadata
+ additionalProperties =
+ newPlanMaxGroupTieredPrice.additionalProperties.toMutableMap()
+ }
+
+ /** The cadence to bill for this price on. */
+ fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence))
+
+ /** The cadence to bill for this price on. */
+ fun cadence(cadence: JsonField) = apply { this.cadence = cadence }
+
+ /** The id of the item the plan will be associated with. */
+ fun itemId(itemId: String) = itemId(JsonField.of(itemId))
+
+ /** The id of the item the plan will be associated with. */
+ fun itemId(itemId: JsonField) = apply { this.itemId = itemId }
+
+ fun maxGroupTieredConfig(maxGroupTieredConfig: MaxGroupTieredConfig) =
+ maxGroupTieredConfig(JsonField.of(maxGroupTieredConfig))
+
+ fun maxGroupTieredConfig(maxGroupTieredConfig: JsonField) =
+ apply {
+ this.maxGroupTieredConfig = maxGroupTieredConfig
+ }
+
+ fun modelType(modelType: ModelType) = modelType(JsonField.of(modelType))
+
+ fun modelType(modelType: JsonField) = apply {
+ this.modelType = modelType
+ }
+
+ /** The name of the price. */
+ fun name(name: String) = name(JsonField.of(name))
+
+ /** The name of the price. */
+ fun name(name: JsonField) = apply { this.name = name }
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ fun billableMetricId(billableMetricId: String?) =
+ billableMetricId(JsonField.ofNullable(billableMetricId))
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ fun billableMetricId(billableMetricId: Optional) =
+ billableMetricId(billableMetricId.orElse(null))
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ fun billableMetricId(billableMetricId: JsonField) = apply {
+ this.billableMetricId = billableMetricId
+ }
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if this
+ * is true, and in-arrears if this is false.
+ */
+ fun billedInAdvance(billedInAdvance: Boolean?) =
+ billedInAdvance(JsonField.ofNullable(billedInAdvance))
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if this
+ * is true, and in-arrears if this is false.
+ */
+ fun billedInAdvance(billedInAdvance: Boolean) =
+ billedInAdvance(billedInAdvance as Boolean?)
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if this
+ * is true, and in-arrears if this is false.
+ */
+ @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228
+ fun billedInAdvance(billedInAdvance: Optional) =
+ billedInAdvance(billedInAdvance.orElse(null) as Boolean?)
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if this
+ * is true, and in-arrears if this is false.
+ */
+ fun billedInAdvance(billedInAdvance: JsonField) = apply {
+ this.billedInAdvance = billedInAdvance
+ }
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ fun billingCycleConfiguration(
+ billingCycleConfiguration: BillingCycleConfiguration?
+ ) = billingCycleConfiguration(JsonField.ofNullable(billingCycleConfiguration))
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ fun billingCycleConfiguration(
+ billingCycleConfiguration: Optional
+ ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null))
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ fun billingCycleConfiguration(
+ billingCycleConfiguration: JsonField
+ ) = apply { this.billingCycleConfiguration = billingCycleConfiguration }
+
+ /** The per unit conversion rate of the price currency to the invoicing currency. */
+ fun conversionRate(conversionRate: Double?) =
+ conversionRate(JsonField.ofNullable(conversionRate))
+
+ /** The per unit conversion rate of the price currency to the invoicing currency. */
+ fun conversionRate(conversionRate: Double) =
+ conversionRate(conversionRate as Double?)
+
+ /** The per unit conversion rate of the price currency to the invoicing currency. */
+ @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228
+ fun conversionRate(conversionRate: Optional) =
+ conversionRate(conversionRate.orElse(null) as Double?)
+
+ /** The per unit conversion rate of the price currency to the invoicing currency. */
+ fun conversionRate(conversionRate: JsonField) = apply {
+ this.conversionRate = conversionRate
+ }
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ fun currency(currency: String?) = currency(JsonField.ofNullable(currency))
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ fun currency(currency: Optional) = currency(currency.orElse(null))
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ fun currency(currency: JsonField) = apply { this.currency = currency }
+
+ /** An alias for the price. */
+ fun externalPriceId(externalPriceId: String?) =
+ externalPriceId(JsonField.ofNullable(externalPriceId))
+
+ /** An alias for the price. */
+ fun externalPriceId(externalPriceId: Optional) =
+ externalPriceId(externalPriceId.orElse(null))
+
+ /** An alias for the price. */
+ fun externalPriceId(externalPriceId: JsonField) = apply {
+ this.externalPriceId = externalPriceId
+ }
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fun fixedPriceQuantity(fixedPriceQuantity: Double?) =
+ fixedPriceQuantity(JsonField.ofNullable(fixedPriceQuantity))
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fun fixedPriceQuantity(fixedPriceQuantity: Double) =
+ fixedPriceQuantity(fixedPriceQuantity as Double?)
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228
+ fun fixedPriceQuantity(fixedPriceQuantity: Optional) =
+ fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?)
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply {
+ this.fixedPriceQuantity = fixedPriceQuantity
+ }
+
+ /** The property used to group this price on an invoice */
+ fun invoiceGroupingKey(invoiceGroupingKey: String?) =
+ invoiceGroupingKey(JsonField.ofNullable(invoiceGroupingKey))
+
+ /** The property used to group this price on an invoice */
+ fun invoiceGroupingKey(invoiceGroupingKey: Optional) =
+ invoiceGroupingKey(invoiceGroupingKey.orElse(null))
+
+ /** The property used to group this price on an invoice */
+ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply {
+ this.invoiceGroupingKey = invoiceGroupingKey
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ fun invoicingCycleConfiguration(
+ invoicingCycleConfiguration: InvoicingCycleConfiguration?
+ ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration))
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ fun invoicingCycleConfiguration(
+ invoicingCycleConfiguration: Optional
+ ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null))
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ fun invoicingCycleConfiguration(
+ invoicingCycleConfiguration: JsonField
+ ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration }
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared by
+ * setting `metadata` to `null`.
+ */
+ fun metadata(metadata: Metadata?) = metadata(JsonField.ofNullable(metadata))
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared by
+ * setting `metadata` to `null`.
+ */
+ fun metadata(metadata: Optional) = metadata(metadata.orElse(null))
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared by
+ * setting `metadata` to `null`.
+ */
+ fun metadata(metadata: JsonField) = apply { this.metadata = metadata }
+
+ 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)
+ }
+
+ fun build(): NewPlanMaxGroupTieredPrice =
+ NewPlanMaxGroupTieredPrice(
+ checkRequired("cadence", cadence),
+ checkRequired("itemId", itemId),
+ checkRequired("maxGroupTieredConfig", maxGroupTieredConfig),
+ checkRequired("modelType", modelType),
+ checkRequired("name", name),
+ billableMetricId,
+ billedInAdvance,
+ billingCycleConfiguration,
+ conversionRate,
+ currency,
+ externalPriceId,
+ fixedPriceQuantity,
+ invoiceGroupingKey,
+ invoicingCycleConfiguration,
+ metadata,
+ additionalProperties.toImmutable(),
+ )
+ }
+
+ /** The cadence to bill for this price on. */
+ class Cadence
+ @JsonCreator
+ private constructor(
+ private val value: JsonField,
+ ) : Enum {
+
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val ANNUAL = of("annual")
+
+ @JvmField val SEMI_ANNUAL = of("semi_annual")
+
+ @JvmField val MONTHLY = of("monthly")
+
+ @JvmField val QUARTERLY = of("quarterly")
+
+ @JvmField val ONE_TIME = of("one_time")
+
+ @JvmField val CUSTOM = of("custom")
+
+ @JvmStatic fun of(value: String) = Cadence(JsonField.of(value))
+ }
+
+ enum class Known {
+ ANNUAL,
+ SEMI_ANNUAL,
+ MONTHLY,
+ QUARTERLY,
+ ONE_TIME,
+ CUSTOM,
+ }
+
+ enum class Value {
+ ANNUAL,
+ SEMI_ANNUAL,
+ MONTHLY,
+ QUARTERLY,
+ ONE_TIME,
+ CUSTOM,
+ _UNKNOWN,
+ }
+
+ fun value(): Value =
+ when (this) {
+ ANNUAL -> Value.ANNUAL
+ SEMI_ANNUAL -> Value.SEMI_ANNUAL
+ MONTHLY -> Value.MONTHLY
+ QUARTERLY -> Value.QUARTERLY
+ ONE_TIME -> Value.ONE_TIME
+ CUSTOM -> Value.CUSTOM
+ else -> Value._UNKNOWN
+ }
+
+ fun known(): Known =
+ when (this) {
+ ANNUAL -> Known.ANNUAL
+ SEMI_ANNUAL -> Known.SEMI_ANNUAL
+ MONTHLY -> Known.MONTHLY
+ QUARTERLY -> Known.QUARTERLY
+ ONE_TIME -> Known.ONE_TIME
+ CUSTOM -> Known.CUSTOM
+ else -> throw OrbInvalidDataException("Unknown Cadence: $value")
+ }
+
+ fun asString(): String = _value().asStringOrThrow()
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is Cadence && value == other.value /* spotless:on */
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ @NoAutoDetect
+ class MaxGroupTieredConfig
+ @JsonCreator
+ private constructor(
+ @JsonAnySetter
+ private val additionalProperties: Map = immutableEmptyMap(),
+ ) {
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ private var validated: Boolean = false
+
+ fun validate(): MaxGroupTieredConfig = apply {
+ if (validated) {
+ return@apply
+ }
+
+ validated = true
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(maxGroupTieredConfig: MaxGroupTieredConfig) = apply {
+ additionalProperties =
+ maxGroupTieredConfig.additionalProperties.toMutableMap()
+ }
+
+ 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)
+ }
+
+ fun build(): MaxGroupTieredConfig =
+ MaxGroupTieredConfig(additionalProperties.toImmutable())
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is MaxGroupTieredConfig && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "MaxGroupTieredConfig{additionalProperties=$additionalProperties}"
+ }
+
+ class ModelType
+ @JsonCreator
+ private constructor(
+ private val value: JsonField,
+ ) : Enum {
+
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val MAX_GROUP_TIERED = of("max_group_tiered")
+
+ @JvmStatic fun of(value: String) = ModelType(JsonField.of(value))
+ }
+
+ enum class Known {
+ MAX_GROUP_TIERED,
+ }
+
+ enum class Value {
+ MAX_GROUP_TIERED,
+ _UNKNOWN,
+ }
+
+ fun value(): Value =
+ when (this) {
+ MAX_GROUP_TIERED -> Value.MAX_GROUP_TIERED
+ else -> Value._UNKNOWN
+ }
+
+ fun known(): Known =
+ when (this) {
+ MAX_GROUP_TIERED -> Known.MAX_GROUP_TIERED
+ else -> throw OrbInvalidDataException("Unknown ModelType: $value")
+ }
+
+ fun asString(): String = _value().asStringOrThrow()
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is ModelType && value == other.value /* spotless:on */
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or months.
+ */
+ @NoAutoDetect
+ class BillingCycleConfiguration
+ @JsonCreator
+ private constructor(
+ @JsonProperty("duration")
+ @ExcludeMissing
+ private val duration: JsonField = JsonMissing.of(),
+ @JsonProperty("duration_unit")
+ @ExcludeMissing
+ private val durationUnit: JsonField = JsonMissing.of(),
+ @JsonAnySetter
+ private val additionalProperties: Map = immutableEmptyMap(),
+ ) {
+
+ /** The duration of the billing period. */
+ fun duration(): Long = duration.getRequired("duration")
+
+ /** The unit of billing period duration. */
+ fun durationUnit(): DurationUnit = durationUnit.getRequired("duration_unit")
+
+ /** The duration of the billing period. */
+ @JsonProperty("duration")
+ @ExcludeMissing
+ fun _duration(): JsonField = duration
+
+ /** The unit of billing period duration. */
+ @JsonProperty("duration_unit")
+ @ExcludeMissing
+ fun _durationUnit(): JsonField = durationUnit
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ private var validated: Boolean = false
+
+ fun validate(): BillingCycleConfiguration = apply {
+ if (validated) {
+ return@apply
+ }
+
+ duration()
+ durationUnit()
+ validated = true
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var duration: JsonField? = null
+ private var durationUnit: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(billingCycleConfiguration: BillingCycleConfiguration) =
+ apply {
+ duration = billingCycleConfiguration.duration
+ durationUnit = billingCycleConfiguration.durationUnit
+ additionalProperties =
+ billingCycleConfiguration.additionalProperties.toMutableMap()
+ }
+
+ /** The duration of the billing period. */
+ fun duration(duration: Long) = duration(JsonField.of(duration))
+
+ /** The duration of the billing period. */
+ fun duration(duration: JsonField) = apply { this.duration = duration }
+
+ /** The unit of billing period duration. */
+ fun durationUnit(durationUnit: DurationUnit) =
+ durationUnit(JsonField.of(durationUnit))
+
+ /** The unit of billing period duration. */
+ fun durationUnit(durationUnit: JsonField) = apply {
+ this.durationUnit = durationUnit
+ }
+
+ 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)
+ }
+
+ fun build(): BillingCycleConfiguration =
+ BillingCycleConfiguration(
+ checkRequired("duration", duration),
+ checkRequired("durationUnit", durationUnit),
+ additionalProperties.toImmutable(),
+ )
+ }
+
+ /** The unit of billing period duration. */
+ class DurationUnit
+ @JsonCreator
+ private constructor(
+ private val value: JsonField,
+ ) : Enum {
+
+ @com.fasterxml.jackson.annotation.JsonValue
+ fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val DAY = of("day")
+
+ @JvmField val MONTH = of("month")
+
+ @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value))
+ }
+
+ enum class Known {
+ DAY,
+ MONTH,
+ }
+
+ enum class Value {
+ DAY,
+ MONTH,
+ _UNKNOWN,
+ }
+
+ fun value(): Value =
+ when (this) {
+ DAY -> Value.DAY
+ MONTH -> Value.MONTH
+ else -> Value._UNKNOWN
+ }
+
+ fun known(): Known =
+ when (this) {
+ DAY -> Known.DAY
+ MONTH -> Known.MONTH
+ else -> throw OrbInvalidDataException("Unknown DurationUnit: $value")
+ }
+
+ fun asString(): String = _value().asStringOrThrow()
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is DurationUnit && value == other.value /* spotless:on */
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is BillingCycleConfiguration && duration == other.duration && durationUnit == other.durationUnit && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(duration, durationUnit, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "BillingCycleConfiguration{duration=$duration, durationUnit=$durationUnit, additionalProperties=$additionalProperties}"
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced. If
+ * unspecified, a single invoice is produced per billing cycle.
+ */
+ @NoAutoDetect
+ class InvoicingCycleConfiguration
+ @JsonCreator
+ private constructor(
+ @JsonProperty("duration")
+ @ExcludeMissing
+ private val duration: JsonField = JsonMissing.of(),
+ @JsonProperty("duration_unit")
+ @ExcludeMissing
+ private val durationUnit: JsonField = JsonMissing.of(),
+ @JsonAnySetter
+ private val additionalProperties: Map = immutableEmptyMap(),
+ ) {
+
+ /** The duration of the billing period. */
+ fun duration(): Long = duration.getRequired("duration")
+
+ /** The unit of billing period duration. */
+ fun durationUnit(): DurationUnit = durationUnit.getRequired("duration_unit")
+
+ /** The duration of the billing period. */
+ @JsonProperty("duration")
+ @ExcludeMissing
+ fun _duration(): JsonField = duration
+
+ /** The unit of billing period duration. */
+ @JsonProperty("duration_unit")
+ @ExcludeMissing
+ fun _durationUnit(): JsonField = durationUnit
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ private var validated: Boolean = false
+
+ fun validate(): InvoicingCycleConfiguration = apply {
+ if (validated) {
+ return@apply
+ }
+
+ duration()
+ durationUnit()
+ validated = true
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var duration: JsonField? = null
+ private var durationUnit: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(invoicingCycleConfiguration: InvoicingCycleConfiguration) =
+ apply {
+ duration = invoicingCycleConfiguration.duration
+ durationUnit = invoicingCycleConfiguration.durationUnit
+ additionalProperties =
+ invoicingCycleConfiguration.additionalProperties.toMutableMap()
+ }
+
+ /** The duration of the billing period. */
+ fun duration(duration: Long) = duration(JsonField.of(duration))
+
+ /** The duration of the billing period. */
+ fun duration(duration: JsonField) = apply { this.duration = duration }
+
+ /** The unit of billing period duration. */
+ fun durationUnit(durationUnit: DurationUnit) =
+ durationUnit(JsonField.of(durationUnit))
+
+ /** The unit of billing period duration. */
+ fun durationUnit(durationUnit: JsonField) = apply {
+ this.durationUnit = durationUnit
+ }
+
+ 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)
+ }
+
+ fun build(): InvoicingCycleConfiguration =
+ InvoicingCycleConfiguration(
+ checkRequired("duration", duration),
+ checkRequired("durationUnit", durationUnit),
+ additionalProperties.toImmutable(),
+ )
+ }
+
+ /** The unit of billing period duration. */
+ class DurationUnit
+ @JsonCreator
+ private constructor(
+ private val value: JsonField,
+ ) : Enum {
+
+ @com.fasterxml.jackson.annotation.JsonValue
+ fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val DAY = of("day")
+
+ @JvmField val MONTH = of("month")
+
+ @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value))
+ }
+
+ enum class Known {
+ DAY,
+ MONTH,
+ }
+
+ enum class Value {
+ DAY,
+ MONTH,
+ _UNKNOWN,
+ }
+
+ fun value(): Value =
+ when (this) {
+ DAY -> Value.DAY
+ MONTH -> Value.MONTH
+ else -> Value._UNKNOWN
+ }
+
+ fun known(): Known =
+ when (this) {
+ DAY -> Known.DAY
+ MONTH -> Known.MONTH
+ else -> throw OrbInvalidDataException("Unknown DurationUnit: $value")
+ }
+
+ fun asString(): String = _value().asStringOrThrow()
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is DurationUnit && value == other.value /* spotless:on */
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is InvoicingCycleConfiguration && duration == other.duration && durationUnit == other.durationUnit && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(duration, durationUnit, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "InvoicingCycleConfiguration{duration=$duration, durationUnit=$durationUnit, additionalProperties=$additionalProperties}"
+ }
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed by
+ * setting the value to `null`, and the entire metadata mapping can be cleared by
+ * setting `metadata` to `null`.
+ */
+ @NoAutoDetect
+ class Metadata
+ @JsonCreator
+ private constructor(
+ @JsonAnySetter
+ private val additionalProperties: Map = immutableEmptyMap(),
+ ) {
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ private var validated: Boolean = false
+
+ fun validate(): Metadata = apply {
+ if (validated) {
+ return@apply
+ }
+
+ validated = true
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(metadata: Metadata) = apply {
+ additionalProperties = metadata.additionalProperties.toMutableMap()
+ }
+
+ 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)
+ }
+
+ fun build(): Metadata = Metadata(additionalProperties.toImmutable())
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() = "Metadata{additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is NewPlanMaxGroupTieredPrice && cadence == other.cadence && itemId == other.itemId && maxGroupTieredConfig == other.maxGroupTieredConfig && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && currency == other.currency && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(cadence, itemId, maxGroupTieredConfig, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, currency, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "NewPlanMaxGroupTieredPrice{cadence=$cadence, itemId=$itemId, maxGroupTieredConfig=$maxGroupTieredConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, currency=$currency, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}"
+ }
}
/**
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 7d4950d1..b919f6c7 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
@@ -71,6 +71,7 @@ private constructor(
private val matrixWithDisplayNamePrice: MatrixWithDisplayNamePrice? = null,
private val bulkWithProrationPrice: BulkWithProrationPrice? = null,
private val groupedTieredPackagePrice: GroupedTieredPackagePrice? = null,
+ private val maxGroupTieredPrice: MaxGroupTieredPrice? = null,
private val _json: JsonValue? = null,
) {
@@ -136,6 +137,9 @@ private constructor(
fun groupedTieredPackagePrice(): Optional =
Optional.ofNullable(groupedTieredPackagePrice)
+ fun maxGroupTieredPrice(): Optional =
+ Optional.ofNullable(maxGroupTieredPrice)
+
fun isUnitPrice(): Boolean = unitPrice != null
fun isPackagePrice(): Boolean = packagePrice != null
@@ -184,6 +188,8 @@ private constructor(
fun isGroupedTieredPackagePrice(): Boolean = groupedTieredPackagePrice != null
+ fun isMaxGroupTieredPrice(): Boolean = maxGroupTieredPrice != null
+
fun asUnitPrice(): UnitPrice = unitPrice.getOrThrow("unitPrice")
fun asPackagePrice(): PackagePrice = packagePrice.getOrThrow("packagePrice")
@@ -248,6 +254,9 @@ private constructor(
fun asGroupedTieredPackagePrice(): GroupedTieredPackagePrice =
groupedTieredPackagePrice.getOrThrow("groupedTieredPackagePrice")
+ fun asMaxGroupTieredPrice(): MaxGroupTieredPrice =
+ maxGroupTieredPrice.getOrThrow("maxGroupTieredPrice")
+
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T {
@@ -289,6 +298,7 @@ private constructor(
visitor.visitBulkWithProrationPrice(bulkWithProrationPrice)
groupedTieredPackagePrice != null ->
visitor.visitGroupedTieredPackagePrice(groupedTieredPackagePrice)
+ maxGroupTieredPrice != null -> visitor.visitMaxGroupTieredPrice(maxGroupTieredPrice)
else -> visitor.unknown(_json)
}
}
@@ -423,6 +433,10 @@ private constructor(
) {
groupedTieredPackagePrice.validate()
}
+
+ override fun visitMaxGroupTieredPrice(maxGroupTieredPrice: MaxGroupTieredPrice) {
+ maxGroupTieredPrice.validate()
+ }
}
)
validated = true
@@ -433,10 +447,10 @@ private constructor(
return true
}
- return /* spotless:off */ other is Price && unitPrice == other.unitPrice && packagePrice == other.packagePrice && matrixPrice == other.matrixPrice && tieredPrice == other.tieredPrice && tieredBpsPrice == other.tieredBpsPrice && bpsPrice == other.bpsPrice && bulkBpsPrice == other.bulkBpsPrice && bulkPrice == other.bulkPrice && thresholdTotalAmountPrice == other.thresholdTotalAmountPrice && tieredPackagePrice == other.tieredPackagePrice && groupedTieredPrice == other.groupedTieredPrice && tieredWithMinimumPrice == other.tieredWithMinimumPrice && tieredPackageWithMinimumPrice == other.tieredPackageWithMinimumPrice && packageWithAllocationPrice == other.packageWithAllocationPrice && unitWithPercentPrice == other.unitWithPercentPrice && matrixWithAllocationPrice == other.matrixWithAllocationPrice && tieredWithProrationPrice == other.tieredWithProrationPrice && unitWithProrationPrice == other.unitWithProrationPrice && groupedAllocationPrice == other.groupedAllocationPrice && groupedWithProratedMinimumPrice == other.groupedWithProratedMinimumPrice && groupedWithMeteredMinimumPrice == other.groupedWithMeteredMinimumPrice && matrixWithDisplayNamePrice == other.matrixWithDisplayNamePrice && bulkWithProrationPrice == other.bulkWithProrationPrice && groupedTieredPackagePrice == other.groupedTieredPackagePrice /* spotless:on */
+ return /* spotless:off */ other is Price && unitPrice == other.unitPrice && packagePrice == other.packagePrice && matrixPrice == other.matrixPrice && tieredPrice == other.tieredPrice && tieredBpsPrice == other.tieredBpsPrice && bpsPrice == other.bpsPrice && bulkBpsPrice == other.bulkBpsPrice && bulkPrice == other.bulkPrice && thresholdTotalAmountPrice == other.thresholdTotalAmountPrice && tieredPackagePrice == other.tieredPackagePrice && groupedTieredPrice == other.groupedTieredPrice && tieredWithMinimumPrice == other.tieredWithMinimumPrice && tieredPackageWithMinimumPrice == other.tieredPackageWithMinimumPrice && packageWithAllocationPrice == other.packageWithAllocationPrice && unitWithPercentPrice == other.unitWithPercentPrice && matrixWithAllocationPrice == other.matrixWithAllocationPrice && tieredWithProrationPrice == other.tieredWithProrationPrice && unitWithProrationPrice == other.unitWithProrationPrice && groupedAllocationPrice == other.groupedAllocationPrice && groupedWithProratedMinimumPrice == other.groupedWithProratedMinimumPrice && groupedWithMeteredMinimumPrice == other.groupedWithMeteredMinimumPrice && matrixWithDisplayNamePrice == other.matrixWithDisplayNamePrice && bulkWithProrationPrice == other.bulkWithProrationPrice && groupedTieredPackagePrice == other.groupedTieredPackagePrice && maxGroupTieredPrice == other.maxGroupTieredPrice /* spotless:on */
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(unitPrice, packagePrice, matrixPrice, tieredPrice, tieredBpsPrice, bpsPrice, bulkBpsPrice, bulkPrice, thresholdTotalAmountPrice, tieredPackagePrice, groupedTieredPrice, tieredWithMinimumPrice, tieredPackageWithMinimumPrice, packageWithAllocationPrice, unitWithPercentPrice, matrixWithAllocationPrice, tieredWithProrationPrice, unitWithProrationPrice, groupedAllocationPrice, groupedWithProratedMinimumPrice, groupedWithMeteredMinimumPrice, matrixWithDisplayNamePrice, bulkWithProrationPrice, groupedTieredPackagePrice) /* spotless:on */
+ override fun hashCode(): Int = /* spotless:off */ Objects.hash(unitPrice, packagePrice, matrixPrice, tieredPrice, tieredBpsPrice, bpsPrice, bulkBpsPrice, bulkPrice, thresholdTotalAmountPrice, tieredPackagePrice, groupedTieredPrice, tieredWithMinimumPrice, tieredPackageWithMinimumPrice, packageWithAllocationPrice, unitWithPercentPrice, matrixWithAllocationPrice, tieredWithProrationPrice, unitWithProrationPrice, groupedAllocationPrice, groupedWithProratedMinimumPrice, groupedWithMeteredMinimumPrice, matrixWithDisplayNamePrice, bulkWithProrationPrice, groupedTieredPackagePrice, maxGroupTieredPrice) /* spotless:on */
override fun toString(): String =
when {
@@ -477,6 +491,7 @@ private constructor(
"Price{bulkWithProrationPrice=$bulkWithProrationPrice}"
groupedTieredPackagePrice != null ->
"Price{groupedTieredPackagePrice=$groupedTieredPackagePrice}"
+ maxGroupTieredPrice != null -> "Price{maxGroupTieredPrice=$maxGroupTieredPrice}"
_json != null -> "Price{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Price")
}
@@ -569,6 +584,10 @@ private constructor(
@JvmStatic
fun ofGroupedTieredPackagePrice(groupedTieredPackagePrice: GroupedTieredPackagePrice) =
Price(groupedTieredPackagePrice = groupedTieredPackagePrice)
+
+ @JvmStatic
+ fun ofMaxGroupTieredPrice(maxGroupTieredPrice: MaxGroupTieredPrice) =
+ Price(maxGroupTieredPrice = maxGroupTieredPrice)
}
interface Visitor {
@@ -631,6 +650,8 @@ private constructor(
fun visitGroupedTieredPackagePrice(groupedTieredPackagePrice: GroupedTieredPackagePrice): T
+ fun visitMaxGroupTieredPrice(maxGroupTieredPrice: MaxGroupTieredPrice): T
+
fun unknown(json: JsonValue?): T {
throw OrbInvalidDataException("Unknown Price: $json")
}
@@ -805,6 +826,12 @@ private constructor(
return Price(groupedTieredPackagePrice = it, _json = json)
}
}
+ "max_group_tiered" -> {
+ tryDeserialize(node, jacksonTypeRef()) { it.validate() }
+ ?.let {
+ return Price(maxGroupTieredPrice = it, _json = json)
+ }
+ }
}
return Price(_json = json)
@@ -857,6 +884,8 @@ private constructor(
generator.writeObject(value.bulkWithProrationPrice)
value.groupedTieredPackagePrice != null ->
generator.writeObject(value.groupedTieredPackagePrice)
+ value.maxGroupTieredPrice != null ->
+ generator.writeObject(value.maxGroupTieredPrice)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Price")
}
@@ -33399,14 +33428,2072 @@ private constructor(
keys.forEach(::removeAdditionalProperty)
}
- fun build(): Minimum =
- Minimum(
- checkRequired("appliesToPriceIds", appliesToPriceIds).map {
- it.toImmutable()
- },
- checkRequired("minimumAmount", minimumAmount),
- additionalProperties.toImmutable(),
- )
+ fun build(): Minimum =
+ Minimum(
+ checkRequired("appliesToPriceIds", appliesToPriceIds).map {
+ it.toImmutable()
+ },
+ checkRequired("minimumAmount", minimumAmount),
+ additionalProperties.toImmutable(),
+ )
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is Minimum && appliesToPriceIds == other.appliesToPriceIds && minimumAmount == other.minimumAmount && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, minimumAmount, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Minimum{appliesToPriceIds=$appliesToPriceIds, minimumAmount=$minimumAmount, additionalProperties=$additionalProperties}"
+ }
+
+ class ModelType
+ @JsonCreator
+ private constructor(
+ private val value: JsonField,
+ ) : Enum {
+
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val MATRIX_WITH_ALLOCATION = of("matrix_with_allocation")
+
+ @JvmStatic fun of(value: String) = ModelType(JsonField.of(value))
+ }
+
+ enum class Known {
+ MATRIX_WITH_ALLOCATION,
+ }
+
+ enum class Value {
+ MATRIX_WITH_ALLOCATION,
+ _UNKNOWN,
+ }
+
+ fun value(): Value =
+ when (this) {
+ MATRIX_WITH_ALLOCATION -> Value.MATRIX_WITH_ALLOCATION
+ else -> Value._UNKNOWN
+ }
+
+ fun known(): Known =
+ when (this) {
+ MATRIX_WITH_ALLOCATION -> Known.MATRIX_WITH_ALLOCATION
+ else -> throw OrbInvalidDataException("Unknown ModelType: $value")
+ }
+
+ fun asString(): String = _value().asStringOrThrow()
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is ModelType && value == other.value /* spotless:on */
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ class PriceType
+ @JsonCreator
+ private constructor(
+ private val value: JsonField,
+ ) : Enum {
+
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val USAGE_PRICE = of("usage_price")
+
+ @JvmField val FIXED_PRICE = of("fixed_price")
+
+ @JvmStatic fun of(value: String) = PriceType(JsonField.of(value))
+ }
+
+ enum class Known {
+ USAGE_PRICE,
+ FIXED_PRICE,
+ }
+
+ enum class Value {
+ USAGE_PRICE,
+ FIXED_PRICE,
+ _UNKNOWN,
+ }
+
+ fun value(): Value =
+ when (this) {
+ USAGE_PRICE -> Value.USAGE_PRICE
+ FIXED_PRICE -> Value.FIXED_PRICE
+ else -> Value._UNKNOWN
+ }
+
+ fun known(): Known =
+ when (this) {
+ USAGE_PRICE -> Known.USAGE_PRICE
+ FIXED_PRICE -> Known.FIXED_PRICE
+ else -> throw OrbInvalidDataException("Unknown PriceType: $value")
+ }
+
+ fun asString(): String = _value().asStringOrThrow()
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is PriceType && value == other.value /* spotless:on */
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is MatrixWithAllocationPrice && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && matrixWithAllocationConfig == other.matrixWithAllocationConfig && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, matrixWithAllocationConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "MatrixWithAllocationPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, conversionRate=$conversionRate, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, matrixWithAllocationConfig=$matrixWithAllocationConfig, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}"
+ }
+
+ @NoAutoDetect
+ class TieredWithProrationPrice
+ @JsonCreator
+ private constructor(
+ @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(),
+ @JsonProperty("billable_metric")
+ @ExcludeMissing
+ private val billableMetric: JsonField = JsonMissing.of(),
+ @JsonProperty("billing_cycle_configuration")
+ @ExcludeMissing
+ private val billingCycleConfiguration: JsonField =
+ JsonMissing.of(),
+ @JsonProperty("cadence")
+ @ExcludeMissing
+ private val cadence: JsonField = JsonMissing.of(),
+ @JsonProperty("conversion_rate")
+ @ExcludeMissing
+ private val conversionRate: JsonField = JsonMissing.of(),
+ @JsonProperty("created_at")
+ @ExcludeMissing
+ private val createdAt: JsonField = JsonMissing.of(),
+ @JsonProperty("credit_allocation")
+ @ExcludeMissing
+ private val creditAllocation: JsonField = JsonMissing.of(),
+ @JsonProperty("currency")
+ @ExcludeMissing
+ private val currency: JsonField = JsonMissing.of(),
+ @JsonProperty("discount")
+ @ExcludeMissing
+ private val discount: JsonField = JsonMissing.of(),
+ @JsonProperty("external_price_id")
+ @ExcludeMissing
+ private val externalPriceId: JsonField = JsonMissing.of(),
+ @JsonProperty("fixed_price_quantity")
+ @ExcludeMissing
+ private val fixedPriceQuantity: JsonField = JsonMissing.of(),
+ @JsonProperty("invoicing_cycle_configuration")
+ @ExcludeMissing
+ private val invoicingCycleConfiguration: JsonField =
+ JsonMissing.of(),
+ @JsonProperty("item") @ExcludeMissing private val item: JsonField- = JsonMissing.of(),
+ @JsonProperty("maximum")
+ @ExcludeMissing
+ private val maximum: JsonField = JsonMissing.of(),
+ @JsonProperty("maximum_amount")
+ @ExcludeMissing
+ private val maximumAmount: JsonField = JsonMissing.of(),
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ private val metadata: JsonField = JsonMissing.of(),
+ @JsonProperty("minimum")
+ @ExcludeMissing
+ private val minimum: JsonField = JsonMissing.of(),
+ @JsonProperty("minimum_amount")
+ @ExcludeMissing
+ private val minimumAmount: JsonField = JsonMissing.of(),
+ @JsonProperty("model_type")
+ @ExcludeMissing
+ private val modelType: JsonField = JsonMissing.of(),
+ @JsonProperty("name")
+ @ExcludeMissing
+ private val name: JsonField = JsonMissing.of(),
+ @JsonProperty("plan_phase_order")
+ @ExcludeMissing
+ private val planPhaseOrder: JsonField = JsonMissing.of(),
+ @JsonProperty("price_type")
+ @ExcludeMissing
+ private val priceType: JsonField = JsonMissing.of(),
+ @JsonProperty("tiered_with_proration_config")
+ @ExcludeMissing
+ private val tieredWithProrationConfig: JsonField =
+ JsonMissing.of(),
+ @JsonAnySetter
+ private val additionalProperties: Map = immutableEmptyMap(),
+ ) {
+
+ fun id(): String = id.getRequired("id")
+
+ fun billableMetric(): Optional =
+ Optional.ofNullable(billableMetric.getNullable("billable_metric"))
+
+ fun billingCycleConfiguration(): BillingCycleConfiguration =
+ billingCycleConfiguration.getRequired("billing_cycle_configuration")
+
+ fun cadence(): Cadence = cadence.getRequired("cadence")
+
+ fun conversionRate(): Optional =
+ Optional.ofNullable(conversionRate.getNullable("conversion_rate"))
+
+ fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
+
+ fun creditAllocation(): Optional =
+ Optional.ofNullable(creditAllocation.getNullable("credit_allocation"))
+
+ fun currency(): String = currency.getRequired("currency")
+
+ fun discount(): Optional = Optional.ofNullable(discount.getNullable("discount"))
+
+ fun externalPriceId(): Optional =
+ Optional.ofNullable(externalPriceId.getNullable("external_price_id"))
+
+ fun fixedPriceQuantity(): Optional =
+ Optional.ofNullable(fixedPriceQuantity.getNullable("fixed_price_quantity"))
+
+ fun invoicingCycleConfiguration(): Optional =
+ Optional.ofNullable(
+ invoicingCycleConfiguration.getNullable("invoicing_cycle_configuration")
+ )
+
+ fun item(): Item = item.getRequired("item")
+
+ fun maximum(): Optional = Optional.ofNullable(maximum.getNullable("maximum"))
+
+ fun maximumAmount(): Optional =
+ Optional.ofNullable(maximumAmount.getNullable("maximum_amount"))
+
+ /**
+ * User specified key-value pairs for the resource. If not present, this defaults to an
+ * empty dictionary. Individual keys can be removed by setting the value to `null`, and the
+ * entire metadata mapping can be cleared by setting `metadata` to `null`.
+ */
+ fun metadata(): Metadata = metadata.getRequired("metadata")
+
+ fun minimum(): Optional = Optional.ofNullable(minimum.getNullable("minimum"))
+
+ fun minimumAmount(): Optional =
+ Optional.ofNullable(minimumAmount.getNullable("minimum_amount"))
+
+ fun modelType(): ModelType = modelType.getRequired("model_type")
+
+ fun name(): String = name.getRequired("name")
+
+ fun planPhaseOrder(): Optional =
+ Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order"))
+
+ fun priceType(): PriceType = priceType.getRequired("price_type")
+
+ fun tieredWithProrationConfig(): TieredWithProrationConfig =
+ tieredWithProrationConfig.getRequired("tiered_with_proration_config")
+
+ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
+
+ @JsonProperty("billable_metric")
+ @ExcludeMissing
+ fun _billableMetric(): JsonField = billableMetric
+
+ @JsonProperty("billing_cycle_configuration")
+ @ExcludeMissing
+ fun _billingCycleConfiguration(): JsonField =
+ billingCycleConfiguration
+
+ @JsonProperty("cadence") @ExcludeMissing fun _cadence(): JsonField = cadence
+
+ @JsonProperty("conversion_rate")
+ @ExcludeMissing
+ fun _conversionRate(): JsonField = conversionRate
+
+ @JsonProperty("created_at")
+ @ExcludeMissing
+ fun _createdAt(): JsonField = createdAt
+
+ @JsonProperty("credit_allocation")
+ @ExcludeMissing
+ fun _creditAllocation(): JsonField = creditAllocation
+
+ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency
+
+ @JsonProperty("discount") @ExcludeMissing fun _discount(): JsonField = discount
+
+ @JsonProperty("external_price_id")
+ @ExcludeMissing
+ fun _externalPriceId(): JsonField = externalPriceId
+
+ @JsonProperty("fixed_price_quantity")
+ @ExcludeMissing
+ fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity
+
+ @JsonProperty("invoicing_cycle_configuration")
+ @ExcludeMissing
+ fun _invoicingCycleConfiguration(): JsonField =
+ invoicingCycleConfiguration
+
+ @JsonProperty("item") @ExcludeMissing fun _item(): JsonField
- = item
+
+ @JsonProperty("maximum") @ExcludeMissing fun _maximum(): JsonField = maximum
+
+ @JsonProperty("maximum_amount")
+ @ExcludeMissing
+ fun _maximumAmount(): JsonField = maximumAmount
+
+ /**
+ * User specified key-value pairs for the resource. If not present, this defaults to an
+ * empty dictionary. Individual keys can be removed by setting the value to `null`, and the
+ * entire metadata mapping can be cleared by setting `metadata` to `null`.
+ */
+ @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField = metadata
+
+ @JsonProperty("minimum") @ExcludeMissing fun _minimum(): JsonField = minimum
+
+ @JsonProperty("minimum_amount")
+ @ExcludeMissing
+ fun _minimumAmount(): JsonField = minimumAmount
+
+ @JsonProperty("model_type")
+ @ExcludeMissing
+ fun _modelType(): JsonField = modelType
+
+ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
+
+ @JsonProperty("plan_phase_order")
+ @ExcludeMissing
+ fun _planPhaseOrder(): JsonField = planPhaseOrder
+
+ @JsonProperty("price_type")
+ @ExcludeMissing
+ fun _priceType(): JsonField = priceType
+
+ @JsonProperty("tiered_with_proration_config")
+ @ExcludeMissing
+ fun _tieredWithProrationConfig(): JsonField =
+ tieredWithProrationConfig
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ private var validated: Boolean = false
+
+ fun validate(): TieredWithProrationPrice = apply {
+ if (validated) {
+ return@apply
+ }
+
+ id()
+ billableMetric().ifPresent { it.validate() }
+ billingCycleConfiguration().validate()
+ cadence()
+ conversionRate()
+ createdAt()
+ creditAllocation().ifPresent { it.validate() }
+ currency()
+ discount().ifPresent { it.validate() }
+ externalPriceId()
+ fixedPriceQuantity()
+ invoicingCycleConfiguration().ifPresent { it.validate() }
+ item().validate()
+ maximum().ifPresent { it.validate() }
+ maximumAmount()
+ metadata().validate()
+ minimum().ifPresent { it.validate() }
+ minimumAmount()
+ modelType()
+ name()
+ planPhaseOrder()
+ priceType()
+ tieredWithProrationConfig().validate()
+ validated = true
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var id: JsonField? = null
+ private var billableMetric: JsonField? = null
+ private var billingCycleConfiguration: JsonField? = null
+ private var cadence: JsonField? = null
+ private var conversionRate: JsonField? = null
+ private var createdAt: JsonField? = null
+ private var creditAllocation: JsonField? = null
+ private var currency: JsonField? = null
+ private var discount: JsonField? = null
+ private var externalPriceId: JsonField? = null
+ private var fixedPriceQuantity: JsonField? = null
+ private var invoicingCycleConfiguration: JsonField? = null
+ private var item: JsonField
- ? = null
+ private var maximum: JsonField? = null
+ private var maximumAmount: JsonField? = null
+ private var metadata: JsonField? = null
+ private var minimum: JsonField? = null
+ private var minimumAmount: JsonField? = null
+ private var modelType: JsonField? = null
+ private var name: JsonField? = null
+ private var planPhaseOrder: JsonField? = null
+ private var priceType: JsonField? = null
+ private var tieredWithProrationConfig: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(tieredWithProrationPrice: TieredWithProrationPrice) = apply {
+ id = tieredWithProrationPrice.id
+ billableMetric = tieredWithProrationPrice.billableMetric
+ billingCycleConfiguration = tieredWithProrationPrice.billingCycleConfiguration
+ cadence = tieredWithProrationPrice.cadence
+ conversionRate = tieredWithProrationPrice.conversionRate
+ createdAt = tieredWithProrationPrice.createdAt
+ creditAllocation = tieredWithProrationPrice.creditAllocation
+ currency = tieredWithProrationPrice.currency
+ discount = tieredWithProrationPrice.discount
+ externalPriceId = tieredWithProrationPrice.externalPriceId
+ fixedPriceQuantity = tieredWithProrationPrice.fixedPriceQuantity
+ invoicingCycleConfiguration = tieredWithProrationPrice.invoicingCycleConfiguration
+ item = tieredWithProrationPrice.item
+ maximum = tieredWithProrationPrice.maximum
+ maximumAmount = tieredWithProrationPrice.maximumAmount
+ metadata = tieredWithProrationPrice.metadata
+ minimum = tieredWithProrationPrice.minimum
+ minimumAmount = tieredWithProrationPrice.minimumAmount
+ modelType = tieredWithProrationPrice.modelType
+ name = tieredWithProrationPrice.name
+ planPhaseOrder = tieredWithProrationPrice.planPhaseOrder
+ priceType = tieredWithProrationPrice.priceType
+ tieredWithProrationConfig = tieredWithProrationPrice.tieredWithProrationConfig
+ additionalProperties = tieredWithProrationPrice.additionalProperties.toMutableMap()
+ }
+
+ fun id(id: String) = id(JsonField.of(id))
+
+ fun id(id: JsonField) = apply { this.id = id }
+
+ fun billableMetric(billableMetric: BillableMetric?) =
+ billableMetric(JsonField.ofNullable(billableMetric))
+
+ fun billableMetric(billableMetric: Optional) =
+ billableMetric(billableMetric.orElse(null))
+
+ fun billableMetric(billableMetric: JsonField) = apply {
+ this.billableMetric = billableMetric
+ }
+
+ fun billingCycleConfiguration(billingCycleConfiguration: BillingCycleConfiguration) =
+ billingCycleConfiguration(JsonField.of(billingCycleConfiguration))
+
+ fun billingCycleConfiguration(
+ billingCycleConfiguration: JsonField
+ ) = apply { this.billingCycleConfiguration = billingCycleConfiguration }
+
+ fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence))
+
+ fun cadence(cadence: JsonField) = apply { this.cadence = cadence }
+
+ fun conversionRate(conversionRate: Double?) =
+ conversionRate(JsonField.ofNullable(conversionRate))
+
+ fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?)
+
+ @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228
+ fun conversionRate(conversionRate: Optional) =
+ conversionRate(conversionRate.orElse(null) as Double?)
+
+ fun conversionRate(conversionRate: JsonField) = apply {
+ this.conversionRate = conversionRate
+ }
+
+ fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
+
+ fun createdAt(createdAt: JsonField) = apply {
+ this.createdAt = createdAt
+ }
+
+ fun creditAllocation(creditAllocation: CreditAllocation?) =
+ creditAllocation(JsonField.ofNullable(creditAllocation))
+
+ fun creditAllocation(creditAllocation: Optional) =
+ creditAllocation(creditAllocation.orElse(null))
+
+ fun creditAllocation(creditAllocation: JsonField) = apply {
+ this.creditAllocation = creditAllocation
+ }
+
+ fun currency(currency: String) = currency(JsonField.of(currency))
+
+ fun currency(currency: JsonField) = apply { this.currency = currency }
+
+ fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount))
+
+ fun discount(discount: Optional) = discount(discount.orElse(null))
+
+ fun discount(discount: JsonField) = apply { this.discount = discount }
+
+ fun discount(percentageDiscount: PercentageDiscount) =
+ discount(Discount.ofPercentageDiscount(percentageDiscount))
+
+ fun discount(trialDiscount: TrialDiscount) =
+ discount(Discount.ofTrialDiscount(trialDiscount))
+
+ fun discount(usageDiscount: Discount.UsageDiscount) =
+ discount(Discount.ofUsageDiscount(usageDiscount))
+
+ fun discount(amountDiscount: AmountDiscount) =
+ discount(Discount.ofAmountDiscount(amountDiscount))
+
+ fun externalPriceId(externalPriceId: String?) =
+ externalPriceId(JsonField.ofNullable(externalPriceId))
+
+ fun externalPriceId(externalPriceId: Optional) =
+ externalPriceId(externalPriceId.orElse(null))
+
+ fun externalPriceId(externalPriceId: JsonField