@@ -29,7 +29,7 @@ import java.time.OffsetDateTime
2929import java.util.Collections
3030import java.util.Objects
3131import java.util.Optional
32- import kotlin.Unit as KUnit
32+ import kotlin.Unit
3333import kotlin.jvm.optionals.getOrNull
3434
3535/**
@@ -48,7 +48,7 @@ import kotlin.jvm.optionals.getOrNull
4848@JsonSerialize(using = Price.Serializer::class)
4949class Price
5050private constructor(
51- private val unit: Unit ? = null,
51+ private val unit: UnitPrice ? = null,
5252 private val tiered: Tiered? = null,
5353 private val bulk: Bulk? = null,
5454 private val bulkWithFilters: BulkWithFilters? = null,
@@ -81,7 +81,7 @@ private constructor(
8181 private val _json: JsonValue? = null,
8282) {
8383
84- fun unit(): Optional<Unit > = Optional.ofNullable(unit)
84+ fun unit(): Optional<UnitPrice > = Optional.ofNullable(unit)
8585
8686 fun tiered(): Optional<Tiered> = Optional.ofNullable(tiered)
8787
@@ -215,7 +215,7 @@ private constructor(
215215
216216 fun isEventOutput(): Boolean = eventOutput != null
217217
218- fun asUnit(): Unit = unit.getOrThrow("unit")
218+ fun asUnit(): UnitPrice = unit.getOrThrow("unit")
219219
220220 fun asTiered(): Tiered = tiered.getOrThrow("tiered")
221221
@@ -344,8 +344,8 @@ private constructor(
344344 }
345345
346346 accept(
347- object : Visitor<KUnit > {
348- override fun visitUnit(unit: Unit ) {
347+ object : Visitor<Unit > {
348+ override fun visitUnit(unit: UnitPrice ) {
349349 unit.validate()
350350 }
351351
@@ -506,7 +506,7 @@ private constructor(
506506 internal fun validity(): Int =
507507 accept(
508508 object : Visitor<Int> {
509- override fun visitUnit(unit: Unit ) = unit.validity()
509+ override fun visitUnit(unit: UnitPrice ) = unit.validity()
510510
511511 override fun visitTiered(tiered: Tiered) = tiered.validity()
512512
@@ -718,7 +718,7 @@ private constructor(
718718
719719 companion object {
720720
721- @JvmStatic fun ofUnit(unit: Unit ) = Price(unit = unit)
721+ @JvmStatic fun ofUnit(unit: UnitPrice ) = Price(unit = unit)
722722
723723 @JvmStatic fun ofTiered(tiered: Tiered) = Price(tiered = tiered)
724724
@@ -827,7 +827,7 @@ private constructor(
827827 /** An interface that defines how to map each variant of [Price] to a value of type [T]. */
828828 interface Visitor<out T> {
829829
830- fun visitUnit(unit: Unit ): T
830+ fun visitUnit(unit: UnitPrice ): T
831831
832832 fun visitTiered(tiered: Tiered): T
833833
@@ -917,7 +917,7 @@ private constructor(
917917
918918 when (modelType) {
919919 "unit" -> {
920- return tryDeserialize(node, jacksonTypeRef<Unit >())?.let {
920+ return tryDeserialize(node, jacksonTypeRef<UnitPrice >())?.let {
921921 Price(unit = it, _json = json)
922922 } ?: Price(_json = json)
923923 }
@@ -1130,7 +1130,7 @@ private constructor(
11301130 }
11311131 }
11321132
1133- class Unit
1133+ class UnitPrice
11341134 @JsonCreator(mode = JsonCreator.Mode.DISABLED)
11351135 private constructor(
11361136 private val id: JsonField<String>,
@@ -1735,7 +1735,7 @@ private constructor(
17351735 companion object {
17361736
17371737 /**
1738- * Returns a mutable builder for constructing an instance of [Unit ].
1738+ * Returns a mutable builder for constructing an instance of [UnitPrice ].
17391739 *
17401740 * The following fields are required:
17411741 * ```java
@@ -1770,7 +1770,7 @@ private constructor(
17701770 @JvmStatic fun builder() = Builder()
17711771 }
17721772
1773- /** A builder for [Unit ]. */
1773+ /** A builder for [UnitPrice ]. */
17741774 class Builder internal constructor() {
17751775
17761776 private var id: JsonField<String>? = null
@@ -1805,36 +1805,36 @@ private constructor(
18051805 private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
18061806
18071807 @JvmSynthetic
1808- internal fun from(unit: Unit ) = apply {
1809- id = unit .id
1810- billableMetric = unit .billableMetric
1811- billingCycleConfiguration = unit .billingCycleConfiguration
1812- billingMode = unit .billingMode
1813- cadence = unit .cadence
1814- compositePriceFilters = unit .compositePriceFilters.map { it.toMutableList() }
1815- conversionRate = unit .conversionRate
1816- conversionRateConfig = unit .conversionRateConfig
1817- createdAt = unit .createdAt
1818- creditAllocation = unit .creditAllocation
1819- currency = unit .currency
1820- discount = unit .discount
1821- externalPriceId = unit .externalPriceId
1822- fixedPriceQuantity = unit .fixedPriceQuantity
1823- invoicingCycleConfiguration = unit .invoicingCycleConfiguration
1824- item = unit .item
1825- maximum = unit .maximum
1826- maximumAmount = unit .maximumAmount
1827- metadata = unit .metadata
1828- minimum = unit .minimum
1829- minimumAmount = unit .minimumAmount
1830- modelType = unit .modelType
1831- name = unit .name
1832- planPhaseOrder = unit .planPhaseOrder
1833- priceType = unit .priceType
1834- replacesPriceId = unit .replacesPriceId
1835- unitConfig = unit .unitConfig
1836- dimensionalPriceConfiguration = unit .dimensionalPriceConfiguration
1837- additionalProperties = unit .additionalProperties.toMutableMap()
1808+ internal fun from(unitPrice: UnitPrice ) = apply {
1809+ id = unitPrice .id
1810+ billableMetric = unitPrice .billableMetric
1811+ billingCycleConfiguration = unitPrice .billingCycleConfiguration
1812+ billingMode = unitPrice .billingMode
1813+ cadence = unitPrice .cadence
1814+ compositePriceFilters = unitPrice .compositePriceFilters.map { it.toMutableList() }
1815+ conversionRate = unitPrice .conversionRate
1816+ conversionRateConfig = unitPrice .conversionRateConfig
1817+ createdAt = unitPrice .createdAt
1818+ creditAllocation = unitPrice .creditAllocation
1819+ currency = unitPrice .currency
1820+ discount = unitPrice .discount
1821+ externalPriceId = unitPrice .externalPriceId
1822+ fixedPriceQuantity = unitPrice .fixedPriceQuantity
1823+ invoicingCycleConfiguration = unitPrice .invoicingCycleConfiguration
1824+ item = unitPrice .item
1825+ maximum = unitPrice .maximum
1826+ maximumAmount = unitPrice .maximumAmount
1827+ metadata = unitPrice .metadata
1828+ minimum = unitPrice .minimum
1829+ minimumAmount = unitPrice .minimumAmount
1830+ modelType = unitPrice .modelType
1831+ name = unitPrice .name
1832+ planPhaseOrder = unitPrice .planPhaseOrder
1833+ priceType = unitPrice .priceType
1834+ replacesPriceId = unitPrice .replacesPriceId
1835+ unitConfig = unitPrice .unitConfig
1836+ dimensionalPriceConfiguration = unitPrice .dimensionalPriceConfiguration
1837+ additionalProperties = unitPrice .additionalProperties.toMutableMap()
18381838 }
18391839
18401840 fun id(id: String) = id(JsonField.of(id))
@@ -2482,7 +2482,7 @@ private constructor(
24822482 }
24832483
24842484 /**
2485- * Returns an immutable instance of [Unit ].
2485+ * Returns an immutable instance of [UnitPrice ].
24862486 *
24872487 * Further updates to this [Builder] will not mutate the returned instance.
24882488 *
@@ -2518,8 +2518,8 @@ private constructor(
25182518 *
25192519 * @throws IllegalStateException if any required field is unset.
25202520 */
2521- fun build(): Unit =
2522- Unit (
2521+ fun build(): UnitPrice =
2522+ UnitPrice (
25232523 checkRequired("id", id),
25242524 checkRequired("billableMetric", billableMetric),
25252525 checkRequired("billingCycleConfiguration", billingCycleConfiguration),
@@ -2556,7 +2556,7 @@ private constructor(
25562556
25572557 private var validated: Boolean = false
25582558
2559- fun validate(): Unit = apply {
2559+ fun validate(): UnitPrice = apply {
25602560 if (validated) {
25612561 return@apply
25622562 }
@@ -3716,7 +3716,7 @@ private constructor(
37163716 return true
37173717 }
37183718
3719- return other is Unit &&
3719+ return other is UnitPrice &&
37203720 id == other.id &&
37213721 billableMetric == other.billableMetric &&
37223722 billingCycleConfiguration == other.billingCycleConfiguration &&
@@ -3785,7 +3785,7 @@ private constructor(
37853785 override fun hashCode(): Int = hashCode
37863786
37873787 override fun toString() =
3788- "Unit {id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, replacesPriceId=$replacesPriceId, unitConfig=$unitConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}"
3788+ "UnitPrice {id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, billingMode=$billingMode, cadence=$cadence, compositePriceFilters=$compositePriceFilters, conversionRate=$conversionRate, conversionRateConfig=$conversionRateConfig, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, replacesPriceId=$replacesPriceId, unitConfig=$unitConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}"
37893789 }
37903790
37913791 class Tiered
0 commit comments