Skip to content

Commit 7738ed4

Browse files
fix(schema): Rename unit price type to avoid naming conflict
1 parent 8d0120a commit 7738ed4

40 files changed

+1307
-1076
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-f2b97a2c3e41f618dc8955ed325092320ff2170a7d7a9a26a31dc235c969b657.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-56d9f85a45eb4dfc07c2994617e1c98554d6dd748245fa4deeb706fe959c14bb.yml
33
openapi_spec_hash: 64548564dc8ce80ef3ad38fc8cb56b30
4-
config_hash: dd4343ce95871032ef6e0735a4ca038c
4+
config_hash: e6db17547fe854b1c240407cf4c6dc9e

orb-java-core/src/main/kotlin/com/withorb/api/models/ChangedSubscriptionResources.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5579,7 +5579,7 @@ private constructor(
55795579
fun price(price: JsonField<Price>) = apply { this.price = price }
55805580

55815581
/** Alias for calling [price] with `Price.ofUnit(unit)`. */
5582-
fun price(unit: Price.Unit) = price(Price.ofUnit(unit))
5582+
fun price(unit: Price.UnitPrice) = price(Price.ofUnit(unit))
55835583

55845584
/** Alias for calling [price] with `Price.ofTiered(tiered)`. */
55855585
fun price(tiered: Price.Tiered) = price(Price.ofTiered(tiered))

orb-java-core/src/main/kotlin/com/withorb/api/models/Invoice.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5055,7 +5055,7 @@ private constructor(
50555055
fun price(price: JsonField<Price>) = apply { this.price = price }
50565056

50575057
/** Alias for calling [price] with `Price.ofUnit(unit)`. */
5058-
fun price(unit: Price.Unit) = price(Price.ofUnit(unit))
5058+
fun price(unit: Price.UnitPrice) = price(Price.ofUnit(unit))
50595059

50605060
/** Alias for calling [price] with `Price.ofTiered(tiered)`. */
50615061
fun price(tiered: Price.Tiered) = price(Price.ofTiered(tiered))

orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5049,7 +5049,7 @@ private constructor(
50495049
fun price(price: JsonField<Price>) = apply { this.price = price }
50505050

50515051
/** Alias for calling [price] with `Price.ofUnit(unit)`. */
5052-
fun price(unit: Price.Unit) = price(Price.ofUnit(unit))
5052+
fun price(unit: Price.UnitPrice) = price(Price.ofUnit(unit))
50535053

50545054
/** Alias for calling [price] with `Price.ofTiered(tiered)`. */
50555055
fun price(tiered: Price.Tiered) = price(Price.ofTiered(tiered))

orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ private constructor(
985985
fun price(price: JsonField<Price>) = apply { this.price = price }
986986

987987
/** Alias for calling [price] with `Price.ofUnit(unit)`. */
988-
fun price(unit: Price.Unit) = price(Price.ofUnit(unit))
988+
fun price(unit: Price.UnitPrice) = price(Price.ofUnit(unit))
989989

990990
/** Alias for calling [price] with `Price.ofTiered(tiered)`. */
991991
fun price(tiered: Price.Tiered) = price(Price.ofTiered(tiered))

orb-java-core/src/main/kotlin/com/withorb/api/models/PerPriceCost.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ private constructor(
172172
fun price(price: JsonField<Price>) = apply { this.price = price }
173173

174174
/** Alias for calling [price] with `Price.ofUnit(unit)`. */
175-
fun price(unit: Price.Unit) = price(Price.ofUnit(unit))
175+
fun price(unit: Price.UnitPrice) = price(Price.ofUnit(unit))
176176

177177
/** Alias for calling [price] with `Price.ofTiered(tiered)`. */
178178
fun price(tiered: Price.Tiered) = price(Price.ofTiered(tiered))

orb-java-core/src/main/kotlin/com/withorb/api/models/Plan.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ private constructor(
10921092
}
10931093

10941094
/** Alias for calling [addPrice] with `Price.ofUnit(unit)`. */
1095-
fun addPrice(unit: Price.Unit) = addPrice(Price.ofUnit(unit))
1095+
fun addPrice(unit: Price.UnitPrice) = addPrice(Price.ofUnit(unit))
10961096

10971097
/** Alias for calling [addPrice] with `Price.ofTiered(tiered)`. */
10981098
fun addPrice(tiered: Price.Tiered) = addPrice(Price.ofTiered(tiered))

orb-java-core/src/main/kotlin/com/withorb/api/models/PlanVersion.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ private constructor(
309309
}
310310

311311
/** Alias for calling [addPrice] with `Price.ofUnit(unit)`. */
312-
fun addPrice(unit: Price.Unit) = addPrice(Price.ofUnit(unit))
312+
fun addPrice(unit: Price.UnitPrice) = addPrice(Price.ofUnit(unit))
313313

314314
/** Alias for calling [addPrice] with `Price.ofTiered(tiered)`. */
315315
fun addPrice(tiered: Price.Tiered) = addPrice(Price.ofTiered(tiered))

orb-java-core/src/main/kotlin/com/withorb/api/models/Price.kt

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import java.time.OffsetDateTime
2929
import java.util.Collections
3030
import java.util.Objects
3131
import java.util.Optional
32-
import kotlin.Unit as KUnit
32+
import kotlin.Unit
3333
import kotlin.jvm.optionals.getOrNull
3434

3535
/**
@@ -48,7 +48,7 @@ import kotlin.jvm.optionals.getOrNull
4848
@JsonSerialize(using = Price.Serializer::class)
4949
class Price
5050
private 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

orb-java-core/src/main/kotlin/com/withorb/api/models/PriceInterval.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ private constructor(
552552
fun price(price: JsonField<Price>) = apply { this.price = price }
553553

554554
/** Alias for calling [price] with `Price.ofUnit(unit)`. */
555-
fun price(unit: Price.Unit) = price(Price.ofUnit(unit))
555+
fun price(unit: Price.UnitPrice) = price(Price.ofUnit(unit))
556556

557557
/** Alias for calling [price] with `Price.ofTiered(tiered)`. */
558558
fun price(tiered: Price.Tiered) = price(Price.ofTiered(tiered))

0 commit comments

Comments
 (0)