diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6538ca91..6d78745c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.8.0" + ".": "0.9.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 49b2f4a1..7d050298 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-40a4e23dd482299a046fb62fd2b5a1e03d455156cb8cd4573e92e4132d74b243.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-14d1c1e4560c65c7c62f23343268ece4476ae079cd01ba2e6b924efde5f97c3e.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bddb226..107d24da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.9.0 (2024-11-26) + +Full Changelog: [v0.8.0...v0.9.0](https://github.com/orbcorp/orb-java/compare/v0.8.0...v0.9.0) + +### Features + +* **api:** api update ([#131](https://github.com/orbcorp/orb-java/issues/131)) ([8ef1405](https://github.com/orbcorp/orb-java/commit/8ef140591b579e8bdec3ecdf25008b7995d5f3e0)) + ## 0.8.0 (2024-11-25) Full Changelog: [v0.7.0...v0.8.0](https://github.com/orbcorp/orb-java/compare/v0.7.0...v0.8.0) diff --git a/README.md b/README.md index 78f853ab..3bfa76d6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.withorb.api/orb-java)](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.8.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.withorb.api/orb-java)](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.9.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.8.0") +implementation("com.withorb.api:orb-java:0.9.0") ``` #### Maven @@ -34,7 +34,7 @@ implementation("com.withorb.api:orb-java:0.8.0") com.withorb.api orb-java - 0.8.0 + 0.9.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index f9036d28..aeb5f91c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { allprojects { group = "com.withorb.api" - version = "0.8.0" // x-release-please-version + version = "0.9.0" // x-release-please-version } 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 1f5b3121..23d50530 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 @@ -6,18 +6,28 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.core.JsonGenerator +import com.fasterxml.jackson.core.ObjectCodec +import com.fasterxml.jackson.databind.JsonNode +import com.fasterxml.jackson.databind.SerializerProvider import com.fasterxml.jackson.databind.annotation.JsonDeserialize +import com.fasterxml.jackson.databind.annotation.JsonSerialize +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.withorb.api.core.BaseDeserializer +import com.withorb.api.core.BaseSerializer import com.withorb.api.core.Enum import com.withorb.api.core.ExcludeMissing import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.getOrThrow import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * The [Plan](../guides/core-concepts.mdx#plan-and-price) resource represents a plan that can be @@ -51,6 +61,7 @@ private constructor( private val netTerms: JsonField, private val defaultInvoiceMemo: JsonField, private val prices: JsonField>, + private val adjustments: JsonField>, private val additionalProperties: Map, ) { @@ -139,6 +150,12 @@ private constructor( */ fun prices(): List = prices.getRequired("prices") + /** + * Adjustments for this plan. If the plan has phases, this includes adjustments across all + * phases of the plan. + */ + fun adjustments(): List = adjustments.getRequired("adjustments") + /** * 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 @@ -219,6 +236,12 @@ private constructor( */ @JsonProperty("prices") @ExcludeMissing fun _prices() = prices + /** + * Adjustments for this plan. If the plan has phases, this includes adjustments across all + * phases of the plan. + */ + @JsonProperty("adjustments") @ExcludeMissing fun _adjustments() = adjustments + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -248,6 +271,7 @@ private constructor( netTerms() defaultInvoiceMemo() prices() + adjustments() validated = true } } @@ -284,6 +308,7 @@ private constructor( private var netTerms: JsonField = JsonMissing.of() private var defaultInvoiceMemo: JsonField = JsonMissing.of() private var prices: JsonField> = JsonMissing.of() + private var adjustments: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -311,6 +336,7 @@ private constructor( this.netTerms = plan.netTerms this.defaultInvoiceMemo = plan.defaultInvoiceMemo this.prices = plan.prices + this.adjustments = plan.adjustments additionalProperties(plan.additionalProperties) } @@ -536,6 +562,22 @@ private constructor( @ExcludeMissing fun prices(prices: JsonField>) = apply { this.prices = prices } + /** + * Adjustments for this plan. If the plan has phases, this includes adjustments across all + * phases of the plan. + */ + fun adjustments(adjustments: List) = adjustments(JsonField.of(adjustments)) + + /** + * Adjustments for this plan. If the plan has phases, this includes adjustments across all + * phases of the plan. + */ + @JsonProperty("adjustments") + @ExcludeMissing + fun adjustments(adjustments: JsonField>) = apply { + this.adjustments = adjustments + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -575,10 +617,1731 @@ private constructor( netTerms, defaultInvoiceMemo, prices.map { it.toImmutable() }, + adjustments.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } + @JsonDeserialize(using = Adjustment.Deserializer::class) + @JsonSerialize(using = Adjustment.Serializer::class) + class Adjustment + private constructor( + private val amountDiscountAdjustment: AmountDiscountAdjustment? = null, + private val percentageDiscountAdjustment: PercentageDiscountAdjustment? = null, + private val usageDiscountAdjustment: UsageDiscountAdjustment? = null, + private val minimumAdjustment: MinimumAdjustment? = null, + private val maximumAdjustment: MaximumAdjustment? = null, + private val _json: JsonValue? = null, + ) { + + private var validated: Boolean = false + + fun amountDiscountAdjustment(): Optional = + Optional.ofNullable(amountDiscountAdjustment) + + fun percentageDiscountAdjustment(): Optional = + Optional.ofNullable(percentageDiscountAdjustment) + + fun usageDiscountAdjustment(): Optional = + Optional.ofNullable(usageDiscountAdjustment) + + fun minimumAdjustment(): Optional = + Optional.ofNullable(minimumAdjustment) + + fun maximumAdjustment(): Optional = + Optional.ofNullable(maximumAdjustment) + + fun isAmountDiscountAdjustment(): Boolean = amountDiscountAdjustment != null + + fun isPercentageDiscountAdjustment(): Boolean = percentageDiscountAdjustment != null + + fun isUsageDiscountAdjustment(): Boolean = usageDiscountAdjustment != null + + fun isMinimumAdjustment(): Boolean = minimumAdjustment != null + + fun isMaximumAdjustment(): Boolean = maximumAdjustment != null + + fun asAmountDiscountAdjustment(): AmountDiscountAdjustment = + amountDiscountAdjustment.getOrThrow("amountDiscountAdjustment") + + fun asPercentageDiscountAdjustment(): PercentageDiscountAdjustment = + percentageDiscountAdjustment.getOrThrow("percentageDiscountAdjustment") + + fun asUsageDiscountAdjustment(): UsageDiscountAdjustment = + usageDiscountAdjustment.getOrThrow("usageDiscountAdjustment") + + fun asMinimumAdjustment(): MinimumAdjustment = + minimumAdjustment.getOrThrow("minimumAdjustment") + + fun asMaximumAdjustment(): MaximumAdjustment = + maximumAdjustment.getOrThrow("maximumAdjustment") + + fun _json(): Optional = Optional.ofNullable(_json) + + fun accept(visitor: Visitor): T { + return when { + amountDiscountAdjustment != null -> + visitor.visitAmountDiscountAdjustment(amountDiscountAdjustment) + percentageDiscountAdjustment != null -> + visitor.visitPercentageDiscountAdjustment(percentageDiscountAdjustment) + usageDiscountAdjustment != null -> + visitor.visitUsageDiscountAdjustment(usageDiscountAdjustment) + minimumAdjustment != null -> visitor.visitMinimumAdjustment(minimumAdjustment) + maximumAdjustment != null -> visitor.visitMaximumAdjustment(maximumAdjustment) + else -> visitor.unknown(_json) + } + } + + fun validate(): Adjustment = apply { + if (!validated) { + if ( + amountDiscountAdjustment == null && + percentageDiscountAdjustment == null && + usageDiscountAdjustment == null && + minimumAdjustment == null && + maximumAdjustment == null + ) { + throw OrbInvalidDataException("Unknown Adjustment: $_json") + } + amountDiscountAdjustment?.validate() + percentageDiscountAdjustment?.validate() + usageDiscountAdjustment?.validate() + minimumAdjustment?.validate() + maximumAdjustment?.validate() + validated = true + } + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Adjustment && amountDiscountAdjustment == other.amountDiscountAdjustment && percentageDiscountAdjustment == other.percentageDiscountAdjustment && usageDiscountAdjustment == other.usageDiscountAdjustment && minimumAdjustment == other.minimumAdjustment && maximumAdjustment == other.maximumAdjustment /* spotless:on */ + } + + override fun hashCode(): Int = /* spotless:off */ Objects.hash(amountDiscountAdjustment, percentageDiscountAdjustment, usageDiscountAdjustment, minimumAdjustment, maximumAdjustment) /* spotless:on */ + + override fun toString(): String = + when { + amountDiscountAdjustment != null -> + "Adjustment{amountDiscountAdjustment=$amountDiscountAdjustment}" + percentageDiscountAdjustment != null -> + "Adjustment{percentageDiscountAdjustment=$percentageDiscountAdjustment}" + usageDiscountAdjustment != null -> + "Adjustment{usageDiscountAdjustment=$usageDiscountAdjustment}" + minimumAdjustment != null -> "Adjustment{minimumAdjustment=$minimumAdjustment}" + maximumAdjustment != null -> "Adjustment{maximumAdjustment=$maximumAdjustment}" + _json != null -> "Adjustment{_unknown=$_json}" + else -> throw IllegalStateException("Invalid Adjustment") + } + + companion object { + + @JvmStatic + fun ofAmountDiscountAdjustment(amountDiscountAdjustment: AmountDiscountAdjustment) = + Adjustment(amountDiscountAdjustment = amountDiscountAdjustment) + + @JvmStatic + fun ofPercentageDiscountAdjustment( + percentageDiscountAdjustment: PercentageDiscountAdjustment + ) = Adjustment(percentageDiscountAdjustment = percentageDiscountAdjustment) + + @JvmStatic + fun ofUsageDiscountAdjustment(usageDiscountAdjustment: UsageDiscountAdjustment) = + Adjustment(usageDiscountAdjustment = usageDiscountAdjustment) + + @JvmStatic + fun ofMinimumAdjustment(minimumAdjustment: MinimumAdjustment) = + Adjustment(minimumAdjustment = minimumAdjustment) + + @JvmStatic + fun ofMaximumAdjustment(maximumAdjustment: MaximumAdjustment) = + Adjustment(maximumAdjustment = maximumAdjustment) + } + + interface Visitor { + + fun visitAmountDiscountAdjustment(amountDiscountAdjustment: AmountDiscountAdjustment): T + + fun visitPercentageDiscountAdjustment( + percentageDiscountAdjustment: PercentageDiscountAdjustment + ): T + + fun visitUsageDiscountAdjustment(usageDiscountAdjustment: UsageDiscountAdjustment): T + + fun visitMinimumAdjustment(minimumAdjustment: MinimumAdjustment): T + + fun visitMaximumAdjustment(maximumAdjustment: MaximumAdjustment): T + + fun unknown(json: JsonValue?): T { + throw OrbInvalidDataException("Unknown Adjustment: $json") + } + } + + class Deserializer : BaseDeserializer(Adjustment::class) { + + override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { + val json = JsonValue.fromJsonNode(node) + val adjustmentType = + json.asObject().getOrNull()?.get("adjustment_type")?.asString()?.getOrNull() + + when (adjustmentType) { + "amount_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(amountDiscountAdjustment = it, _json = json) + } + } + "percentage_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(percentageDiscountAdjustment = it, _json = json) + } + } + "usage_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(usageDiscountAdjustment = it, _json = json) + } + } + "minimum" -> { + tryDeserialize(node, jacksonTypeRef()) { it.validate() } + ?.let { + return Adjustment(minimumAdjustment = it, _json = json) + } + } + "maximum" -> { + tryDeserialize(node, jacksonTypeRef()) { it.validate() } + ?.let { + return Adjustment(maximumAdjustment = it, _json = json) + } + } + } + + return Adjustment(_json = json) + } + } + + class Serializer : BaseSerializer(Adjustment::class) { + + override fun serialize( + value: Adjustment, + generator: JsonGenerator, + provider: SerializerProvider + ) { + when { + value.amountDiscountAdjustment != null -> + generator.writeObject(value.amountDiscountAdjustment) + value.percentageDiscountAdjustment != null -> + generator.writeObject(value.percentageDiscountAdjustment) + value.usageDiscountAdjustment != null -> + generator.writeObject(value.usageDiscountAdjustment) + value.minimumAdjustment != null -> + generator.writeObject(value.minimumAdjustment) + value.maximumAdjustment != null -> + generator.writeObject(value.maximumAdjustment) + value._json != null -> generator.writeObject(value._json) + else -> throw IllegalStateException("Invalid Adjustment") + } + } + } + + @JsonDeserialize(builder = AmountDiscountAdjustment.Builder::class) + @NoAutoDetect + class AmountDiscountAdjustment + private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, + private val appliesToPriceIds: JsonField>, + private val reason: JsonField, + private val adjustmentType: JsonField, + private val amountDiscount: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") @ExcludeMissing fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") @ExcludeMissing fun _planPhaseOrder() = planPhaseOrder + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds() = appliesToPriceIds + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason() = reason + + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + @JsonProperty("amount_discount") @ExcludeMissing fun _amountDiscount() = amountDiscount + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): AmountDiscountAdjustment = apply { + if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() + appliesToPriceIds() + reason() + adjustmentType() + amountDiscount() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() + private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var reason: JsonField = JsonMissing.of() + private var adjustmentType: JsonField = JsonMissing.of() + private var amountDiscount: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + this.id = amountDiscountAdjustment.id + this.isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = amountDiscountAdjustment.planPhaseOrder + this.appliesToPriceIds = amountDiscountAdjustment.appliesToPriceIds + this.reason = amountDiscountAdjustment.reason + this.adjustmentType = amountDiscountAdjustment.adjustmentType + this.amountDiscount = amountDiscountAdjustment.amountDiscount + additionalProperties(amountDiscountAdjustment.additionalProperties) + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds + } + + /** The reason for the adjustment. */ + fun reason(reason: String) = reason(JsonField.of(reason)) + + /** The reason for the adjustment. */ + @JsonProperty("reason") + @ExcludeMissing + fun reason(reason: JsonField) = apply { this.reason = reason } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + fun amountDiscount(amountDiscount: String) = + amountDiscount(JsonField.of(amountDiscount)) + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + @JsonProperty("amount_discount") + @ExcludeMissing + fun amountDiscount(amountDiscount: JsonField) = apply { + this.amountDiscount = amountDiscount + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun build(): AmountDiscountAdjustment = + AmountDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, + appliesToPriceIds.map { it.toImmutable() }, + reason, + adjustmentType, + amountDiscount, + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField val AMOUNT_DISCOUNT = AdjustmentType(JsonField.of("amount_discount")) + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + enum class Known { + AMOUNT_DISCOUNT, + } + + enum class Value { + AMOUNT_DISCOUNT, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AmountDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AmountDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + } + + @JsonDeserialize(builder = PercentageDiscountAdjustment.Builder::class) + @NoAutoDetect + class PercentageDiscountAdjustment + private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, + private val appliesToPriceIds: JsonField>, + private val reason: JsonField, + private val adjustmentType: JsonField, + private val percentageDiscount: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** + * The percentage (as a value between 0 and 1) by which to discount the price intervals + * this adjustment applies to in a given billing period. + */ + fun percentageDiscount(): Double = percentageDiscount.getRequired("percentage_discount") + + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") @ExcludeMissing fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") @ExcludeMissing fun _planPhaseOrder() = planPhaseOrder + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds() = appliesToPriceIds + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason() = reason + + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType + + /** + * The percentage (as a value between 0 and 1) by which to discount the price intervals + * this adjustment applies to in a given billing period. + */ + @JsonProperty("percentage_discount") + @ExcludeMissing + fun _percentageDiscount() = percentageDiscount + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): PercentageDiscountAdjustment = apply { + if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() + appliesToPriceIds() + reason() + adjustmentType() + percentageDiscount() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() + private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var reason: JsonField = JsonMissing.of() + private var adjustmentType: JsonField = JsonMissing.of() + private var percentageDiscount: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = + apply { + this.id = percentageDiscountAdjustment.id + this.isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder + this.appliesToPriceIds = percentageDiscountAdjustment.appliesToPriceIds + this.reason = percentageDiscountAdjustment.reason + this.adjustmentType = percentageDiscountAdjustment.adjustmentType + this.percentageDiscount = percentageDiscountAdjustment.percentageDiscount + additionalProperties(percentageDiscountAdjustment.additionalProperties) + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds + } + + /** The reason for the adjustment. */ + fun reason(reason: String) = reason(JsonField.of(reason)) + + /** The reason for the adjustment. */ + @JsonProperty("reason") + @ExcludeMissing + fun reason(reason: JsonField) = apply { this.reason = reason } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + fun percentageDiscount(percentageDiscount: Double) = + percentageDiscount(JsonField.of(percentageDiscount)) + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + @JsonProperty("percentage_discount") + @ExcludeMissing + fun percentageDiscount(percentageDiscount: JsonField) = apply { + this.percentageDiscount = percentageDiscount + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun build(): PercentageDiscountAdjustment = + PercentageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, + appliesToPriceIds.map { it.toImmutable() }, + reason, + adjustmentType, + percentageDiscount, + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField + val PERCENTAGE_DISCOUNT = AdjustmentType(JsonField.of("percentage_discount")) + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + enum class Known { + PERCENTAGE_DISCOUNT, + } + + enum class Value { + PERCENTAGE_DISCOUNT, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PercentageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "PercentageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + } + + @JsonDeserialize(builder = UsageDiscountAdjustment.Builder::class) + @NoAutoDetect + class UsageDiscountAdjustment + private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, + private val appliesToPriceIds: JsonField>, + private val reason: JsonField, + private val adjustmentType: JsonField, + private val usageDiscount: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** + * The number of usage units by which to discount the price this adjustment applies to + * in a given billing period. + */ + fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") @ExcludeMissing fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") @ExcludeMissing fun _planPhaseOrder() = planPhaseOrder + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds() = appliesToPriceIds + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason() = reason + + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType + + /** + * The number of usage units by which to discount the price this adjustment applies to + * in a given billing period. + */ + @JsonProperty("usage_discount") @ExcludeMissing fun _usageDiscount() = usageDiscount + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): UsageDiscountAdjustment = apply { + if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() + appliesToPriceIds() + reason() + adjustmentType() + usageDiscount() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() + private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var reason: JsonField = JsonMissing.of() + private var adjustmentType: JsonField = JsonMissing.of() + private var usageDiscount: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + this.id = usageDiscountAdjustment.id + this.isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = usageDiscountAdjustment.planPhaseOrder + this.appliesToPriceIds = usageDiscountAdjustment.appliesToPriceIds + this.reason = usageDiscountAdjustment.reason + this.adjustmentType = usageDiscountAdjustment.adjustmentType + this.usageDiscount = usageDiscountAdjustment.usageDiscount + additionalProperties(usageDiscountAdjustment.additionalProperties) + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds + } + + /** The reason for the adjustment. */ + fun reason(reason: String) = reason(JsonField.of(reason)) + + /** The reason for the adjustment. */ + @JsonProperty("reason") + @ExcludeMissing + fun reason(reason: JsonField) = apply { this.reason = reason } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + fun usageDiscount(usageDiscount: Double) = + usageDiscount(JsonField.of(usageDiscount)) + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + @JsonProperty("usage_discount") + @ExcludeMissing + fun usageDiscount(usageDiscount: JsonField) = apply { + this.usageDiscount = usageDiscount + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun build(): UsageDiscountAdjustment = + UsageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, + appliesToPriceIds.map { it.toImmutable() }, + reason, + adjustmentType, + usageDiscount, + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField val USAGE_DISCOUNT = AdjustmentType(JsonField.of("usage_discount")) + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + enum class Known { + USAGE_DISCOUNT, + } + + enum class Value { + USAGE_DISCOUNT, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + USAGE_DISCOUNT -> Value.USAGE_DISCOUNT + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + USAGE_DISCOUNT -> Known.USAGE_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is UsageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "UsageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + } + + @JsonDeserialize(builder = MinimumAdjustment.Builder::class) + @NoAutoDetect + class MinimumAdjustment + private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, + private val appliesToPriceIds: JsonField>, + private val reason: JsonField, + private val adjustmentType: JsonField, + private val minimumAmount: JsonField, + private val itemId: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** + * The minimum amount to charge in a given billing period for the prices this adjustment + * applies to. + */ + fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount") + + /** The item ID that revenue from this minimum will be attributed to. */ + fun itemId(): String = itemId.getRequired("item_id") + + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") @ExcludeMissing fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") @ExcludeMissing fun _planPhaseOrder() = planPhaseOrder + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds() = appliesToPriceIds + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason() = reason + + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType + + /** + * The minimum amount to charge in a given billing period for the prices this adjustment + * applies to. + */ + @JsonProperty("minimum_amount") @ExcludeMissing fun _minimumAmount() = minimumAmount + + /** The item ID that revenue from this minimum will be attributed to. */ + @JsonProperty("item_id") @ExcludeMissing fun _itemId() = itemId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): MinimumAdjustment = apply { + if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() + appliesToPriceIds() + reason() + adjustmentType() + minimumAmount() + itemId() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() + private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var reason: JsonField = JsonMissing.of() + private var adjustmentType: JsonField = JsonMissing.of() + private var minimumAmount: JsonField = JsonMissing.of() + private var itemId: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + this.id = minimumAdjustment.id + this.isInvoiceLevel = minimumAdjustment.isInvoiceLevel + this.planPhaseOrder = minimumAdjustment.planPhaseOrder + this.appliesToPriceIds = minimumAdjustment.appliesToPriceIds + this.reason = minimumAdjustment.reason + this.adjustmentType = minimumAdjustment.adjustmentType + this.minimumAmount = minimumAdjustment.minimumAmount + this.itemId = minimumAdjustment.itemId + additionalProperties(minimumAdjustment.additionalProperties) + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds + } + + /** The reason for the adjustment. */ + fun reason(reason: String) = reason(JsonField.of(reason)) + + /** The reason for the adjustment. */ + @JsonProperty("reason") + @ExcludeMissing + fun reason(reason: JsonField) = apply { this.reason = reason } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun minimumAmount(minimumAmount: String) = + minimumAmount(JsonField.of(minimumAmount)) + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + @JsonProperty("minimum_amount") + @ExcludeMissing + fun minimumAmount(minimumAmount: JsonField) = apply { + this.minimumAmount = minimumAmount + } + + /** The item ID that revenue from this minimum will be attributed to. */ + fun itemId(itemId: String) = itemId(JsonField.of(itemId)) + + /** The item ID that revenue from this minimum will be attributed to. */ + @JsonProperty("item_id") + @ExcludeMissing + fun itemId(itemId: JsonField) = apply { this.itemId = itemId } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun build(): MinimumAdjustment = + MinimumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, + appliesToPriceIds.map { it.toImmutable() }, + reason, + adjustmentType, + minimumAmount, + itemId, + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField val MINIMUM = AdjustmentType(JsonField.of("minimum")) + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + enum class Known { + MINIMUM, + } + + enum class Value { + MINIMUM, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + MINIMUM -> Value.MINIMUM + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + MINIMUM -> Known.MINIMUM + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is MinimumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MinimumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + } + + @JsonDeserialize(builder = MaximumAdjustment.Builder::class) + @NoAutoDetect + class MaximumAdjustment + private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, + private val appliesToPriceIds: JsonField>, + private val reason: JsonField, + private val adjustmentType: JsonField, + private val maximumAmount: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** + * The maximum amount to charge in a given billing period for the prices this adjustment + * applies to. + */ + fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") @ExcludeMissing fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") @ExcludeMissing fun _planPhaseOrder() = planPhaseOrder + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds() = appliesToPriceIds + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason() = reason + + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType + + /** + * The maximum amount to charge in a given billing period for the prices this adjustment + * applies to. + */ + @JsonProperty("maximum_amount") @ExcludeMissing fun _maximumAmount() = maximumAmount + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): MaximumAdjustment = apply { + if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() + appliesToPriceIds() + reason() + adjustmentType() + maximumAmount() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() + private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var reason: JsonField = JsonMissing.of() + private var adjustmentType: JsonField = JsonMissing.of() + private var maximumAmount: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + this.id = maximumAdjustment.id + this.isInvoiceLevel = maximumAdjustment.isInvoiceLevel + this.planPhaseOrder = maximumAdjustment.planPhaseOrder + this.appliesToPriceIds = maximumAdjustment.appliesToPriceIds + this.reason = maximumAdjustment.reason + this.adjustmentType = maximumAdjustment.adjustmentType + this.maximumAmount = maximumAdjustment.maximumAmount + additionalProperties(maximumAdjustment.additionalProperties) + } + + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds + } + + /** The reason for the adjustment. */ + fun reason(reason: String) = reason(JsonField.of(reason)) + + /** The reason for the adjustment. */ + @JsonProperty("reason") + @ExcludeMissing + fun reason(reason: JsonField) = apply { this.reason = reason } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun maximumAmount(maximumAmount: String) = + maximumAmount(JsonField.of(maximumAmount)) + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + @JsonProperty("maximum_amount") + @ExcludeMissing + fun maximumAmount(maximumAmount: JsonField) = apply { + this.maximumAmount = maximumAmount + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun build(): MaximumAdjustment = + MaximumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, + appliesToPriceIds.map { it.toImmutable() }, + reason, + adjustmentType, + maximumAmount, + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField val MAXIMUM = AdjustmentType(JsonField.of("maximum")) + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + enum class Known { + MAXIMUM, + } + + enum class Value { + MAXIMUM, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + MAXIMUM -> Value.MAXIMUM + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + MAXIMUM -> Known.MAXIMUM + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is MaximumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MaximumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + } + } + @JsonDeserialize(builder = BasePlan.Builder::class) @NoAutoDetect class BasePlan @@ -2014,15 +3777,15 @@ private constructor( return true } - return /* spotless:off */ other is Plan && metadata == other.metadata && id == other.id && name == other.name && description == other.description && maximumAmount == other.maximumAmount && minimumAmount == other.minimumAmount && createdAt == other.createdAt && status == other.status && maximum == other.maximum && minimum == other.minimum && discount == other.discount && product == other.product && version == other.version && trialConfig == other.trialConfig && planPhases == other.planPhases && basePlan == other.basePlan && basePlanId == other.basePlanId && externalPlanId == other.externalPlanId && currency == other.currency && invoicingCurrency == other.invoicingCurrency && netTerms == other.netTerms && defaultInvoiceMemo == other.defaultInvoiceMemo && prices == other.prices && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Plan && metadata == other.metadata && id == other.id && name == other.name && description == other.description && maximumAmount == other.maximumAmount && minimumAmount == other.minimumAmount && createdAt == other.createdAt && status == other.status && maximum == other.maximum && minimum == other.minimum && discount == other.discount && product == other.product && version == other.version && trialConfig == other.trialConfig && planPhases == other.planPhases && basePlan == other.basePlan && basePlanId == other.basePlanId && externalPlanId == other.externalPlanId && currency == other.currency && invoicingCurrency == other.invoicingCurrency && netTerms == other.netTerms && defaultInvoiceMemo == other.defaultInvoiceMemo && prices == other.prices && adjustments == other.adjustments && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(metadata, id, name, description, maximumAmount, minimumAmount, createdAt, status, maximum, minimum, discount, product, version, trialConfig, planPhases, basePlan, basePlanId, externalPlanId, currency, invoicingCurrency, netTerms, defaultInvoiceMemo, prices, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(metadata, id, name, description, maximumAmount, minimumAmount, createdAt, status, maximum, minimum, discount, product, version, trialConfig, planPhases, basePlan, basePlanId, externalPlanId, currency, invoicingCurrency, netTerms, defaultInvoiceMemo, prices, adjustments, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Plan{metadata=$metadata, id=$id, name=$name, description=$description, maximumAmount=$maximumAmount, minimumAmount=$minimumAmount, createdAt=$createdAt, status=$status, maximum=$maximum, minimum=$minimum, discount=$discount, product=$product, version=$version, trialConfig=$trialConfig, planPhases=$planPhases, basePlan=$basePlan, basePlanId=$basePlanId, externalPlanId=$externalPlanId, currency=$currency, invoicingCurrency=$invoicingCurrency, netTerms=$netTerms, defaultInvoiceMemo=$defaultInvoiceMemo, prices=$prices, additionalProperties=$additionalProperties}" + "Plan{metadata=$metadata, id=$id, name=$name, description=$description, maximumAmount=$maximumAmount, minimumAmount=$minimumAmount, createdAt=$createdAt, status=$status, maximum=$maximum, minimum=$minimum, discount=$discount, product=$product, version=$version, trialConfig=$trialConfig, planPhases=$planPhases, basePlan=$basePlan, basePlanId=$basePlanId, externalPlanId=$externalPlanId, currency=$currency, invoicingCurrency=$invoicingCurrency, netTerms=$netTerms, defaultInvoiceMemo=$defaultInvoiceMemo, prices=$prices, adjustments=$adjustments, additionalProperties=$additionalProperties}" } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt index 80e2a6dc..aee059a9 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt @@ -1219,6 +1219,9 @@ private constructor( @NoAutoDetect class AmountDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1228,6 +1231,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1243,6 +1258,21 @@ private constructor( */ fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1269,6 +1299,9 @@ private constructor( fun validate(): AmountDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1286,6 +1319,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1294,6 +1330,9 @@ private constructor( @JvmSynthetic internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + this.id = amountDiscountAdjustment.id + this.isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = amountDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = amountDiscountAdjustment.appliesToPriceIds this.reason = amountDiscountAdjustment.reason this.adjustmentType = amountDiscountAdjustment.adjustmentType @@ -1301,6 +1340,40 @@ private constructor( additionalProperties(amountDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1363,6 +1436,9 @@ private constructor( fun build(): AmountDiscountAdjustment = AmountDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1429,23 +1505,26 @@ private constructor( return true } - return /* spotless:off */ other is AmountDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AmountDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AmountDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "AmountDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = PercentageDiscountAdjustment.Builder::class) @NoAutoDetect class PercentageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1455,6 +1534,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1471,6 +1562,21 @@ private constructor( fun percentageDiscount(): Double = percentageDiscount.getRequired("percentage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1497,6 +1603,9 @@ private constructor( fun validate(): PercentageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1514,6 +1623,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1523,6 +1635,9 @@ private constructor( @JvmSynthetic internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = apply { + this.id = percentageDiscountAdjustment.id + this.isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = percentageDiscountAdjustment.appliesToPriceIds this.reason = percentageDiscountAdjustment.reason this.adjustmentType = percentageDiscountAdjustment.adjustmentType @@ -1531,6 +1646,40 @@ private constructor( additionalProperties(percentageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1593,6 +1742,9 @@ private constructor( fun build(): PercentageDiscountAdjustment = PercentageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1660,23 +1812,26 @@ private constructor( return true } - return /* spotless:off */ other is PercentageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PercentageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PercentageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "PercentageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = UsageDiscountAdjustment.Builder::class) @NoAutoDetect class UsageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1686,6 +1841,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1701,6 +1868,21 @@ private constructor( */ fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1725,6 +1907,9 @@ private constructor( fun validate(): UsageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1742,6 +1927,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1750,6 +1938,9 @@ private constructor( @JvmSynthetic internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + this.id = usageDiscountAdjustment.id + this.isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = usageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = usageDiscountAdjustment.appliesToPriceIds this.reason = usageDiscountAdjustment.reason this.adjustmentType = usageDiscountAdjustment.adjustmentType @@ -1757,6 +1948,40 @@ private constructor( additionalProperties(usageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1819,6 +2044,9 @@ private constructor( fun build(): UsageDiscountAdjustment = UsageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1885,23 +2113,26 @@ private constructor( return true } - return /* spotless:off */ other is UsageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UsageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UsageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + "UsageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MinimumAdjustment.Builder::class) @NoAutoDetect class MinimumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1912,6 +2143,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1930,6 +2173,21 @@ private constructor( /** The item ID that revenue from this minimum will be attributed to. */ fun itemId(): String = itemId.getRequired("item_id") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1957,6 +2215,9 @@ private constructor( fun validate(): MinimumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1975,6 +2236,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1984,6 +2248,9 @@ private constructor( @JvmSynthetic internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + this.id = minimumAdjustment.id + this.isInvoiceLevel = minimumAdjustment.isInvoiceLevel + this.planPhaseOrder = minimumAdjustment.planPhaseOrder this.appliesToPriceIds = minimumAdjustment.appliesToPriceIds this.reason = minimumAdjustment.reason this.adjustmentType = minimumAdjustment.adjustmentType @@ -1992,6 +2259,40 @@ private constructor( additionalProperties(minimumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2062,6 +2363,9 @@ private constructor( fun build(): MinimumAdjustment = MinimumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2128,23 +2432,26 @@ private constructor( return true } - return /* spotless:off */ other is MinimumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MinimumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MinimumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "MinimumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MaximumAdjustment.Builder::class) @NoAutoDetect class MaximumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -2154,6 +2461,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -2169,6 +2488,21 @@ private constructor( */ fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -2193,6 +2527,9 @@ private constructor( fun validate(): MaximumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -2210,6 +2547,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -2218,6 +2558,9 @@ private constructor( @JvmSynthetic internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + this.id = maximumAdjustment.id + this.isInvoiceLevel = maximumAdjustment.isInvoiceLevel + this.planPhaseOrder = maximumAdjustment.planPhaseOrder this.appliesToPriceIds = maximumAdjustment.appliesToPriceIds this.reason = maximumAdjustment.reason this.adjustmentType = maximumAdjustment.adjustmentType @@ -2225,6 +2568,40 @@ private constructor( additionalProperties(maximumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2287,6 +2664,9 @@ private constructor( fun build(): MaximumAdjustment = MaximumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2352,17 +2732,17 @@ private constructor( return true } - return /* spotless:off */ other is MaximumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MaximumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MaximumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "MaximumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt index bad0a272..8fbf2b03 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt @@ -1204,6 +1204,9 @@ private constructor( @NoAutoDetect class AmountDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1213,6 +1216,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1228,6 +1243,21 @@ private constructor( */ fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1254,6 +1284,9 @@ private constructor( fun validate(): AmountDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1271,6 +1304,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1279,6 +1315,9 @@ private constructor( @JvmSynthetic internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + this.id = amountDiscountAdjustment.id + this.isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = amountDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = amountDiscountAdjustment.appliesToPriceIds this.reason = amountDiscountAdjustment.reason this.adjustmentType = amountDiscountAdjustment.adjustmentType @@ -1286,6 +1325,40 @@ private constructor( additionalProperties(amountDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1348,6 +1421,9 @@ private constructor( fun build(): AmountDiscountAdjustment = AmountDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1414,23 +1490,26 @@ private constructor( return true } - return /* spotless:off */ other is AmountDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AmountDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AmountDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "AmountDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = PercentageDiscountAdjustment.Builder::class) @NoAutoDetect class PercentageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1440,6 +1519,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1456,6 +1547,21 @@ private constructor( fun percentageDiscount(): Double = percentageDiscount.getRequired("percentage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1482,6 +1588,9 @@ private constructor( fun validate(): PercentageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1499,6 +1608,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1508,6 +1620,9 @@ private constructor( @JvmSynthetic internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = apply { + this.id = percentageDiscountAdjustment.id + this.isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = percentageDiscountAdjustment.appliesToPriceIds this.reason = percentageDiscountAdjustment.reason this.adjustmentType = percentageDiscountAdjustment.adjustmentType @@ -1516,6 +1631,40 @@ private constructor( additionalProperties(percentageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1578,6 +1727,9 @@ private constructor( fun build(): PercentageDiscountAdjustment = PercentageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1645,23 +1797,26 @@ private constructor( return true } - return /* spotless:off */ other is PercentageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PercentageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PercentageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "PercentageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = UsageDiscountAdjustment.Builder::class) @NoAutoDetect class UsageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1671,6 +1826,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1686,6 +1853,21 @@ private constructor( */ fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1710,6 +1892,9 @@ private constructor( fun validate(): UsageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1727,6 +1912,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1735,6 +1923,9 @@ private constructor( @JvmSynthetic internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + this.id = usageDiscountAdjustment.id + this.isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = usageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = usageDiscountAdjustment.appliesToPriceIds this.reason = usageDiscountAdjustment.reason this.adjustmentType = usageDiscountAdjustment.adjustmentType @@ -1742,6 +1933,40 @@ private constructor( additionalProperties(usageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1804,6 +2029,9 @@ private constructor( fun build(): UsageDiscountAdjustment = UsageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1870,23 +2098,26 @@ private constructor( return true } - return /* spotless:off */ other is UsageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UsageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UsageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + "UsageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MinimumAdjustment.Builder::class) @NoAutoDetect class MinimumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1897,6 +2128,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1915,6 +2158,21 @@ private constructor( /** The item ID that revenue from this minimum will be attributed to. */ fun itemId(): String = itemId.getRequired("item_id") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1942,6 +2200,9 @@ private constructor( fun validate(): MinimumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1960,6 +2221,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1969,6 +2233,9 @@ private constructor( @JvmSynthetic internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + this.id = minimumAdjustment.id + this.isInvoiceLevel = minimumAdjustment.isInvoiceLevel + this.planPhaseOrder = minimumAdjustment.planPhaseOrder this.appliesToPriceIds = minimumAdjustment.appliesToPriceIds this.reason = minimumAdjustment.reason this.adjustmentType = minimumAdjustment.adjustmentType @@ -1977,6 +2244,40 @@ private constructor( additionalProperties(minimumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2047,6 +2348,9 @@ private constructor( fun build(): MinimumAdjustment = MinimumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2113,23 +2417,26 @@ private constructor( return true } - return /* spotless:off */ other is MinimumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MinimumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MinimumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "MinimumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MaximumAdjustment.Builder::class) @NoAutoDetect class MaximumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -2139,6 +2446,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -2154,6 +2473,21 @@ private constructor( */ fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -2178,6 +2512,9 @@ private constructor( fun validate(): MaximumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -2195,6 +2532,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -2203,6 +2543,9 @@ private constructor( @JvmSynthetic internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + this.id = maximumAdjustment.id + this.isInvoiceLevel = maximumAdjustment.isInvoiceLevel + this.planPhaseOrder = maximumAdjustment.planPhaseOrder this.appliesToPriceIds = maximumAdjustment.appliesToPriceIds this.reason = maximumAdjustment.reason this.adjustmentType = maximumAdjustment.adjustmentType @@ -2210,6 +2553,40 @@ private constructor( additionalProperties(maximumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2272,6 +2649,9 @@ private constructor( fun build(): MaximumAdjustment = MaximumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2337,17 +2717,17 @@ private constructor( return true } - return /* spotless:off */ other is MaximumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MaximumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MaximumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "MaximumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateParams.kt index d1b6f51f..ebc927ee 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateParams.kt @@ -1321,6 +1321,7 @@ constructor( class Adjustment private constructor( private val newPercentageDiscount: NewPercentageDiscount? = null, + private val newUsageDiscount: NewUsageDiscount? = null, private val newAmountDiscount: NewAmountDiscount? = null, private val newMinimum: NewMinimum? = null, private val newMaximum: NewMaximum? = null, @@ -1332,6 +1333,9 @@ constructor( fun newPercentageDiscount(): Optional = Optional.ofNullable(newPercentageDiscount) + fun newUsageDiscount(): Optional = + Optional.ofNullable(newUsageDiscount) + fun newAmountDiscount(): Optional = Optional.ofNullable(newAmountDiscount) @@ -1341,6 +1345,8 @@ constructor( fun isNewPercentageDiscount(): Boolean = newPercentageDiscount != null + fun isNewUsageDiscount(): Boolean = newUsageDiscount != null + fun isNewAmountDiscount(): Boolean = newAmountDiscount != null fun isNewMinimum(): Boolean = newMinimum != null @@ -1350,6 +1356,9 @@ constructor( fun asNewPercentageDiscount(): NewPercentageDiscount = newPercentageDiscount.getOrThrow("newPercentageDiscount") + fun asNewUsageDiscount(): NewUsageDiscount = + newUsageDiscount.getOrThrow("newUsageDiscount") + fun asNewAmountDiscount(): NewAmountDiscount = newAmountDiscount.getOrThrow("newAmountDiscount") @@ -1363,6 +1372,7 @@ constructor( return when { newPercentageDiscount != null -> visitor.visitNewPercentageDiscount(newPercentageDiscount) + newUsageDiscount != null -> visitor.visitNewUsageDiscount(newUsageDiscount) newAmountDiscount != null -> visitor.visitNewAmountDiscount(newAmountDiscount) newMinimum != null -> visitor.visitNewMinimum(newMinimum) newMaximum != null -> visitor.visitNewMaximum(newMaximum) @@ -1374,6 +1384,7 @@ constructor( if (!validated) { if ( newPercentageDiscount == null && + newUsageDiscount == null && newAmountDiscount == null && newMinimum == null && newMaximum == null @@ -1381,6 +1392,7 @@ constructor( throw OrbInvalidDataException("Unknown Adjustment: $_json") } newPercentageDiscount?.validate() + newUsageDiscount?.validate() newAmountDiscount?.validate() newMinimum?.validate() newMaximum?.validate() @@ -1393,15 +1405,16 @@ constructor( return true } - return /* spotless:off */ other is Adjustment && newPercentageDiscount == other.newPercentageDiscount && newAmountDiscount == other.newAmountDiscount && newMinimum == other.newMinimum && newMaximum == other.newMaximum /* spotless:on */ + return /* spotless:off */ other is Adjustment && newPercentageDiscount == other.newPercentageDiscount && newUsageDiscount == other.newUsageDiscount && newAmountDiscount == other.newAmountDiscount && newMinimum == other.newMinimum && newMaximum == other.newMaximum /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPercentageDiscount, newAmountDiscount, newMinimum, newMaximum) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPercentageDiscount, newUsageDiscount, newAmountDiscount, newMinimum, newMaximum) /* spotless:on */ override fun toString(): String = when { newPercentageDiscount != null -> "Adjustment{newPercentageDiscount=$newPercentageDiscount}" + newUsageDiscount != null -> "Adjustment{newUsageDiscount=$newUsageDiscount}" newAmountDiscount != null -> "Adjustment{newAmountDiscount=$newAmountDiscount}" newMinimum != null -> "Adjustment{newMinimum=$newMinimum}" newMaximum != null -> "Adjustment{newMaximum=$newMaximum}" @@ -1415,6 +1428,10 @@ constructor( fun ofNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount) = Adjustment(newPercentageDiscount = newPercentageDiscount) + @JvmStatic + fun ofNewUsageDiscount(newUsageDiscount: NewUsageDiscount) = + Adjustment(newUsageDiscount = newUsageDiscount) + @JvmStatic fun ofNewAmountDiscount(newAmountDiscount: NewAmountDiscount) = Adjustment(newAmountDiscount = newAmountDiscount) @@ -1430,6 +1447,8 @@ constructor( fun visitNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount): T + fun visitNewUsageDiscount(newUsageDiscount: NewUsageDiscount): T + fun visitNewAmountDiscount(newAmountDiscount: NewAmountDiscount): T fun visitNewMinimum(newMinimum: NewMinimum): T @@ -1457,6 +1476,14 @@ constructor( return Adjustment(newPercentageDiscount = it, _json = json) } } + "usage_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(newUsageDiscount = it, _json = json) + } + } "amount_discount" -> { tryDeserialize(node, jacksonTypeRef()) { it.validate() @@ -1493,6 +1520,8 @@ constructor( when { value.newPercentageDiscount != null -> generator.writeObject(value.newPercentageDiscount) + value.newUsageDiscount != null -> + generator.writeObject(value.newUsageDiscount) value.newAmountDiscount != null -> generator.writeObject(value.newAmountDiscount) value.newMinimum != null -> generator.writeObject(value.newMinimum) @@ -1508,6 +1537,7 @@ constructor( class NewPercentageDiscount private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val percentageDiscount: JsonField, private val additionalProperties: Map, @@ -1519,6 +1549,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun percentageDiscount(): Double = @@ -1529,6 +1566,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -1544,6 +1589,7 @@ constructor( fun validate(): NewPercentageDiscount = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() percentageDiscount() validated = true @@ -1560,6 +1606,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var percentageDiscount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -1567,6 +1614,7 @@ constructor( @JvmSynthetic internal fun from(newPercentageDiscount: NewPercentageDiscount) = apply { this.appliesToPriceIds = newPercentageDiscount.appliesToPriceIds + this.isInvoiceLevel = newPercentageDiscount.isInvoiceLevel this.adjustmentType = newPercentageDiscount.adjustmentType this.percentageDiscount = newPercentageDiscount.percentageDiscount additionalProperties(newPercentageDiscount.additionalProperties) @@ -1583,6 +1631,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -1619,6 +1684,7 @@ constructor( fun build(): NewPercentageDiscount = NewPercentageDiscount( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, percentageDiscount, additionalProperties.toImmutable(), @@ -1684,17 +1750,244 @@ constructor( return true } - return /* spotless:off */ other is NewPercentageDiscount && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewPercentageDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, percentageDiscount, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NewPercentageDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + } + + @JsonDeserialize(builder = NewUsageDiscount.Builder::class) + @NoAutoDetect + class NewUsageDiscount + private constructor( + private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, + private val adjustmentType: JsonField, + private val usageDiscount: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + /** The set of price IDs to which this adjustment applies. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + + /** The set of price IDs to which this adjustment applies. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds() = appliesToPriceIds + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType() = adjustmentType + + @JsonProperty("usage_discount") @ExcludeMissing fun _usageDiscount() = usageDiscount + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): NewUsageDiscount = apply { + if (!validated) { + appliesToPriceIds() + isInvoiceLevel() + adjustmentType() + usageDiscount() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var adjustmentType: JsonField = JsonMissing.of() + private var usageDiscount: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(newUsageDiscount: NewUsageDiscount) = apply { + this.appliesToPriceIds = newUsageDiscount.appliesToPriceIds + this.isInvoiceLevel = newUsageDiscount.isInvoiceLevel + this.adjustmentType = newUsageDiscount.adjustmentType + this.usageDiscount = newUsageDiscount.usageDiscount + additionalProperties(newUsageDiscount.additionalProperties) + } + + /** The set of price IDs to which this adjustment applies. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The set of price IDs to which this adjustment applies. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds + } + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + fun usageDiscount(usageDiscount: Double) = + usageDiscount(JsonField.of(usageDiscount)) + + @JsonProperty("usage_discount") + @ExcludeMissing + fun usageDiscount(usageDiscount: JsonField) = apply { + this.usageDiscount = usageDiscount + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun build(): NewUsageDiscount = + NewUsageDiscount( + appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, + adjustmentType, + usageDiscount, + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField + val USAGE_DISCOUNT = AdjustmentType(JsonField.of("usage_discount")) + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + enum class Known { + USAGE_DISCOUNT, + } + + enum class Value { + USAGE_DISCOUNT, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + USAGE_DISCOUNT -> Value.USAGE_DISCOUNT + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + USAGE_DISCOUNT -> Known.USAGE_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is NewUsageDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewPercentageDiscount{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "NewUsageDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewAmountDiscount.Builder::class) @@ -1702,6 +1995,7 @@ constructor( class NewAmountDiscount private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val amountDiscount: JsonField, private val additionalProperties: Map, @@ -1713,6 +2007,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") @@ -1722,6 +2023,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -1737,6 +2046,7 @@ constructor( fun validate(): NewAmountDiscount = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() amountDiscount() validated = true @@ -1753,6 +2063,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var amountDiscount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -1760,6 +2071,7 @@ constructor( @JvmSynthetic internal fun from(newAmountDiscount: NewAmountDiscount) = apply { this.appliesToPriceIds = newAmountDiscount.appliesToPriceIds + this.isInvoiceLevel = newAmountDiscount.isInvoiceLevel this.adjustmentType = newAmountDiscount.adjustmentType this.amountDiscount = newAmountDiscount.amountDiscount additionalProperties(newAmountDiscount.additionalProperties) @@ -1776,6 +2088,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -1812,6 +2141,7 @@ constructor( fun build(): NewAmountDiscount = NewAmountDiscount( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, amountDiscount, additionalProperties.toImmutable(), @@ -1876,17 +2206,17 @@ constructor( return true } - return /* spotless:off */ other is NewAmountDiscount && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewAmountDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewAmountDiscount{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "NewAmountDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewMinimum.Builder::class) @@ -1894,6 +2224,7 @@ constructor( class NewMinimum private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val minimumAmount: JsonField, private val itemId: JsonField, @@ -1906,6 +2237,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount") @@ -1918,6 +2256,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -1934,6 +2280,7 @@ constructor( fun validate(): NewMinimum = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() minimumAmount() itemId() @@ -1951,6 +2298,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var minimumAmount: JsonField = JsonMissing.of() private var itemId: JsonField = JsonMissing.of() @@ -1959,6 +2307,7 @@ constructor( @JvmSynthetic internal fun from(newMinimum: NewMinimum) = apply { this.appliesToPriceIds = newMinimum.appliesToPriceIds + this.isInvoiceLevel = newMinimum.isInvoiceLevel this.adjustmentType = newMinimum.adjustmentType this.minimumAmount = newMinimum.minimumAmount this.itemId = newMinimum.itemId @@ -1976,6 +2325,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -2020,6 +2386,7 @@ constructor( fun build(): NewMinimum = NewMinimum( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, minimumAmount, itemId, @@ -2084,17 +2451,17 @@ constructor( return true } - return /* spotless:off */ other is NewMinimum && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewMinimum && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewMinimum{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "NewMinimum{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewMaximum.Builder::class) @@ -2102,6 +2469,7 @@ constructor( class NewMaximum private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val maximumAmount: JsonField, private val additionalProperties: Map, @@ -2113,6 +2481,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") @@ -2122,6 +2497,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -2135,6 +2518,7 @@ constructor( fun validate(): NewMaximum = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() maximumAmount() validated = true @@ -2151,6 +2535,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var maximumAmount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -2158,6 +2543,7 @@ constructor( @JvmSynthetic internal fun from(newMaximum: NewMaximum) = apply { this.appliesToPriceIds = newMaximum.appliesToPriceIds + this.isInvoiceLevel = newMaximum.isInvoiceLevel this.adjustmentType = newMaximum.adjustmentType this.maximumAmount = newMaximum.maximumAmount additionalProperties(newMaximum.additionalProperties) @@ -2174,6 +2560,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -2210,6 +2613,7 @@ constructor( fun build(): NewMaximum = NewMaximum( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, maximumAmount, additionalProperties.toImmutable(), @@ -2273,17 +2677,17 @@ constructor( return true } - return /* spotless:off */ other is NewMaximum && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewMaximum && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewMaximum{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "NewMaximum{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } @@ -2345,13 +2749,21 @@ constructor( /** The phase to add this price to. */ @JsonProperty("plan_phase_order") fun planPhaseOrder(): Long? = planPhaseOrder - /** The subscription's minimum amount for this price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this + * price. + */ @JsonProperty("minimum_amount") fun minimumAmount(): String? = minimumAmount - /** The subscription's maximum amount for this price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this + * price. + */ @JsonProperty("maximum_amount") fun maximumAmount(): String? = maximumAmount - /** The subscription's discounts for this price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this price. + */ @JsonProperty("discounts") fun discounts(): List? = discounts @JsonAnyGetter @@ -2426,15 +2838,24 @@ constructor( this.planPhaseOrder = planPhaseOrder } - /** The subscription's minimum amount for this price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this + * price. + */ @JsonProperty("minimum_amount") fun minimumAmount(minimumAmount: String) = apply { this.minimumAmount = minimumAmount } - /** The subscription's maximum amount for this price. */ - @JsonProperty("maximum_amount") + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this + * price. + */ + @JsonProperty("maximum_amount") fun maximumAmount(maximumAmount: String) = apply { this.maximumAmount = maximumAmount } - /** The subscription's discounts for this price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this + * price. + */ @JsonProperty("discounts") fun discounts(discounts: List) = apply { this.discounts = discounts } @@ -26702,6 +27123,7 @@ constructor( class Adjustment private constructor( private val newPercentageDiscount: NewPercentageDiscount? = null, + private val newUsageDiscount: NewUsageDiscount? = null, private val newAmountDiscount: NewAmountDiscount? = null, private val newMinimum: NewMinimum? = null, private val newMaximum: NewMaximum? = null, @@ -26713,6 +27135,9 @@ constructor( fun newPercentageDiscount(): Optional = Optional.ofNullable(newPercentageDiscount) + fun newUsageDiscount(): Optional = + Optional.ofNullable(newUsageDiscount) + fun newAmountDiscount(): Optional = Optional.ofNullable(newAmountDiscount) @@ -26722,6 +27147,8 @@ constructor( fun isNewPercentageDiscount(): Boolean = newPercentageDiscount != null + fun isNewUsageDiscount(): Boolean = newUsageDiscount != null + fun isNewAmountDiscount(): Boolean = newAmountDiscount != null fun isNewMinimum(): Boolean = newMinimum != null @@ -26731,6 +27158,9 @@ constructor( fun asNewPercentageDiscount(): NewPercentageDiscount = newPercentageDiscount.getOrThrow("newPercentageDiscount") + fun asNewUsageDiscount(): NewUsageDiscount = + newUsageDiscount.getOrThrow("newUsageDiscount") + fun asNewAmountDiscount(): NewAmountDiscount = newAmountDiscount.getOrThrow("newAmountDiscount") @@ -26744,6 +27174,7 @@ constructor( return when { newPercentageDiscount != null -> visitor.visitNewPercentageDiscount(newPercentageDiscount) + newUsageDiscount != null -> visitor.visitNewUsageDiscount(newUsageDiscount) newAmountDiscount != null -> visitor.visitNewAmountDiscount(newAmountDiscount) newMinimum != null -> visitor.visitNewMinimum(newMinimum) newMaximum != null -> visitor.visitNewMaximum(newMaximum) @@ -26755,6 +27186,7 @@ constructor( if (!validated) { if ( newPercentageDiscount == null && + newUsageDiscount == null && newAmountDiscount == null && newMinimum == null && newMaximum == null @@ -26762,6 +27194,7 @@ constructor( throw OrbInvalidDataException("Unknown Adjustment: $_json") } newPercentageDiscount?.validate() + newUsageDiscount?.validate() newAmountDiscount?.validate() newMinimum?.validate() newMaximum?.validate() @@ -26774,15 +27207,16 @@ constructor( return true } - return /* spotless:off */ other is Adjustment && newPercentageDiscount == other.newPercentageDiscount && newAmountDiscount == other.newAmountDiscount && newMinimum == other.newMinimum && newMaximum == other.newMaximum /* spotless:on */ + return /* spotless:off */ other is Adjustment && newPercentageDiscount == other.newPercentageDiscount && newUsageDiscount == other.newUsageDiscount && newAmountDiscount == other.newAmountDiscount && newMinimum == other.newMinimum && newMaximum == other.newMaximum /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPercentageDiscount, newAmountDiscount, newMinimum, newMaximum) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPercentageDiscount, newUsageDiscount, newAmountDiscount, newMinimum, newMaximum) /* spotless:on */ override fun toString(): String = when { newPercentageDiscount != null -> "Adjustment{newPercentageDiscount=$newPercentageDiscount}" + newUsageDiscount != null -> "Adjustment{newUsageDiscount=$newUsageDiscount}" newAmountDiscount != null -> "Adjustment{newAmountDiscount=$newAmountDiscount}" newMinimum != null -> "Adjustment{newMinimum=$newMinimum}" newMaximum != null -> "Adjustment{newMaximum=$newMaximum}" @@ -26796,6 +27230,10 @@ constructor( fun ofNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount) = Adjustment(newPercentageDiscount = newPercentageDiscount) + @JvmStatic + fun ofNewUsageDiscount(newUsageDiscount: NewUsageDiscount) = + Adjustment(newUsageDiscount = newUsageDiscount) + @JvmStatic fun ofNewAmountDiscount(newAmountDiscount: NewAmountDiscount) = Adjustment(newAmountDiscount = newAmountDiscount) @@ -26811,6 +27249,8 @@ constructor( fun visitNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount): T + fun visitNewUsageDiscount(newUsageDiscount: NewUsageDiscount): T + fun visitNewAmountDiscount(newAmountDiscount: NewAmountDiscount): T fun visitNewMinimum(newMinimum: NewMinimum): T @@ -26838,6 +27278,14 @@ constructor( return Adjustment(newPercentageDiscount = it, _json = json) } } + "usage_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(newUsageDiscount = it, _json = json) + } + } "amount_discount" -> { tryDeserialize(node, jacksonTypeRef()) { it.validate() @@ -26874,6 +27322,8 @@ constructor( when { value.newPercentageDiscount != null -> generator.writeObject(value.newPercentageDiscount) + value.newUsageDiscount != null -> + generator.writeObject(value.newUsageDiscount) value.newAmountDiscount != null -> generator.writeObject(value.newAmountDiscount) value.newMinimum != null -> generator.writeObject(value.newMinimum) @@ -26889,6 +27339,7 @@ constructor( class NewPercentageDiscount private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val percentageDiscount: JsonField, private val additionalProperties: Map, @@ -26900,6 +27351,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun percentageDiscount(): Double = @@ -26910,6 +27368,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -26925,6 +27391,7 @@ constructor( fun validate(): NewPercentageDiscount = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() percentageDiscount() validated = true @@ -26941,6 +27408,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var percentageDiscount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -26948,6 +27416,7 @@ constructor( @JvmSynthetic internal fun from(newPercentageDiscount: NewPercentageDiscount) = apply { this.appliesToPriceIds = newPercentageDiscount.appliesToPriceIds + this.isInvoiceLevel = newPercentageDiscount.isInvoiceLevel this.adjustmentType = newPercentageDiscount.adjustmentType this.percentageDiscount = newPercentageDiscount.percentageDiscount additionalProperties(newPercentageDiscount.additionalProperties) @@ -26964,6 +27433,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -27000,6 +27486,7 @@ constructor( fun build(): NewPercentageDiscount = NewPercentageDiscount( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, percentageDiscount, additionalProperties.toImmutable(), @@ -27065,17 +27552,244 @@ constructor( return true } - return /* spotless:off */ other is NewPercentageDiscount && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewPercentageDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, percentageDiscount, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NewPercentageDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + } + + @JsonDeserialize(builder = NewUsageDiscount.Builder::class) + @NoAutoDetect + class NewUsageDiscount + private constructor( + private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, + private val adjustmentType: JsonField, + private val usageDiscount: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + /** The set of price IDs to which this adjustment applies. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + + /** The set of price IDs to which this adjustment applies. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds() = appliesToPriceIds + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType() = adjustmentType + + @JsonProperty("usage_discount") @ExcludeMissing fun _usageDiscount() = usageDiscount + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): NewUsageDiscount = apply { + if (!validated) { + appliesToPriceIds() + isInvoiceLevel() + adjustmentType() + usageDiscount() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var adjustmentType: JsonField = JsonMissing.of() + private var usageDiscount: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(newUsageDiscount: NewUsageDiscount) = apply { + this.appliesToPriceIds = newUsageDiscount.appliesToPriceIds + this.isInvoiceLevel = newUsageDiscount.isInvoiceLevel + this.adjustmentType = newUsageDiscount.adjustmentType + this.usageDiscount = newUsageDiscount.usageDiscount + additionalProperties(newUsageDiscount.additionalProperties) + } + + /** The set of price IDs to which this adjustment applies. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The set of price IDs to which this adjustment applies. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds + } + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + fun usageDiscount(usageDiscount: Double) = + usageDiscount(JsonField.of(usageDiscount)) + + @JsonProperty("usage_discount") + @ExcludeMissing + fun usageDiscount(usageDiscount: JsonField) = apply { + this.usageDiscount = usageDiscount + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun build(): NewUsageDiscount = + NewUsageDiscount( + appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, + adjustmentType, + usageDiscount, + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField + val USAGE_DISCOUNT = AdjustmentType(JsonField.of("usage_discount")) + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + enum class Known { + USAGE_DISCOUNT, + } + + enum class Value { + USAGE_DISCOUNT, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + USAGE_DISCOUNT -> Value.USAGE_DISCOUNT + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + USAGE_DISCOUNT -> Known.USAGE_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is NewUsageDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewPercentageDiscount{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "NewUsageDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewAmountDiscount.Builder::class) @@ -27083,6 +27797,7 @@ constructor( class NewAmountDiscount private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val amountDiscount: JsonField, private val additionalProperties: Map, @@ -27094,6 +27809,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") @@ -27103,6 +27825,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -27118,6 +27848,7 @@ constructor( fun validate(): NewAmountDiscount = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() amountDiscount() validated = true @@ -27134,6 +27865,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var amountDiscount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -27141,6 +27873,7 @@ constructor( @JvmSynthetic internal fun from(newAmountDiscount: NewAmountDiscount) = apply { this.appliesToPriceIds = newAmountDiscount.appliesToPriceIds + this.isInvoiceLevel = newAmountDiscount.isInvoiceLevel this.adjustmentType = newAmountDiscount.adjustmentType this.amountDiscount = newAmountDiscount.amountDiscount additionalProperties(newAmountDiscount.additionalProperties) @@ -27157,6 +27890,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -27193,6 +27943,7 @@ constructor( fun build(): NewAmountDiscount = NewAmountDiscount( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, amountDiscount, additionalProperties.toImmutable(), @@ -27257,17 +28008,17 @@ constructor( return true } - return /* spotless:off */ other is NewAmountDiscount && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewAmountDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewAmountDiscount{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "NewAmountDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewMinimum.Builder::class) @@ -27275,6 +28026,7 @@ constructor( class NewMinimum private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val minimumAmount: JsonField, private val itemId: JsonField, @@ -27287,6 +28039,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount") @@ -27299,6 +28058,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -27315,6 +28082,7 @@ constructor( fun validate(): NewMinimum = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() minimumAmount() itemId() @@ -27332,6 +28100,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var minimumAmount: JsonField = JsonMissing.of() private var itemId: JsonField = JsonMissing.of() @@ -27340,6 +28109,7 @@ constructor( @JvmSynthetic internal fun from(newMinimum: NewMinimum) = apply { this.appliesToPriceIds = newMinimum.appliesToPriceIds + this.isInvoiceLevel = newMinimum.isInvoiceLevel this.adjustmentType = newMinimum.adjustmentType this.minimumAmount = newMinimum.minimumAmount this.itemId = newMinimum.itemId @@ -27357,6 +28127,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -27401,6 +28188,7 @@ constructor( fun build(): NewMinimum = NewMinimum( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, minimumAmount, itemId, @@ -27465,17 +28253,17 @@ constructor( return true } - return /* spotless:off */ other is NewMinimum && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewMinimum && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewMinimum{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "NewMinimum{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewMaximum.Builder::class) @@ -27483,6 +28271,7 @@ constructor( class NewMaximum private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val maximumAmount: JsonField, private val additionalProperties: Map, @@ -27494,6 +28283,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") @@ -27503,6 +28299,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -27516,6 +28320,7 @@ constructor( fun validate(): NewMaximum = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() maximumAmount() validated = true @@ -27532,6 +28337,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var maximumAmount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -27539,6 +28345,7 @@ constructor( @JvmSynthetic internal fun from(newMaximum: NewMaximum) = apply { this.appliesToPriceIds = newMaximum.appliesToPriceIds + this.isInvoiceLevel = newMaximum.isInvoiceLevel this.adjustmentType = newMaximum.adjustmentType this.maximumAmount = newMaximum.maximumAmount additionalProperties(newMaximum.additionalProperties) @@ -27555,6 +28362,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -27591,6 +28415,7 @@ constructor( fun build(): NewMaximum = NewMaximum( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, maximumAmount, additionalProperties.toImmutable(), @@ -27654,17 +28479,17 @@ constructor( return true } - return /* spotless:off */ other is NewMaximum && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewMaximum && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewMaximum{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "NewMaximum{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } @@ -27716,13 +28541,22 @@ constructor( /** The id of the price on the plan to replace in the subscription. */ @JsonProperty("replaces_price_id") fun replacesPriceId(): String? = replacesPriceId - /** The subscription's minimum amount for the replacement price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the + * replacement price. + */ @JsonProperty("minimum_amount") fun minimumAmount(): String? = minimumAmount - /** The subscription's maximum amount for the replacement price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the + * replacement price. + */ @JsonProperty("maximum_amount") fun maximumAmount(): String? = maximumAmount - /** The subscription's discounts for the replacement price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the + * replacement price. + */ @JsonProperty("discounts") fun discounts(): List? = discounts @JsonAnyGetter @@ -27786,15 +28620,24 @@ constructor( this.replacesPriceId = replacesPriceId } - /** The subscription's minimum amount for the replacement price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the + * replacement price. + */ @JsonProperty("minimum_amount") fun minimumAmount(minimumAmount: String) = apply { this.minimumAmount = minimumAmount } - /** The subscription's maximum amount for the replacement price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the + * replacement price. + */ @JsonProperty("maximum_amount") fun maximumAmount(maximumAmount: String) = apply { this.maximumAmount = maximumAmount } - /** The subscription's discounts for the replacement price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the + * replacement price. + */ @JsonProperty("discounts") fun discounts(discounts: List) = apply { this.discounts = discounts } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateResponse.kt index b1c08af9..a4ae297b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateResponse.kt @@ -1204,6 +1204,9 @@ private constructor( @NoAutoDetect class AmountDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1213,6 +1216,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1228,6 +1243,21 @@ private constructor( */ fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1254,6 +1284,9 @@ private constructor( fun validate(): AmountDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1271,6 +1304,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1279,6 +1315,9 @@ private constructor( @JvmSynthetic internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + this.id = amountDiscountAdjustment.id + this.isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = amountDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = amountDiscountAdjustment.appliesToPriceIds this.reason = amountDiscountAdjustment.reason this.adjustmentType = amountDiscountAdjustment.adjustmentType @@ -1286,6 +1325,40 @@ private constructor( additionalProperties(amountDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1348,6 +1421,9 @@ private constructor( fun build(): AmountDiscountAdjustment = AmountDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1414,23 +1490,26 @@ private constructor( return true } - return /* spotless:off */ other is AmountDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AmountDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AmountDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "AmountDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = PercentageDiscountAdjustment.Builder::class) @NoAutoDetect class PercentageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1440,6 +1519,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1456,6 +1547,21 @@ private constructor( fun percentageDiscount(): Double = percentageDiscount.getRequired("percentage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1482,6 +1588,9 @@ private constructor( fun validate(): PercentageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1499,6 +1608,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1508,6 +1620,9 @@ private constructor( @JvmSynthetic internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = apply { + this.id = percentageDiscountAdjustment.id + this.isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = percentageDiscountAdjustment.appliesToPriceIds this.reason = percentageDiscountAdjustment.reason this.adjustmentType = percentageDiscountAdjustment.adjustmentType @@ -1516,6 +1631,40 @@ private constructor( additionalProperties(percentageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1578,6 +1727,9 @@ private constructor( fun build(): PercentageDiscountAdjustment = PercentageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1645,23 +1797,26 @@ private constructor( return true } - return /* spotless:off */ other is PercentageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PercentageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PercentageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "PercentageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = UsageDiscountAdjustment.Builder::class) @NoAutoDetect class UsageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1671,6 +1826,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1686,6 +1853,21 @@ private constructor( */ fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1710,6 +1892,9 @@ private constructor( fun validate(): UsageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1727,6 +1912,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1735,6 +1923,9 @@ private constructor( @JvmSynthetic internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + this.id = usageDiscountAdjustment.id + this.isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = usageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = usageDiscountAdjustment.appliesToPriceIds this.reason = usageDiscountAdjustment.reason this.adjustmentType = usageDiscountAdjustment.adjustmentType @@ -1742,6 +1933,40 @@ private constructor( additionalProperties(usageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1804,6 +2029,9 @@ private constructor( fun build(): UsageDiscountAdjustment = UsageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1870,23 +2098,26 @@ private constructor( return true } - return /* spotless:off */ other is UsageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UsageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UsageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + "UsageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MinimumAdjustment.Builder::class) @NoAutoDetect class MinimumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1897,6 +2128,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1915,6 +2158,21 @@ private constructor( /** The item ID that revenue from this minimum will be attributed to. */ fun itemId(): String = itemId.getRequired("item_id") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1942,6 +2200,9 @@ private constructor( fun validate(): MinimumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1960,6 +2221,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1969,6 +2233,9 @@ private constructor( @JvmSynthetic internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + this.id = minimumAdjustment.id + this.isInvoiceLevel = minimumAdjustment.isInvoiceLevel + this.planPhaseOrder = minimumAdjustment.planPhaseOrder this.appliesToPriceIds = minimumAdjustment.appliesToPriceIds this.reason = minimumAdjustment.reason this.adjustmentType = minimumAdjustment.adjustmentType @@ -1977,6 +2244,40 @@ private constructor( additionalProperties(minimumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2047,6 +2348,9 @@ private constructor( fun build(): MinimumAdjustment = MinimumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2113,23 +2417,26 @@ private constructor( return true } - return /* spotless:off */ other is MinimumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MinimumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MinimumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "MinimumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MaximumAdjustment.Builder::class) @NoAutoDetect class MaximumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -2139,6 +2446,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -2154,6 +2473,21 @@ private constructor( */ fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -2178,6 +2512,9 @@ private constructor( fun validate(): MaximumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -2195,6 +2532,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -2203,6 +2543,9 @@ private constructor( @JvmSynthetic internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + this.id = maximumAdjustment.id + this.isInvoiceLevel = maximumAdjustment.isInvoiceLevel + this.planPhaseOrder = maximumAdjustment.planPhaseOrder this.appliesToPriceIds = maximumAdjustment.appliesToPriceIds this.reason = maximumAdjustment.reason this.adjustmentType = maximumAdjustment.adjustmentType @@ -2210,6 +2553,40 @@ private constructor( additionalProperties(maximumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2272,6 +2649,9 @@ private constructor( fun build(): MaximumAdjustment = MaximumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2337,17 +2717,17 @@ private constructor( return true } - return /* spotless:off */ other is MaximumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MaximumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MaximumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "MaximumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParams.kt index 8b057ab9..9e1eb37e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParams.kt @@ -32081,6 +32081,7 @@ constructor( class Adjustment private constructor( private val newPercentageDiscount: NewPercentageDiscount? = null, + private val newUsageDiscount: NewUsageDiscount? = null, private val newAmountDiscount: NewAmountDiscount? = null, private val newMinimum: NewMinimum? = null, private val newMaximum: NewMaximum? = null, @@ -32092,6 +32093,9 @@ constructor( fun newPercentageDiscount(): Optional = Optional.ofNullable(newPercentageDiscount) + fun newUsageDiscount(): Optional = + Optional.ofNullable(newUsageDiscount) + fun newAmountDiscount(): Optional = Optional.ofNullable(newAmountDiscount) @@ -32101,6 +32105,8 @@ constructor( fun isNewPercentageDiscount(): Boolean = newPercentageDiscount != null + fun isNewUsageDiscount(): Boolean = newUsageDiscount != null + fun isNewAmountDiscount(): Boolean = newAmountDiscount != null fun isNewMinimum(): Boolean = newMinimum != null @@ -32110,6 +32116,9 @@ constructor( fun asNewPercentageDiscount(): NewPercentageDiscount = newPercentageDiscount.getOrThrow("newPercentageDiscount") + fun asNewUsageDiscount(): NewUsageDiscount = + newUsageDiscount.getOrThrow("newUsageDiscount") + fun asNewAmountDiscount(): NewAmountDiscount = newAmountDiscount.getOrThrow("newAmountDiscount") @@ -32123,6 +32132,7 @@ constructor( return when { newPercentageDiscount != null -> visitor.visitNewPercentageDiscount(newPercentageDiscount) + newUsageDiscount != null -> visitor.visitNewUsageDiscount(newUsageDiscount) newAmountDiscount != null -> visitor.visitNewAmountDiscount(newAmountDiscount) newMinimum != null -> visitor.visitNewMinimum(newMinimum) newMaximum != null -> visitor.visitNewMaximum(newMaximum) @@ -32134,6 +32144,7 @@ constructor( if (!validated) { if ( newPercentageDiscount == null && + newUsageDiscount == null && newAmountDiscount == null && newMinimum == null && newMaximum == null @@ -32141,6 +32152,7 @@ constructor( throw OrbInvalidDataException("Unknown Adjustment: $_json") } newPercentageDiscount?.validate() + newUsageDiscount?.validate() newAmountDiscount?.validate() newMinimum?.validate() newMaximum?.validate() @@ -32153,15 +32165,16 @@ constructor( return true } - return /* spotless:off */ other is Adjustment && newPercentageDiscount == other.newPercentageDiscount && newAmountDiscount == other.newAmountDiscount && newMinimum == other.newMinimum && newMaximum == other.newMaximum /* spotless:on */ + return /* spotless:off */ other is Adjustment && newPercentageDiscount == other.newPercentageDiscount && newUsageDiscount == other.newUsageDiscount && newAmountDiscount == other.newAmountDiscount && newMinimum == other.newMinimum && newMaximum == other.newMaximum /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPercentageDiscount, newAmountDiscount, newMinimum, newMaximum) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPercentageDiscount, newUsageDiscount, newAmountDiscount, newMinimum, newMaximum) /* spotless:on */ override fun toString(): String = when { newPercentageDiscount != null -> "Adjustment{newPercentageDiscount=$newPercentageDiscount}" + newUsageDiscount != null -> "Adjustment{newUsageDiscount=$newUsageDiscount}" newAmountDiscount != null -> "Adjustment{newAmountDiscount=$newAmountDiscount}" newMinimum != null -> "Adjustment{newMinimum=$newMinimum}" newMaximum != null -> "Adjustment{newMaximum=$newMaximum}" @@ -32175,6 +32188,10 @@ constructor( fun ofNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount) = Adjustment(newPercentageDiscount = newPercentageDiscount) + @JvmStatic + fun ofNewUsageDiscount(newUsageDiscount: NewUsageDiscount) = + Adjustment(newUsageDiscount = newUsageDiscount) + @JvmStatic fun ofNewAmountDiscount(newAmountDiscount: NewAmountDiscount) = Adjustment(newAmountDiscount = newAmountDiscount) @@ -32190,6 +32207,8 @@ constructor( fun visitNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount): T + fun visitNewUsageDiscount(newUsageDiscount: NewUsageDiscount): T + fun visitNewAmountDiscount(newAmountDiscount: NewAmountDiscount): T fun visitNewMinimum(newMinimum: NewMinimum): T @@ -32217,6 +32236,14 @@ constructor( return Adjustment(newPercentageDiscount = it, _json = json) } } + "usage_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(newUsageDiscount = it, _json = json) + } + } "amount_discount" -> { tryDeserialize(node, jacksonTypeRef()) { it.validate() @@ -32253,6 +32280,8 @@ constructor( when { value.newPercentageDiscount != null -> generator.writeObject(value.newPercentageDiscount) + value.newUsageDiscount != null -> + generator.writeObject(value.newUsageDiscount) value.newAmountDiscount != null -> generator.writeObject(value.newAmountDiscount) value.newMinimum != null -> generator.writeObject(value.newMinimum) @@ -32268,6 +32297,7 @@ constructor( class NewPercentageDiscount private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val percentageDiscount: JsonField, private val additionalProperties: Map, @@ -32279,6 +32309,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun percentageDiscount(): Double = @@ -32289,6 +32326,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -32304,6 +32349,7 @@ constructor( fun validate(): NewPercentageDiscount = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() percentageDiscount() validated = true @@ -32320,6 +32366,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var percentageDiscount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -32327,6 +32374,7 @@ constructor( @JvmSynthetic internal fun from(newPercentageDiscount: NewPercentageDiscount) = apply { this.appliesToPriceIds = newPercentageDiscount.appliesToPriceIds + this.isInvoiceLevel = newPercentageDiscount.isInvoiceLevel this.adjustmentType = newPercentageDiscount.adjustmentType this.percentageDiscount = newPercentageDiscount.percentageDiscount additionalProperties(newPercentageDiscount.additionalProperties) @@ -32343,6 +32391,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -32379,6 +32444,7 @@ constructor( fun build(): NewPercentageDiscount = NewPercentageDiscount( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, percentageDiscount, additionalProperties.toImmutable(), @@ -32444,17 +32510,244 @@ constructor( return true } - return /* spotless:off */ other is NewPercentageDiscount && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewPercentageDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, percentageDiscount, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NewPercentageDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + } + + @JsonDeserialize(builder = NewUsageDiscount.Builder::class) + @NoAutoDetect + class NewUsageDiscount + private constructor( + private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, + private val adjustmentType: JsonField, + private val usageDiscount: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + /** The set of price IDs to which this adjustment applies. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + + /** The set of price IDs to which this adjustment applies. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds() = appliesToPriceIds + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType() = adjustmentType + + @JsonProperty("usage_discount") @ExcludeMissing fun _usageDiscount() = usageDiscount + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): NewUsageDiscount = apply { + if (!validated) { + appliesToPriceIds() + isInvoiceLevel() + adjustmentType() + usageDiscount() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var adjustmentType: JsonField = JsonMissing.of() + private var usageDiscount: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(newUsageDiscount: NewUsageDiscount) = apply { + this.appliesToPriceIds = newUsageDiscount.appliesToPriceIds + this.isInvoiceLevel = newUsageDiscount.isInvoiceLevel + this.adjustmentType = newUsageDiscount.adjustmentType + this.usageDiscount = newUsageDiscount.usageDiscount + additionalProperties(newUsageDiscount.additionalProperties) + } + + /** The set of price IDs to which this adjustment applies. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The set of price IDs to which this adjustment applies. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds + } + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + fun usageDiscount(usageDiscount: Double) = + usageDiscount(JsonField.of(usageDiscount)) + + @JsonProperty("usage_discount") + @ExcludeMissing + fun usageDiscount(usageDiscount: JsonField) = apply { + this.usageDiscount = usageDiscount + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun build(): NewUsageDiscount = + NewUsageDiscount( + appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, + adjustmentType, + usageDiscount, + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField + val USAGE_DISCOUNT = AdjustmentType(JsonField.of("usage_discount")) + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + enum class Known { + USAGE_DISCOUNT, + } + + enum class Value { + USAGE_DISCOUNT, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + USAGE_DISCOUNT -> Value.USAGE_DISCOUNT + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + USAGE_DISCOUNT -> Known.USAGE_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is NewUsageDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewPercentageDiscount{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "NewUsageDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewAmountDiscount.Builder::class) @@ -32462,6 +32755,7 @@ constructor( class NewAmountDiscount private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val amountDiscount: JsonField, private val additionalProperties: Map, @@ -32473,6 +32767,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") @@ -32482,6 +32783,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -32497,6 +32806,7 @@ constructor( fun validate(): NewAmountDiscount = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() amountDiscount() validated = true @@ -32513,6 +32823,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var amountDiscount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -32520,6 +32831,7 @@ constructor( @JvmSynthetic internal fun from(newAmountDiscount: NewAmountDiscount) = apply { this.appliesToPriceIds = newAmountDiscount.appliesToPriceIds + this.isInvoiceLevel = newAmountDiscount.isInvoiceLevel this.adjustmentType = newAmountDiscount.adjustmentType this.amountDiscount = newAmountDiscount.amountDiscount additionalProperties(newAmountDiscount.additionalProperties) @@ -32536,6 +32848,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -32572,6 +32901,7 @@ constructor( fun build(): NewAmountDiscount = NewAmountDiscount( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, amountDiscount, additionalProperties.toImmutable(), @@ -32636,17 +32966,17 @@ constructor( return true } - return /* spotless:off */ other is NewAmountDiscount && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewAmountDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewAmountDiscount{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "NewAmountDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewMinimum.Builder::class) @@ -32654,6 +32984,7 @@ constructor( class NewMinimum private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val minimumAmount: JsonField, private val itemId: JsonField, @@ -32666,6 +32997,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount") @@ -32678,6 +33016,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -32694,6 +33040,7 @@ constructor( fun validate(): NewMinimum = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() minimumAmount() itemId() @@ -32711,6 +33058,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var minimumAmount: JsonField = JsonMissing.of() private var itemId: JsonField = JsonMissing.of() @@ -32719,6 +33067,7 @@ constructor( @JvmSynthetic internal fun from(newMinimum: NewMinimum) = apply { this.appliesToPriceIds = newMinimum.appliesToPriceIds + this.isInvoiceLevel = newMinimum.isInvoiceLevel this.adjustmentType = newMinimum.adjustmentType this.minimumAmount = newMinimum.minimumAmount this.itemId = newMinimum.itemId @@ -32736,6 +33085,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -32780,6 +33146,7 @@ constructor( fun build(): NewMinimum = NewMinimum( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, minimumAmount, itemId, @@ -32844,17 +33211,17 @@ constructor( return true } - return /* spotless:off */ other is NewMinimum && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewMinimum && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewMinimum{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "NewMinimum{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewMaximum.Builder::class) @@ -32862,6 +33229,7 @@ constructor( class NewMaximum private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val maximumAmount: JsonField, private val additionalProperties: Map, @@ -32873,6 +33241,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") @@ -32882,6 +33257,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -32895,6 +33278,7 @@ constructor( fun validate(): NewMaximum = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() maximumAmount() validated = true @@ -32911,6 +33295,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var maximumAmount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -32918,6 +33303,7 @@ constructor( @JvmSynthetic internal fun from(newMaximum: NewMaximum) = apply { this.appliesToPriceIds = newMaximum.appliesToPriceIds + this.isInvoiceLevel = newMaximum.isInvoiceLevel this.adjustmentType = newMaximum.adjustmentType this.maximumAmount = newMaximum.maximumAmount additionalProperties(newMaximum.additionalProperties) @@ -32934,6 +33320,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -32970,6 +33373,7 @@ constructor( fun build(): NewMaximum = NewMaximum( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, maximumAmount, additionalProperties.toImmutable(), @@ -33033,17 +33437,17 @@ constructor( return true } - return /* spotless:off */ other is NewMaximum && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewMaximum && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewMaximum{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "NewMaximum{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponse.kt index 9b860176..72bc86a5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponse.kt @@ -1206,6 +1206,9 @@ private constructor( @NoAutoDetect class AmountDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1215,6 +1218,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1230,6 +1245,21 @@ private constructor( */ fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1256,6 +1286,9 @@ private constructor( fun validate(): AmountDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1273,6 +1306,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1281,6 +1317,9 @@ private constructor( @JvmSynthetic internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + this.id = amountDiscountAdjustment.id + this.isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = amountDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = amountDiscountAdjustment.appliesToPriceIds this.reason = amountDiscountAdjustment.reason this.adjustmentType = amountDiscountAdjustment.adjustmentType @@ -1288,6 +1327,40 @@ private constructor( additionalProperties(amountDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1350,6 +1423,9 @@ private constructor( fun build(): AmountDiscountAdjustment = AmountDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1416,23 +1492,26 @@ private constructor( return true } - return /* spotless:off */ other is AmountDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AmountDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AmountDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "AmountDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = PercentageDiscountAdjustment.Builder::class) @NoAutoDetect class PercentageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1442,6 +1521,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1458,6 +1549,21 @@ private constructor( fun percentageDiscount(): Double = percentageDiscount.getRequired("percentage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1484,6 +1590,9 @@ private constructor( fun validate(): PercentageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1501,6 +1610,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1510,6 +1622,9 @@ private constructor( @JvmSynthetic internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = apply { + this.id = percentageDiscountAdjustment.id + this.isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = percentageDiscountAdjustment.appliesToPriceIds this.reason = percentageDiscountAdjustment.reason this.adjustmentType = percentageDiscountAdjustment.adjustmentType @@ -1518,6 +1633,40 @@ private constructor( additionalProperties(percentageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1580,6 +1729,9 @@ private constructor( fun build(): PercentageDiscountAdjustment = PercentageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1647,23 +1799,26 @@ private constructor( return true } - return /* spotless:off */ other is PercentageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PercentageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PercentageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "PercentageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = UsageDiscountAdjustment.Builder::class) @NoAutoDetect class UsageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1673,6 +1828,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1688,6 +1855,21 @@ private constructor( */ fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1712,6 +1894,9 @@ private constructor( fun validate(): UsageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1729,6 +1914,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1737,6 +1925,9 @@ private constructor( @JvmSynthetic internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + this.id = usageDiscountAdjustment.id + this.isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = usageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = usageDiscountAdjustment.appliesToPriceIds this.reason = usageDiscountAdjustment.reason this.adjustmentType = usageDiscountAdjustment.adjustmentType @@ -1744,6 +1935,40 @@ private constructor( additionalProperties(usageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1806,6 +2031,9 @@ private constructor( fun build(): UsageDiscountAdjustment = UsageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1872,23 +2100,26 @@ private constructor( return true } - return /* spotless:off */ other is UsageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UsageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UsageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + "UsageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MinimumAdjustment.Builder::class) @NoAutoDetect class MinimumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1899,6 +2130,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1917,6 +2160,21 @@ private constructor( /** The item ID that revenue from this minimum will be attributed to. */ fun itemId(): String = itemId.getRequired("item_id") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1944,6 +2202,9 @@ private constructor( fun validate(): MinimumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1962,6 +2223,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1971,6 +2235,9 @@ private constructor( @JvmSynthetic internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + this.id = minimumAdjustment.id + this.isInvoiceLevel = minimumAdjustment.isInvoiceLevel + this.planPhaseOrder = minimumAdjustment.planPhaseOrder this.appliesToPriceIds = minimumAdjustment.appliesToPriceIds this.reason = minimumAdjustment.reason this.adjustmentType = minimumAdjustment.adjustmentType @@ -1979,6 +2246,40 @@ private constructor( additionalProperties(minimumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2049,6 +2350,9 @@ private constructor( fun build(): MinimumAdjustment = MinimumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2115,23 +2419,26 @@ private constructor( return true } - return /* spotless:off */ other is MinimumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MinimumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MinimumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "MinimumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MaximumAdjustment.Builder::class) @NoAutoDetect class MaximumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -2141,6 +2448,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -2156,6 +2475,21 @@ private constructor( */ fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -2180,6 +2514,9 @@ private constructor( fun validate(): MaximumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -2197,6 +2534,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -2205,6 +2545,9 @@ private constructor( @JvmSynthetic internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + this.id = maximumAdjustment.id + this.isInvoiceLevel = maximumAdjustment.isInvoiceLevel + this.planPhaseOrder = maximumAdjustment.planPhaseOrder this.appliesToPriceIds = maximumAdjustment.appliesToPriceIds this.reason = maximumAdjustment.reason this.adjustmentType = maximumAdjustment.adjustmentType @@ -2212,6 +2555,40 @@ private constructor( additionalProperties(maximumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2274,6 +2651,9 @@ private constructor( fun build(): MaximumAdjustment = MaximumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2339,17 +2719,17 @@ private constructor( return true } - return /* spotless:off */ other is MaximumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MaximumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MaximumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "MaximumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParams.kt index 2a19ccbc..b5916478 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParams.kt @@ -1336,6 +1336,7 @@ constructor( class Adjustment private constructor( private val newPercentageDiscount: NewPercentageDiscount? = null, + private val newUsageDiscount: NewUsageDiscount? = null, private val newAmountDiscount: NewAmountDiscount? = null, private val newMinimum: NewMinimum? = null, private val newMaximum: NewMaximum? = null, @@ -1347,6 +1348,9 @@ constructor( fun newPercentageDiscount(): Optional = Optional.ofNullable(newPercentageDiscount) + fun newUsageDiscount(): Optional = + Optional.ofNullable(newUsageDiscount) + fun newAmountDiscount(): Optional = Optional.ofNullable(newAmountDiscount) @@ -1356,6 +1360,8 @@ constructor( fun isNewPercentageDiscount(): Boolean = newPercentageDiscount != null + fun isNewUsageDiscount(): Boolean = newUsageDiscount != null + fun isNewAmountDiscount(): Boolean = newAmountDiscount != null fun isNewMinimum(): Boolean = newMinimum != null @@ -1365,6 +1371,9 @@ constructor( fun asNewPercentageDiscount(): NewPercentageDiscount = newPercentageDiscount.getOrThrow("newPercentageDiscount") + fun asNewUsageDiscount(): NewUsageDiscount = + newUsageDiscount.getOrThrow("newUsageDiscount") + fun asNewAmountDiscount(): NewAmountDiscount = newAmountDiscount.getOrThrow("newAmountDiscount") @@ -1378,6 +1387,7 @@ constructor( return when { newPercentageDiscount != null -> visitor.visitNewPercentageDiscount(newPercentageDiscount) + newUsageDiscount != null -> visitor.visitNewUsageDiscount(newUsageDiscount) newAmountDiscount != null -> visitor.visitNewAmountDiscount(newAmountDiscount) newMinimum != null -> visitor.visitNewMinimum(newMinimum) newMaximum != null -> visitor.visitNewMaximum(newMaximum) @@ -1389,6 +1399,7 @@ constructor( if (!validated) { if ( newPercentageDiscount == null && + newUsageDiscount == null && newAmountDiscount == null && newMinimum == null && newMaximum == null @@ -1396,6 +1407,7 @@ constructor( throw OrbInvalidDataException("Unknown Adjustment: $_json") } newPercentageDiscount?.validate() + newUsageDiscount?.validate() newAmountDiscount?.validate() newMinimum?.validate() newMaximum?.validate() @@ -1408,15 +1420,16 @@ constructor( return true } - return /* spotless:off */ other is Adjustment && newPercentageDiscount == other.newPercentageDiscount && newAmountDiscount == other.newAmountDiscount && newMinimum == other.newMinimum && newMaximum == other.newMaximum /* spotless:on */ + return /* spotless:off */ other is Adjustment && newPercentageDiscount == other.newPercentageDiscount && newUsageDiscount == other.newUsageDiscount && newAmountDiscount == other.newAmountDiscount && newMinimum == other.newMinimum && newMaximum == other.newMaximum /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPercentageDiscount, newAmountDiscount, newMinimum, newMaximum) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPercentageDiscount, newUsageDiscount, newAmountDiscount, newMinimum, newMaximum) /* spotless:on */ override fun toString(): String = when { newPercentageDiscount != null -> "Adjustment{newPercentageDiscount=$newPercentageDiscount}" + newUsageDiscount != null -> "Adjustment{newUsageDiscount=$newUsageDiscount}" newAmountDiscount != null -> "Adjustment{newAmountDiscount=$newAmountDiscount}" newMinimum != null -> "Adjustment{newMinimum=$newMinimum}" newMaximum != null -> "Adjustment{newMaximum=$newMaximum}" @@ -1430,6 +1443,10 @@ constructor( fun ofNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount) = Adjustment(newPercentageDiscount = newPercentageDiscount) + @JvmStatic + fun ofNewUsageDiscount(newUsageDiscount: NewUsageDiscount) = + Adjustment(newUsageDiscount = newUsageDiscount) + @JvmStatic fun ofNewAmountDiscount(newAmountDiscount: NewAmountDiscount) = Adjustment(newAmountDiscount = newAmountDiscount) @@ -1445,6 +1462,8 @@ constructor( fun visitNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount): T + fun visitNewUsageDiscount(newUsageDiscount: NewUsageDiscount): T + fun visitNewAmountDiscount(newAmountDiscount: NewAmountDiscount): T fun visitNewMinimum(newMinimum: NewMinimum): T @@ -1472,6 +1491,14 @@ constructor( return Adjustment(newPercentageDiscount = it, _json = json) } } + "usage_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(newUsageDiscount = it, _json = json) + } + } "amount_discount" -> { tryDeserialize(node, jacksonTypeRef()) { it.validate() @@ -1508,6 +1535,8 @@ constructor( when { value.newPercentageDiscount != null -> generator.writeObject(value.newPercentageDiscount) + value.newUsageDiscount != null -> + generator.writeObject(value.newUsageDiscount) value.newAmountDiscount != null -> generator.writeObject(value.newAmountDiscount) value.newMinimum != null -> generator.writeObject(value.newMinimum) @@ -1523,6 +1552,7 @@ constructor( class NewPercentageDiscount private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val percentageDiscount: JsonField, private val additionalProperties: Map, @@ -1534,6 +1564,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun percentageDiscount(): Double = @@ -1544,6 +1581,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -1559,6 +1604,7 @@ constructor( fun validate(): NewPercentageDiscount = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() percentageDiscount() validated = true @@ -1575,6 +1621,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var percentageDiscount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -1582,6 +1629,7 @@ constructor( @JvmSynthetic internal fun from(newPercentageDiscount: NewPercentageDiscount) = apply { this.appliesToPriceIds = newPercentageDiscount.appliesToPriceIds + this.isInvoiceLevel = newPercentageDiscount.isInvoiceLevel this.adjustmentType = newPercentageDiscount.adjustmentType this.percentageDiscount = newPercentageDiscount.percentageDiscount additionalProperties(newPercentageDiscount.additionalProperties) @@ -1598,6 +1646,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -1634,6 +1699,7 @@ constructor( fun build(): NewPercentageDiscount = NewPercentageDiscount( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, percentageDiscount, additionalProperties.toImmutable(), @@ -1699,17 +1765,244 @@ constructor( return true } - return /* spotless:off */ other is NewPercentageDiscount && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewPercentageDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, percentageDiscount, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NewPercentageDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + } + + @JsonDeserialize(builder = NewUsageDiscount.Builder::class) + @NoAutoDetect + class NewUsageDiscount + private constructor( + private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, + private val adjustmentType: JsonField, + private val usageDiscount: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + /** The set of price IDs to which this adjustment applies. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + + /** The set of price IDs to which this adjustment applies. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds() = appliesToPriceIds + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType() = adjustmentType + + @JsonProperty("usage_discount") @ExcludeMissing fun _usageDiscount() = usageDiscount + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): NewUsageDiscount = apply { + if (!validated) { + appliesToPriceIds() + isInvoiceLevel() + adjustmentType() + usageDiscount() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var adjustmentType: JsonField = JsonMissing.of() + private var usageDiscount: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(newUsageDiscount: NewUsageDiscount) = apply { + this.appliesToPriceIds = newUsageDiscount.appliesToPriceIds + this.isInvoiceLevel = newUsageDiscount.isInvoiceLevel + this.adjustmentType = newUsageDiscount.adjustmentType + this.usageDiscount = newUsageDiscount.usageDiscount + additionalProperties(newUsageDiscount.additionalProperties) + } + + /** The set of price IDs to which this adjustment applies. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The set of price IDs to which this adjustment applies. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds + } + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + fun usageDiscount(usageDiscount: Double) = + usageDiscount(JsonField.of(usageDiscount)) + + @JsonProperty("usage_discount") + @ExcludeMissing + fun usageDiscount(usageDiscount: JsonField) = apply { + this.usageDiscount = usageDiscount + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun build(): NewUsageDiscount = + NewUsageDiscount( + appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, + adjustmentType, + usageDiscount, + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField + val USAGE_DISCOUNT = AdjustmentType(JsonField.of("usage_discount")) + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + enum class Known { + USAGE_DISCOUNT, + } + + enum class Value { + USAGE_DISCOUNT, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + USAGE_DISCOUNT -> Value.USAGE_DISCOUNT + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + USAGE_DISCOUNT -> Known.USAGE_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is NewUsageDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewPercentageDiscount{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "NewUsageDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewAmountDiscount.Builder::class) @@ -1717,6 +2010,7 @@ constructor( class NewAmountDiscount private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val amountDiscount: JsonField, private val additionalProperties: Map, @@ -1728,6 +2022,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") @@ -1737,6 +2038,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -1752,6 +2061,7 @@ constructor( fun validate(): NewAmountDiscount = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() amountDiscount() validated = true @@ -1768,6 +2078,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var amountDiscount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -1775,6 +2086,7 @@ constructor( @JvmSynthetic internal fun from(newAmountDiscount: NewAmountDiscount) = apply { this.appliesToPriceIds = newAmountDiscount.appliesToPriceIds + this.isInvoiceLevel = newAmountDiscount.isInvoiceLevel this.adjustmentType = newAmountDiscount.adjustmentType this.amountDiscount = newAmountDiscount.amountDiscount additionalProperties(newAmountDiscount.additionalProperties) @@ -1791,6 +2103,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -1827,6 +2156,7 @@ constructor( fun build(): NewAmountDiscount = NewAmountDiscount( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, amountDiscount, additionalProperties.toImmutable(), @@ -1891,17 +2221,17 @@ constructor( return true } - return /* spotless:off */ other is NewAmountDiscount && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewAmountDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewAmountDiscount{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "NewAmountDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewMinimum.Builder::class) @@ -1909,6 +2239,7 @@ constructor( class NewMinimum private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val minimumAmount: JsonField, private val itemId: JsonField, @@ -1921,6 +2252,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount") @@ -1933,6 +2271,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -1949,6 +2295,7 @@ constructor( fun validate(): NewMinimum = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() minimumAmount() itemId() @@ -1966,6 +2313,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var minimumAmount: JsonField = JsonMissing.of() private var itemId: JsonField = JsonMissing.of() @@ -1974,6 +2322,7 @@ constructor( @JvmSynthetic internal fun from(newMinimum: NewMinimum) = apply { this.appliesToPriceIds = newMinimum.appliesToPriceIds + this.isInvoiceLevel = newMinimum.isInvoiceLevel this.adjustmentType = newMinimum.adjustmentType this.minimumAmount = newMinimum.minimumAmount this.itemId = newMinimum.itemId @@ -1991,6 +2340,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -2035,6 +2401,7 @@ constructor( fun build(): NewMinimum = NewMinimum( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, minimumAmount, itemId, @@ -2099,17 +2466,17 @@ constructor( return true } - return /* spotless:off */ other is NewMinimum && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewMinimum && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewMinimum{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "NewMinimum{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewMaximum.Builder::class) @@ -2117,6 +2484,7 @@ constructor( class NewMaximum private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val maximumAmount: JsonField, private val additionalProperties: Map, @@ -2128,6 +2496,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") @@ -2137,6 +2512,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -2150,6 +2533,7 @@ constructor( fun validate(): NewMaximum = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() maximumAmount() validated = true @@ -2166,6 +2550,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var maximumAmount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -2173,6 +2558,7 @@ constructor( @JvmSynthetic internal fun from(newMaximum: NewMaximum) = apply { this.appliesToPriceIds = newMaximum.appliesToPriceIds + this.isInvoiceLevel = newMaximum.isInvoiceLevel this.adjustmentType = newMaximum.adjustmentType this.maximumAmount = newMaximum.maximumAmount additionalProperties(newMaximum.additionalProperties) @@ -2189,6 +2575,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -2225,6 +2628,7 @@ constructor( fun build(): NewMaximum = NewMaximum( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, maximumAmount, additionalProperties.toImmutable(), @@ -2288,17 +2692,17 @@ constructor( return true } - return /* spotless:off */ other is NewMaximum && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewMaximum && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewMaximum{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "NewMaximum{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } @@ -2360,13 +2764,21 @@ constructor( /** The phase to add this price to. */ @JsonProperty("plan_phase_order") fun planPhaseOrder(): Long? = planPhaseOrder - /** The subscription's minimum amount for this price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this + * price. + */ @JsonProperty("minimum_amount") fun minimumAmount(): String? = minimumAmount - /** The subscription's maximum amount for this price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this + * price. + */ @JsonProperty("maximum_amount") fun maximumAmount(): String? = maximumAmount - /** The subscription's discounts for this price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this price. + */ @JsonProperty("discounts") fun discounts(): List? = discounts @JsonAnyGetter @@ -2441,15 +2853,24 @@ constructor( this.planPhaseOrder = planPhaseOrder } - /** The subscription's minimum amount for this price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this + * price. + */ @JsonProperty("minimum_amount") fun minimumAmount(minimumAmount: String) = apply { this.minimumAmount = minimumAmount } - /** The subscription's maximum amount for this price. */ - @JsonProperty("maximum_amount") + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this + * price. + */ + @JsonProperty("maximum_amount") fun maximumAmount(maximumAmount: String) = apply { this.maximumAmount = maximumAmount } - /** The subscription's discounts for this price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this + * price. + */ @JsonProperty("discounts") fun discounts(discounts: List) = apply { this.discounts = discounts } @@ -26651,6 +27072,7 @@ constructor( class Adjustment private constructor( private val newPercentageDiscount: NewPercentageDiscount? = null, + private val newUsageDiscount: NewUsageDiscount? = null, private val newAmountDiscount: NewAmountDiscount? = null, private val newMinimum: NewMinimum? = null, private val newMaximum: NewMaximum? = null, @@ -26662,6 +27084,9 @@ constructor( fun newPercentageDiscount(): Optional = Optional.ofNullable(newPercentageDiscount) + fun newUsageDiscount(): Optional = + Optional.ofNullable(newUsageDiscount) + fun newAmountDiscount(): Optional = Optional.ofNullable(newAmountDiscount) @@ -26671,6 +27096,8 @@ constructor( fun isNewPercentageDiscount(): Boolean = newPercentageDiscount != null + fun isNewUsageDiscount(): Boolean = newUsageDiscount != null + fun isNewAmountDiscount(): Boolean = newAmountDiscount != null fun isNewMinimum(): Boolean = newMinimum != null @@ -26680,6 +27107,9 @@ constructor( fun asNewPercentageDiscount(): NewPercentageDiscount = newPercentageDiscount.getOrThrow("newPercentageDiscount") + fun asNewUsageDiscount(): NewUsageDiscount = + newUsageDiscount.getOrThrow("newUsageDiscount") + fun asNewAmountDiscount(): NewAmountDiscount = newAmountDiscount.getOrThrow("newAmountDiscount") @@ -26693,6 +27123,7 @@ constructor( return when { newPercentageDiscount != null -> visitor.visitNewPercentageDiscount(newPercentageDiscount) + newUsageDiscount != null -> visitor.visitNewUsageDiscount(newUsageDiscount) newAmountDiscount != null -> visitor.visitNewAmountDiscount(newAmountDiscount) newMinimum != null -> visitor.visitNewMinimum(newMinimum) newMaximum != null -> visitor.visitNewMaximum(newMaximum) @@ -26704,6 +27135,7 @@ constructor( if (!validated) { if ( newPercentageDiscount == null && + newUsageDiscount == null && newAmountDiscount == null && newMinimum == null && newMaximum == null @@ -26711,6 +27143,7 @@ constructor( throw OrbInvalidDataException("Unknown Adjustment: $_json") } newPercentageDiscount?.validate() + newUsageDiscount?.validate() newAmountDiscount?.validate() newMinimum?.validate() newMaximum?.validate() @@ -26723,15 +27156,16 @@ constructor( return true } - return /* spotless:off */ other is Adjustment && newPercentageDiscount == other.newPercentageDiscount && newAmountDiscount == other.newAmountDiscount && newMinimum == other.newMinimum && newMaximum == other.newMaximum /* spotless:on */ + return /* spotless:off */ other is Adjustment && newPercentageDiscount == other.newPercentageDiscount && newUsageDiscount == other.newUsageDiscount && newAmountDiscount == other.newAmountDiscount && newMinimum == other.newMinimum && newMaximum == other.newMaximum /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPercentageDiscount, newAmountDiscount, newMinimum, newMaximum) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPercentageDiscount, newUsageDiscount, newAmountDiscount, newMinimum, newMaximum) /* spotless:on */ override fun toString(): String = when { newPercentageDiscount != null -> "Adjustment{newPercentageDiscount=$newPercentageDiscount}" + newUsageDiscount != null -> "Adjustment{newUsageDiscount=$newUsageDiscount}" newAmountDiscount != null -> "Adjustment{newAmountDiscount=$newAmountDiscount}" newMinimum != null -> "Adjustment{newMinimum=$newMinimum}" newMaximum != null -> "Adjustment{newMaximum=$newMaximum}" @@ -26745,6 +27179,10 @@ constructor( fun ofNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount) = Adjustment(newPercentageDiscount = newPercentageDiscount) + @JvmStatic + fun ofNewUsageDiscount(newUsageDiscount: NewUsageDiscount) = + Adjustment(newUsageDiscount = newUsageDiscount) + @JvmStatic fun ofNewAmountDiscount(newAmountDiscount: NewAmountDiscount) = Adjustment(newAmountDiscount = newAmountDiscount) @@ -26760,6 +27198,8 @@ constructor( fun visitNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount): T + fun visitNewUsageDiscount(newUsageDiscount: NewUsageDiscount): T + fun visitNewAmountDiscount(newAmountDiscount: NewAmountDiscount): T fun visitNewMinimum(newMinimum: NewMinimum): T @@ -26787,6 +27227,14 @@ constructor( return Adjustment(newPercentageDiscount = it, _json = json) } } + "usage_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(newUsageDiscount = it, _json = json) + } + } "amount_discount" -> { tryDeserialize(node, jacksonTypeRef()) { it.validate() @@ -26823,6 +27271,8 @@ constructor( when { value.newPercentageDiscount != null -> generator.writeObject(value.newPercentageDiscount) + value.newUsageDiscount != null -> + generator.writeObject(value.newUsageDiscount) value.newAmountDiscount != null -> generator.writeObject(value.newAmountDiscount) value.newMinimum != null -> generator.writeObject(value.newMinimum) @@ -26838,6 +27288,7 @@ constructor( class NewPercentageDiscount private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val percentageDiscount: JsonField, private val additionalProperties: Map, @@ -26849,6 +27300,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun percentageDiscount(): Double = @@ -26859,6 +27317,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -26874,6 +27340,7 @@ constructor( fun validate(): NewPercentageDiscount = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() percentageDiscount() validated = true @@ -26890,6 +27357,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var percentageDiscount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -26897,6 +27365,7 @@ constructor( @JvmSynthetic internal fun from(newPercentageDiscount: NewPercentageDiscount) = apply { this.appliesToPriceIds = newPercentageDiscount.appliesToPriceIds + this.isInvoiceLevel = newPercentageDiscount.isInvoiceLevel this.adjustmentType = newPercentageDiscount.adjustmentType this.percentageDiscount = newPercentageDiscount.percentageDiscount additionalProperties(newPercentageDiscount.additionalProperties) @@ -26913,6 +27382,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -26949,6 +27435,7 @@ constructor( fun build(): NewPercentageDiscount = NewPercentageDiscount( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, percentageDiscount, additionalProperties.toImmutable(), @@ -27014,17 +27501,244 @@ constructor( return true } - return /* spotless:off */ other is NewPercentageDiscount && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewPercentageDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, percentageDiscount, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NewPercentageDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + } + + @JsonDeserialize(builder = NewUsageDiscount.Builder::class) + @NoAutoDetect + class NewUsageDiscount + private constructor( + private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, + private val adjustmentType: JsonField, + private val usageDiscount: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + + /** The set of price IDs to which this adjustment applies. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + + /** The set of price IDs to which this adjustment applies. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds() = appliesToPriceIds + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType() = adjustmentType + + @JsonProperty("usage_discount") @ExcludeMissing fun _usageDiscount() = usageDiscount + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): NewUsageDiscount = apply { + if (!validated) { + appliesToPriceIds() + isInvoiceLevel() + adjustmentType() + usageDiscount() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var adjustmentType: JsonField = JsonMissing.of() + private var usageDiscount: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(newUsageDiscount: NewUsageDiscount) = apply { + this.appliesToPriceIds = newUsageDiscount.appliesToPriceIds + this.isInvoiceLevel = newUsageDiscount.isInvoiceLevel + this.adjustmentType = newUsageDiscount.adjustmentType + this.usageDiscount = newUsageDiscount.usageDiscount + additionalProperties(newUsageDiscount.additionalProperties) + } + + /** The set of price IDs to which this adjustment applies. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The set of price IDs to which this adjustment applies. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds + } + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + fun usageDiscount(usageDiscount: Double) = + usageDiscount(JsonField.of(usageDiscount)) + + @JsonProperty("usage_discount") + @ExcludeMissing + fun usageDiscount(usageDiscount: JsonField) = apply { + this.usageDiscount = usageDiscount + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + this.additionalProperties.putAll(additionalProperties) + } + + @JsonAnySetter + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + this.additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun build(): NewUsageDiscount = + NewUsageDiscount( + appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, + adjustmentType, + usageDiscount, + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField + val USAGE_DISCOUNT = AdjustmentType(JsonField.of("usage_discount")) + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + enum class Known { + USAGE_DISCOUNT, + } + + enum class Value { + USAGE_DISCOUNT, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + USAGE_DISCOUNT -> Value.USAGE_DISCOUNT + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + USAGE_DISCOUNT -> Known.USAGE_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is NewUsageDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewPercentageDiscount{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "NewUsageDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewAmountDiscount.Builder::class) @@ -27032,6 +27746,7 @@ constructor( class NewAmountDiscount private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val amountDiscount: JsonField, private val additionalProperties: Map, @@ -27043,6 +27758,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") @@ -27052,6 +27774,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -27067,6 +27797,7 @@ constructor( fun validate(): NewAmountDiscount = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() amountDiscount() validated = true @@ -27083,6 +27814,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var amountDiscount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -27090,6 +27822,7 @@ constructor( @JvmSynthetic internal fun from(newAmountDiscount: NewAmountDiscount) = apply { this.appliesToPriceIds = newAmountDiscount.appliesToPriceIds + this.isInvoiceLevel = newAmountDiscount.isInvoiceLevel this.adjustmentType = newAmountDiscount.adjustmentType this.amountDiscount = newAmountDiscount.amountDiscount additionalProperties(newAmountDiscount.additionalProperties) @@ -27106,6 +27839,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -27142,6 +27892,7 @@ constructor( fun build(): NewAmountDiscount = NewAmountDiscount( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, amountDiscount, additionalProperties.toImmutable(), @@ -27206,17 +27957,17 @@ constructor( return true } - return /* spotless:off */ other is NewAmountDiscount && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewAmountDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewAmountDiscount{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "NewAmountDiscount{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewMinimum.Builder::class) @@ -27224,6 +27975,7 @@ constructor( class NewMinimum private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val minimumAmount: JsonField, private val itemId: JsonField, @@ -27236,6 +27988,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount") @@ -27248,6 +28007,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -27264,6 +28031,7 @@ constructor( fun validate(): NewMinimum = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() minimumAmount() itemId() @@ -27281,6 +28049,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var minimumAmount: JsonField = JsonMissing.of() private var itemId: JsonField = JsonMissing.of() @@ -27289,6 +28058,7 @@ constructor( @JvmSynthetic internal fun from(newMinimum: NewMinimum) = apply { this.appliesToPriceIds = newMinimum.appliesToPriceIds + this.isInvoiceLevel = newMinimum.isInvoiceLevel this.adjustmentType = newMinimum.adjustmentType this.minimumAmount = newMinimum.minimumAmount this.itemId = newMinimum.itemId @@ -27306,6 +28076,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -27350,6 +28137,7 @@ constructor( fun build(): NewMinimum = NewMinimum( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, minimumAmount, itemId, @@ -27414,17 +28202,17 @@ constructor( return true } - return /* spotless:off */ other is NewMinimum && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewMinimum && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewMinimum{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "NewMinimum{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NewMaximum.Builder::class) @@ -27432,6 +28220,7 @@ constructor( class NewMaximum private constructor( private val appliesToPriceIds: JsonField>, + private val isInvoiceLevel: JsonField, private val adjustmentType: JsonField, private val maximumAmount: JsonField, private val additionalProperties: Map, @@ -27443,6 +28232,13 @@ constructor( fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(): Optional = + Optional.ofNullable(isInvoiceLevel.getNullable("is_invoice_level")) + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") @@ -27452,6 +28248,14 @@ constructor( @ExcludeMissing fun _appliesToPriceIds() = appliesToPriceIds + /** + * When false, this adjustment will be applied to a single price. Otherwise, it will + * be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + @JsonProperty("adjustment_type") @ExcludeMissing fun _adjustmentType() = adjustmentType @@ -27465,6 +28269,7 @@ constructor( fun validate(): NewMaximum = apply { if (!validated) { appliesToPriceIds() + isInvoiceLevel() adjustmentType() maximumAmount() validated = true @@ -27481,6 +28286,7 @@ constructor( class Builder { private var appliesToPriceIds: JsonField> = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() private var maximumAmount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -27488,6 +28294,7 @@ constructor( @JvmSynthetic internal fun from(newMaximum: NewMaximum) = apply { this.appliesToPriceIds = newMaximum.appliesToPriceIds + this.isInvoiceLevel = newMaximum.isInvoiceLevel this.adjustmentType = newMaximum.adjustmentType this.maximumAmount = newMaximum.maximumAmount additionalProperties(newMaximum.additionalProperties) @@ -27504,6 +28311,23 @@ constructor( this.appliesToPriceIds = appliesToPriceIds } + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + fun adjustmentType(adjustmentType: AdjustmentType) = adjustmentType(JsonField.of(adjustmentType)) @@ -27540,6 +28364,7 @@ constructor( fun build(): NewMaximum = NewMaximum( appliesToPriceIds.map { it.toImmutable() }, + isInvoiceLevel, adjustmentType, maximumAmount, additionalProperties.toImmutable(), @@ -27603,17 +28428,17 @@ constructor( return true } - return /* spotless:off */ other is NewMaximum && appliesToPriceIds == other.appliesToPriceIds && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewMaximum && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, isInvoiceLevel, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewMaximum{appliesToPriceIds=$appliesToPriceIds, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "NewMaximum{appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } @@ -27665,13 +28490,22 @@ constructor( /** The id of the price on the plan to replace in the subscription. */ @JsonProperty("replaces_price_id") fun replacesPriceId(): String? = replacesPriceId - /** The subscription's minimum amount for the replacement price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the + * replacement price. + */ @JsonProperty("minimum_amount") fun minimumAmount(): String? = minimumAmount - /** The subscription's maximum amount for the replacement price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the + * replacement price. + */ @JsonProperty("maximum_amount") fun maximumAmount(): String? = maximumAmount - /** The subscription's discounts for the replacement price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the + * replacement price. + */ @JsonProperty("discounts") fun discounts(): List? = discounts @JsonAnyGetter @@ -27735,15 +28569,24 @@ constructor( this.replacesPriceId = replacesPriceId } - /** The subscription's minimum amount for the replacement price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the + * replacement price. + */ @JsonProperty("minimum_amount") fun minimumAmount(minimumAmount: String) = apply { this.minimumAmount = minimumAmount } - /** The subscription's maximum amount for the replacement price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the + * replacement price. + */ @JsonProperty("maximum_amount") fun maximumAmount(maximumAmount: String) = apply { this.maximumAmount = maximumAmount } - /** The subscription's discounts for the replacement price. */ + /** + * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the + * replacement price. + */ @JsonProperty("discounts") fun discounts(discounts: List) = apply { this.discounts = discounts } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponse.kt index 512c76c4..1b4eefe9 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponse.kt @@ -1207,6 +1207,9 @@ private constructor( @NoAutoDetect class AmountDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1216,6 +1219,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1231,6 +1246,21 @@ private constructor( */ fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1257,6 +1287,9 @@ private constructor( fun validate(): AmountDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1274,6 +1307,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1282,6 +1318,9 @@ private constructor( @JvmSynthetic internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + this.id = amountDiscountAdjustment.id + this.isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = amountDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = amountDiscountAdjustment.appliesToPriceIds this.reason = amountDiscountAdjustment.reason this.adjustmentType = amountDiscountAdjustment.adjustmentType @@ -1289,6 +1328,40 @@ private constructor( additionalProperties(amountDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1351,6 +1424,9 @@ private constructor( fun build(): AmountDiscountAdjustment = AmountDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1417,23 +1493,26 @@ private constructor( return true } - return /* spotless:off */ other is AmountDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AmountDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AmountDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "AmountDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = PercentageDiscountAdjustment.Builder::class) @NoAutoDetect class PercentageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1443,6 +1522,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1459,6 +1550,21 @@ private constructor( fun percentageDiscount(): Double = percentageDiscount.getRequired("percentage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1485,6 +1591,9 @@ private constructor( fun validate(): PercentageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1502,6 +1611,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1511,6 +1623,9 @@ private constructor( @JvmSynthetic internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = apply { + this.id = percentageDiscountAdjustment.id + this.isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = percentageDiscountAdjustment.appliesToPriceIds this.reason = percentageDiscountAdjustment.reason this.adjustmentType = percentageDiscountAdjustment.adjustmentType @@ -1519,6 +1634,40 @@ private constructor( additionalProperties(percentageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1581,6 +1730,9 @@ private constructor( fun build(): PercentageDiscountAdjustment = PercentageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1648,23 +1800,26 @@ private constructor( return true } - return /* spotless:off */ other is PercentageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PercentageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PercentageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "PercentageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = UsageDiscountAdjustment.Builder::class) @NoAutoDetect class UsageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1674,6 +1829,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1689,6 +1856,21 @@ private constructor( */ fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1713,6 +1895,9 @@ private constructor( fun validate(): UsageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1730,6 +1915,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1738,6 +1926,9 @@ private constructor( @JvmSynthetic internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + this.id = usageDiscountAdjustment.id + this.isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = usageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = usageDiscountAdjustment.appliesToPriceIds this.reason = usageDiscountAdjustment.reason this.adjustmentType = usageDiscountAdjustment.adjustmentType @@ -1745,6 +1936,40 @@ private constructor( additionalProperties(usageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1807,6 +2032,9 @@ private constructor( fun build(): UsageDiscountAdjustment = UsageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1873,23 +2101,26 @@ private constructor( return true } - return /* spotless:off */ other is UsageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UsageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UsageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + "UsageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MinimumAdjustment.Builder::class) @NoAutoDetect class MinimumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1900,6 +2131,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1918,6 +2161,21 @@ private constructor( /** The item ID that revenue from this minimum will be attributed to. */ fun itemId(): String = itemId.getRequired("item_id") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1945,6 +2203,9 @@ private constructor( fun validate(): MinimumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1963,6 +2224,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1972,6 +2236,9 @@ private constructor( @JvmSynthetic internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + this.id = minimumAdjustment.id + this.isInvoiceLevel = minimumAdjustment.isInvoiceLevel + this.planPhaseOrder = minimumAdjustment.planPhaseOrder this.appliesToPriceIds = minimumAdjustment.appliesToPriceIds this.reason = minimumAdjustment.reason this.adjustmentType = minimumAdjustment.adjustmentType @@ -1980,6 +2247,40 @@ private constructor( additionalProperties(minimumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2050,6 +2351,9 @@ private constructor( fun build(): MinimumAdjustment = MinimumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2116,23 +2420,26 @@ private constructor( return true } - return /* spotless:off */ other is MinimumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MinimumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MinimumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "MinimumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MaximumAdjustment.Builder::class) @NoAutoDetect class MaximumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -2142,6 +2449,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -2157,6 +2476,21 @@ private constructor( */ fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -2181,6 +2515,9 @@ private constructor( fun validate(): MaximumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -2198,6 +2535,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -2206,6 +2546,9 @@ private constructor( @JvmSynthetic internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + this.id = maximumAdjustment.id + this.isInvoiceLevel = maximumAdjustment.isInvoiceLevel + this.planPhaseOrder = maximumAdjustment.planPhaseOrder this.appliesToPriceIds = maximumAdjustment.appliesToPriceIds this.reason = maximumAdjustment.reason this.adjustmentType = maximumAdjustment.adjustmentType @@ -2213,6 +2556,40 @@ private constructor( additionalProperties(maximumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2275,6 +2652,9 @@ private constructor( fun build(): MaximumAdjustment = MaximumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2340,17 +2720,17 @@ private constructor( return true } - return /* spotless:off */ other is MaximumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MaximumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MaximumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "MaximumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponse.kt index 835be67e..3ab70645 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponse.kt @@ -1206,6 +1206,9 @@ private constructor( @NoAutoDetect class AmountDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1215,6 +1218,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1230,6 +1245,21 @@ private constructor( */ fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1256,6 +1286,9 @@ private constructor( fun validate(): AmountDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1273,6 +1306,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1281,6 +1317,9 @@ private constructor( @JvmSynthetic internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + this.id = amountDiscountAdjustment.id + this.isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = amountDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = amountDiscountAdjustment.appliesToPriceIds this.reason = amountDiscountAdjustment.reason this.adjustmentType = amountDiscountAdjustment.adjustmentType @@ -1288,6 +1327,40 @@ private constructor( additionalProperties(amountDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1350,6 +1423,9 @@ private constructor( fun build(): AmountDiscountAdjustment = AmountDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1416,23 +1492,26 @@ private constructor( return true } - return /* spotless:off */ other is AmountDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AmountDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AmountDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "AmountDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = PercentageDiscountAdjustment.Builder::class) @NoAutoDetect class PercentageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1442,6 +1521,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1458,6 +1549,21 @@ private constructor( fun percentageDiscount(): Double = percentageDiscount.getRequired("percentage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1484,6 +1590,9 @@ private constructor( fun validate(): PercentageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1501,6 +1610,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1510,6 +1622,9 @@ private constructor( @JvmSynthetic internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = apply { + this.id = percentageDiscountAdjustment.id + this.isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = percentageDiscountAdjustment.appliesToPriceIds this.reason = percentageDiscountAdjustment.reason this.adjustmentType = percentageDiscountAdjustment.adjustmentType @@ -1518,6 +1633,40 @@ private constructor( additionalProperties(percentageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1580,6 +1729,9 @@ private constructor( fun build(): PercentageDiscountAdjustment = PercentageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1647,23 +1799,26 @@ private constructor( return true } - return /* spotless:off */ other is PercentageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PercentageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PercentageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "PercentageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = UsageDiscountAdjustment.Builder::class) @NoAutoDetect class UsageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1673,6 +1828,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1688,6 +1855,21 @@ private constructor( */ fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1712,6 +1894,9 @@ private constructor( fun validate(): UsageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1729,6 +1914,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1737,6 +1925,9 @@ private constructor( @JvmSynthetic internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + this.id = usageDiscountAdjustment.id + this.isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = usageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = usageDiscountAdjustment.appliesToPriceIds this.reason = usageDiscountAdjustment.reason this.adjustmentType = usageDiscountAdjustment.adjustmentType @@ -1744,6 +1935,40 @@ private constructor( additionalProperties(usageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1806,6 +2031,9 @@ private constructor( fun build(): UsageDiscountAdjustment = UsageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1872,23 +2100,26 @@ private constructor( return true } - return /* spotless:off */ other is UsageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UsageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UsageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + "UsageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MinimumAdjustment.Builder::class) @NoAutoDetect class MinimumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1899,6 +2130,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1917,6 +2160,21 @@ private constructor( /** The item ID that revenue from this minimum will be attributed to. */ fun itemId(): String = itemId.getRequired("item_id") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1944,6 +2202,9 @@ private constructor( fun validate(): MinimumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1962,6 +2223,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1971,6 +2235,9 @@ private constructor( @JvmSynthetic internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + this.id = minimumAdjustment.id + this.isInvoiceLevel = minimumAdjustment.isInvoiceLevel + this.planPhaseOrder = minimumAdjustment.planPhaseOrder this.appliesToPriceIds = minimumAdjustment.appliesToPriceIds this.reason = minimumAdjustment.reason this.adjustmentType = minimumAdjustment.adjustmentType @@ -1979,6 +2246,40 @@ private constructor( additionalProperties(minimumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2049,6 +2350,9 @@ private constructor( fun build(): MinimumAdjustment = MinimumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2115,23 +2419,26 @@ private constructor( return true } - return /* spotless:off */ other is MinimumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MinimumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MinimumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "MinimumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MaximumAdjustment.Builder::class) @NoAutoDetect class MaximumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -2141,6 +2448,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -2156,6 +2475,21 @@ private constructor( */ fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -2180,6 +2514,9 @@ private constructor( fun validate(): MaximumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -2197,6 +2534,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -2205,6 +2545,9 @@ private constructor( @JvmSynthetic internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + this.id = maximumAdjustment.id + this.isInvoiceLevel = maximumAdjustment.isInvoiceLevel + this.planPhaseOrder = maximumAdjustment.planPhaseOrder this.appliesToPriceIds = maximumAdjustment.appliesToPriceIds this.reason = maximumAdjustment.reason this.adjustmentType = maximumAdjustment.adjustmentType @@ -2212,6 +2555,40 @@ private constructor( additionalProperties(maximumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2274,6 +2651,9 @@ private constructor( fun build(): MaximumAdjustment = MaximumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2339,17 +2719,17 @@ private constructor( return true } - return /* spotless:off */ other is MaximumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MaximumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MaximumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "MaximumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponse.kt index 549fcf6c..fa4ab6b9 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponse.kt @@ -1209,6 +1209,9 @@ private constructor( @NoAutoDetect class AmountDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1218,6 +1221,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1233,6 +1248,21 @@ private constructor( */ fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1259,6 +1289,9 @@ private constructor( fun validate(): AmountDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1276,6 +1309,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1284,6 +1320,9 @@ private constructor( @JvmSynthetic internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + this.id = amountDiscountAdjustment.id + this.isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = amountDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = amountDiscountAdjustment.appliesToPriceIds this.reason = amountDiscountAdjustment.reason this.adjustmentType = amountDiscountAdjustment.adjustmentType @@ -1291,6 +1330,40 @@ private constructor( additionalProperties(amountDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1353,6 +1426,9 @@ private constructor( fun build(): AmountDiscountAdjustment = AmountDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1419,23 +1495,26 @@ private constructor( return true } - return /* spotless:off */ other is AmountDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AmountDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AmountDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "AmountDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = PercentageDiscountAdjustment.Builder::class) @NoAutoDetect class PercentageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1445,6 +1524,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1461,6 +1552,21 @@ private constructor( fun percentageDiscount(): Double = percentageDiscount.getRequired("percentage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1487,6 +1593,9 @@ private constructor( fun validate(): PercentageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1504,6 +1613,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1513,6 +1625,9 @@ private constructor( @JvmSynthetic internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = apply { + this.id = percentageDiscountAdjustment.id + this.isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = percentageDiscountAdjustment.appliesToPriceIds this.reason = percentageDiscountAdjustment.reason this.adjustmentType = percentageDiscountAdjustment.adjustmentType @@ -1521,6 +1636,40 @@ private constructor( additionalProperties(percentageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1583,6 +1732,9 @@ private constructor( fun build(): PercentageDiscountAdjustment = PercentageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1650,23 +1802,26 @@ private constructor( return true } - return /* spotless:off */ other is PercentageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PercentageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PercentageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "PercentageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = UsageDiscountAdjustment.Builder::class) @NoAutoDetect class UsageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1676,6 +1831,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1691,6 +1858,21 @@ private constructor( */ fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1715,6 +1897,9 @@ private constructor( fun validate(): UsageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1732,6 +1917,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1740,6 +1928,9 @@ private constructor( @JvmSynthetic internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + this.id = usageDiscountAdjustment.id + this.isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = usageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = usageDiscountAdjustment.appliesToPriceIds this.reason = usageDiscountAdjustment.reason this.adjustmentType = usageDiscountAdjustment.adjustmentType @@ -1747,6 +1938,40 @@ private constructor( additionalProperties(usageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1809,6 +2034,9 @@ private constructor( fun build(): UsageDiscountAdjustment = UsageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1875,23 +2103,26 @@ private constructor( return true } - return /* spotless:off */ other is UsageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UsageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UsageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + "UsageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MinimumAdjustment.Builder::class) @NoAutoDetect class MinimumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1902,6 +2133,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1920,6 +2163,21 @@ private constructor( /** The item ID that revenue from this minimum will be attributed to. */ fun itemId(): String = itemId.getRequired("item_id") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1947,6 +2205,9 @@ private constructor( fun validate(): MinimumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1965,6 +2226,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1974,6 +2238,9 @@ private constructor( @JvmSynthetic internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + this.id = minimumAdjustment.id + this.isInvoiceLevel = minimumAdjustment.isInvoiceLevel + this.planPhaseOrder = minimumAdjustment.planPhaseOrder this.appliesToPriceIds = minimumAdjustment.appliesToPriceIds this.reason = minimumAdjustment.reason this.adjustmentType = minimumAdjustment.adjustmentType @@ -1982,6 +2249,40 @@ private constructor( additionalProperties(minimumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2052,6 +2353,9 @@ private constructor( fun build(): MinimumAdjustment = MinimumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2118,23 +2422,26 @@ private constructor( return true } - return /* spotless:off */ other is MinimumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MinimumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MinimumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "MinimumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MaximumAdjustment.Builder::class) @NoAutoDetect class MaximumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -2144,6 +2451,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -2159,6 +2478,21 @@ private constructor( */ fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -2183,6 +2517,9 @@ private constructor( fun validate(): MaximumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -2200,6 +2537,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -2208,6 +2548,9 @@ private constructor( @JvmSynthetic internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + this.id = maximumAdjustment.id + this.isInvoiceLevel = maximumAdjustment.isInvoiceLevel + this.planPhaseOrder = maximumAdjustment.planPhaseOrder this.appliesToPriceIds = maximumAdjustment.appliesToPriceIds this.reason = maximumAdjustment.reason this.adjustmentType = maximumAdjustment.adjustmentType @@ -2215,6 +2558,40 @@ private constructor( additionalProperties(maximumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2277,6 +2654,9 @@ private constructor( fun build(): MaximumAdjustment = MaximumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2342,17 +2722,17 @@ private constructor( return true } - return /* spotless:off */ other is MaximumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MaximumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MaximumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "MaximumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.kt index 0f0ce750..3522fb44 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.kt @@ -1222,6 +1222,9 @@ private constructor( @NoAutoDetect class AmountDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1231,6 +1234,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1246,6 +1261,21 @@ private constructor( */ fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1272,6 +1302,9 @@ private constructor( fun validate(): AmountDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1289,6 +1322,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1297,6 +1333,9 @@ private constructor( @JvmSynthetic internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + this.id = amountDiscountAdjustment.id + this.isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = amountDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = amountDiscountAdjustment.appliesToPriceIds this.reason = amountDiscountAdjustment.reason this.adjustmentType = amountDiscountAdjustment.adjustmentType @@ -1304,6 +1343,40 @@ private constructor( additionalProperties(amountDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1366,6 +1439,9 @@ private constructor( fun build(): AmountDiscountAdjustment = AmountDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1432,23 +1508,26 @@ private constructor( return true } - return /* spotless:off */ other is AmountDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AmountDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AmountDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "AmountDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = PercentageDiscountAdjustment.Builder::class) @NoAutoDetect class PercentageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1458,6 +1537,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1474,6 +1565,21 @@ private constructor( fun percentageDiscount(): Double = percentageDiscount.getRequired("percentage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1500,6 +1606,9 @@ private constructor( fun validate(): PercentageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1517,6 +1626,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1526,6 +1638,9 @@ private constructor( @JvmSynthetic internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = apply { + this.id = percentageDiscountAdjustment.id + this.isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = percentageDiscountAdjustment.appliesToPriceIds this.reason = percentageDiscountAdjustment.reason this.adjustmentType = percentageDiscountAdjustment.adjustmentType @@ -1534,6 +1649,40 @@ private constructor( additionalProperties(percentageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1596,6 +1745,9 @@ private constructor( fun build(): PercentageDiscountAdjustment = PercentageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1663,23 +1815,26 @@ private constructor( return true } - return /* spotless:off */ other is PercentageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PercentageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PercentageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "PercentageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = UsageDiscountAdjustment.Builder::class) @NoAutoDetect class UsageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1689,6 +1844,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1704,6 +1871,21 @@ private constructor( */ fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1728,6 +1910,9 @@ private constructor( fun validate(): UsageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1745,6 +1930,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1753,6 +1941,9 @@ private constructor( @JvmSynthetic internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + this.id = usageDiscountAdjustment.id + this.isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = usageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = usageDiscountAdjustment.appliesToPriceIds this.reason = usageDiscountAdjustment.reason this.adjustmentType = usageDiscountAdjustment.adjustmentType @@ -1760,6 +1951,40 @@ private constructor( additionalProperties(usageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1822,6 +2047,9 @@ private constructor( fun build(): UsageDiscountAdjustment = UsageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1888,23 +2116,26 @@ private constructor( return true } - return /* spotless:off */ other is UsageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UsageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UsageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + "UsageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MinimumAdjustment.Builder::class) @NoAutoDetect class MinimumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1915,6 +2146,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1933,6 +2176,21 @@ private constructor( /** The item ID that revenue from this minimum will be attributed to. */ fun itemId(): String = itemId.getRequired("item_id") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1960,6 +2218,9 @@ private constructor( fun validate(): MinimumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1978,6 +2239,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1987,6 +2251,9 @@ private constructor( @JvmSynthetic internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + this.id = minimumAdjustment.id + this.isInvoiceLevel = minimumAdjustment.isInvoiceLevel + this.planPhaseOrder = minimumAdjustment.planPhaseOrder this.appliesToPriceIds = minimumAdjustment.appliesToPriceIds this.reason = minimumAdjustment.reason this.adjustmentType = minimumAdjustment.adjustmentType @@ -1995,6 +2262,40 @@ private constructor( additionalProperties(minimumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2065,6 +2366,9 @@ private constructor( fun build(): MinimumAdjustment = MinimumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2131,23 +2435,26 @@ private constructor( return true } - return /* spotless:off */ other is MinimumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MinimumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MinimumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "MinimumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MaximumAdjustment.Builder::class) @NoAutoDetect class MaximumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -2157,6 +2464,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -2172,6 +2491,21 @@ private constructor( */ fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -2196,6 +2530,9 @@ private constructor( fun validate(): MaximumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -2213,6 +2550,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -2221,6 +2561,9 @@ private constructor( @JvmSynthetic internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + this.id = maximumAdjustment.id + this.isInvoiceLevel = maximumAdjustment.isInvoiceLevel + this.planPhaseOrder = maximumAdjustment.planPhaseOrder this.appliesToPriceIds = maximumAdjustment.appliesToPriceIds this.reason = maximumAdjustment.reason this.adjustmentType = maximumAdjustment.adjustmentType @@ -2228,6 +2571,40 @@ private constructor( additionalProperties(maximumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2290,6 +2667,9 @@ private constructor( fun build(): MaximumAdjustment = MaximumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2355,17 +2735,17 @@ private constructor( return true } - return /* spotless:off */ other is MaximumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MaximumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MaximumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "MaximumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponse.kt index 7d8a90eb..934f0d4a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponse.kt @@ -1217,6 +1217,9 @@ private constructor( @NoAutoDetect class AmountDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1226,6 +1229,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1241,6 +1256,21 @@ private constructor( */ fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1267,6 +1297,9 @@ private constructor( fun validate(): AmountDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1284,6 +1317,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1292,6 +1328,9 @@ private constructor( @JvmSynthetic internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + this.id = amountDiscountAdjustment.id + this.isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = amountDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = amountDiscountAdjustment.appliesToPriceIds this.reason = amountDiscountAdjustment.reason this.adjustmentType = amountDiscountAdjustment.adjustmentType @@ -1299,6 +1338,40 @@ private constructor( additionalProperties(amountDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1361,6 +1434,9 @@ private constructor( fun build(): AmountDiscountAdjustment = AmountDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1427,23 +1503,26 @@ private constructor( return true } - return /* spotless:off */ other is AmountDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AmountDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AmountDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "AmountDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = PercentageDiscountAdjustment.Builder::class) @NoAutoDetect class PercentageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1453,6 +1532,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1469,6 +1560,21 @@ private constructor( fun percentageDiscount(): Double = percentageDiscount.getRequired("percentage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1495,6 +1601,9 @@ private constructor( fun validate(): PercentageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1512,6 +1621,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1521,6 +1633,9 @@ private constructor( @JvmSynthetic internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = apply { + this.id = percentageDiscountAdjustment.id + this.isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = percentageDiscountAdjustment.appliesToPriceIds this.reason = percentageDiscountAdjustment.reason this.adjustmentType = percentageDiscountAdjustment.adjustmentType @@ -1529,6 +1644,40 @@ private constructor( additionalProperties(percentageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1591,6 +1740,9 @@ private constructor( fun build(): PercentageDiscountAdjustment = PercentageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1658,23 +1810,26 @@ private constructor( return true } - return /* spotless:off */ other is PercentageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PercentageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PercentageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "PercentageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = UsageDiscountAdjustment.Builder::class) @NoAutoDetect class UsageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1684,6 +1839,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1699,6 +1866,21 @@ private constructor( */ fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1723,6 +1905,9 @@ private constructor( fun validate(): UsageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1740,6 +1925,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1748,6 +1936,9 @@ private constructor( @JvmSynthetic internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + this.id = usageDiscountAdjustment.id + this.isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = usageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = usageDiscountAdjustment.appliesToPriceIds this.reason = usageDiscountAdjustment.reason this.adjustmentType = usageDiscountAdjustment.adjustmentType @@ -1755,6 +1946,40 @@ private constructor( additionalProperties(usageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1817,6 +2042,9 @@ private constructor( fun build(): UsageDiscountAdjustment = UsageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1883,23 +2111,26 @@ private constructor( return true } - return /* spotless:off */ other is UsageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UsageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UsageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + "UsageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MinimumAdjustment.Builder::class) @NoAutoDetect class MinimumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1910,6 +2141,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1928,6 +2171,21 @@ private constructor( /** The item ID that revenue from this minimum will be attributed to. */ fun itemId(): String = itemId.getRequired("item_id") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1955,6 +2213,9 @@ private constructor( fun validate(): MinimumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1973,6 +2234,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1982,6 +2246,9 @@ private constructor( @JvmSynthetic internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + this.id = minimumAdjustment.id + this.isInvoiceLevel = minimumAdjustment.isInvoiceLevel + this.planPhaseOrder = minimumAdjustment.planPhaseOrder this.appliesToPriceIds = minimumAdjustment.appliesToPriceIds this.reason = minimumAdjustment.reason this.adjustmentType = minimumAdjustment.adjustmentType @@ -1990,6 +2257,40 @@ private constructor( additionalProperties(minimumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2060,6 +2361,9 @@ private constructor( fun build(): MinimumAdjustment = MinimumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2126,23 +2430,26 @@ private constructor( return true } - return /* spotless:off */ other is MinimumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MinimumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MinimumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "MinimumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MaximumAdjustment.Builder::class) @NoAutoDetect class MaximumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -2152,6 +2459,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -2167,6 +2486,21 @@ private constructor( */ fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -2191,6 +2525,9 @@ private constructor( fun validate(): MaximumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -2208,6 +2545,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -2216,6 +2556,9 @@ private constructor( @JvmSynthetic internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + this.id = maximumAdjustment.id + this.isInvoiceLevel = maximumAdjustment.isInvoiceLevel + this.planPhaseOrder = maximumAdjustment.planPhaseOrder this.appliesToPriceIds = maximumAdjustment.appliesToPriceIds this.reason = maximumAdjustment.reason this.adjustmentType = maximumAdjustment.adjustmentType @@ -2223,6 +2566,40 @@ private constructor( additionalProperties(maximumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2285,6 +2662,9 @@ private constructor( fun build(): MaximumAdjustment = MaximumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2350,17 +2730,17 @@ private constructor( return true } - return /* spotless:off */ other is MaximumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MaximumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MaximumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "MaximumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponse.kt index f8272cb3..86b91932 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponse.kt @@ -1209,6 +1209,9 @@ private constructor( @NoAutoDetect class AmountDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1218,6 +1221,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1233,6 +1248,21 @@ private constructor( */ fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1259,6 +1289,9 @@ private constructor( fun validate(): AmountDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1276,6 +1309,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1284,6 +1320,9 @@ private constructor( @JvmSynthetic internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + this.id = amountDiscountAdjustment.id + this.isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = amountDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = amountDiscountAdjustment.appliesToPriceIds this.reason = amountDiscountAdjustment.reason this.adjustmentType = amountDiscountAdjustment.adjustmentType @@ -1291,6 +1330,40 @@ private constructor( additionalProperties(amountDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1353,6 +1426,9 @@ private constructor( fun build(): AmountDiscountAdjustment = AmountDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1419,23 +1495,26 @@ private constructor( return true } - return /* spotless:off */ other is AmountDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AmountDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AmountDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "AmountDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = PercentageDiscountAdjustment.Builder::class) @NoAutoDetect class PercentageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1445,6 +1524,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1461,6 +1552,21 @@ private constructor( fun percentageDiscount(): Double = percentageDiscount.getRequired("percentage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1487,6 +1593,9 @@ private constructor( fun validate(): PercentageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1504,6 +1613,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1513,6 +1625,9 @@ private constructor( @JvmSynthetic internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = apply { + this.id = percentageDiscountAdjustment.id + this.isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = percentageDiscountAdjustment.appliesToPriceIds this.reason = percentageDiscountAdjustment.reason this.adjustmentType = percentageDiscountAdjustment.adjustmentType @@ -1521,6 +1636,40 @@ private constructor( additionalProperties(percentageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1583,6 +1732,9 @@ private constructor( fun build(): PercentageDiscountAdjustment = PercentageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1650,23 +1802,26 @@ private constructor( return true } - return /* spotless:off */ other is PercentageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PercentageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PercentageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "PercentageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = UsageDiscountAdjustment.Builder::class) @NoAutoDetect class UsageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1676,6 +1831,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1691,6 +1858,21 @@ private constructor( */ fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1715,6 +1897,9 @@ private constructor( fun validate(): UsageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1732,6 +1917,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1740,6 +1928,9 @@ private constructor( @JvmSynthetic internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + this.id = usageDiscountAdjustment.id + this.isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = usageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = usageDiscountAdjustment.appliesToPriceIds this.reason = usageDiscountAdjustment.reason this.adjustmentType = usageDiscountAdjustment.adjustmentType @@ -1747,6 +1938,40 @@ private constructor( additionalProperties(usageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1809,6 +2034,9 @@ private constructor( fun build(): UsageDiscountAdjustment = UsageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1875,23 +2103,26 @@ private constructor( return true } - return /* spotless:off */ other is UsageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UsageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UsageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + "UsageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MinimumAdjustment.Builder::class) @NoAutoDetect class MinimumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1902,6 +2133,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1920,6 +2163,21 @@ private constructor( /** The item ID that revenue from this minimum will be attributed to. */ fun itemId(): String = itemId.getRequired("item_id") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1947,6 +2205,9 @@ private constructor( fun validate(): MinimumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1965,6 +2226,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1974,6 +2238,9 @@ private constructor( @JvmSynthetic internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + this.id = minimumAdjustment.id + this.isInvoiceLevel = minimumAdjustment.isInvoiceLevel + this.planPhaseOrder = minimumAdjustment.planPhaseOrder this.appliesToPriceIds = minimumAdjustment.appliesToPriceIds this.reason = minimumAdjustment.reason this.adjustmentType = minimumAdjustment.adjustmentType @@ -1982,6 +2249,40 @@ private constructor( additionalProperties(minimumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2052,6 +2353,9 @@ private constructor( fun build(): MinimumAdjustment = MinimumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2118,23 +2422,26 @@ private constructor( return true } - return /* spotless:off */ other is MinimumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MinimumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MinimumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "MinimumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MaximumAdjustment.Builder::class) @NoAutoDetect class MaximumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -2144,6 +2451,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -2159,6 +2478,21 @@ private constructor( */ fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -2183,6 +2517,9 @@ private constructor( fun validate(): MaximumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -2200,6 +2537,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -2208,6 +2548,9 @@ private constructor( @JvmSynthetic internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + this.id = maximumAdjustment.id + this.isInvoiceLevel = maximumAdjustment.isInvoiceLevel + this.planPhaseOrder = maximumAdjustment.planPhaseOrder this.appliesToPriceIds = maximumAdjustment.appliesToPriceIds this.reason = maximumAdjustment.reason this.adjustmentType = maximumAdjustment.adjustmentType @@ -2215,6 +2558,40 @@ private constructor( additionalProperties(maximumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2277,6 +2654,9 @@ private constructor( fun build(): MaximumAdjustment = MaximumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2342,17 +2722,17 @@ private constructor( return true } - return /* spotless:off */ other is MaximumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MaximumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MaximumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "MaximumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponse.kt index 5dc0fced..11d3ea97 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponse.kt @@ -1206,6 +1206,9 @@ private constructor( @NoAutoDetect class AmountDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1215,6 +1218,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1230,6 +1245,21 @@ private constructor( */ fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1256,6 +1286,9 @@ private constructor( fun validate(): AmountDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1273,6 +1306,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1281,6 +1317,9 @@ private constructor( @JvmSynthetic internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + this.id = amountDiscountAdjustment.id + this.isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = amountDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = amountDiscountAdjustment.appliesToPriceIds this.reason = amountDiscountAdjustment.reason this.adjustmentType = amountDiscountAdjustment.adjustmentType @@ -1288,6 +1327,40 @@ private constructor( additionalProperties(amountDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1350,6 +1423,9 @@ private constructor( fun build(): AmountDiscountAdjustment = AmountDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1416,23 +1492,26 @@ private constructor( return true } - return /* spotless:off */ other is AmountDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AmountDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, amountDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AmountDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" + "AmountDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = PercentageDiscountAdjustment.Builder::class) @NoAutoDetect class PercentageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1442,6 +1521,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1458,6 +1549,21 @@ private constructor( fun percentageDiscount(): Double = percentageDiscount.getRequired("percentage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1484,6 +1590,9 @@ private constructor( fun validate(): PercentageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1501,6 +1610,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1510,6 +1622,9 @@ private constructor( @JvmSynthetic internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = apply { + this.id = percentageDiscountAdjustment.id + this.isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = percentageDiscountAdjustment.appliesToPriceIds this.reason = percentageDiscountAdjustment.reason this.adjustmentType = percentageDiscountAdjustment.adjustmentType @@ -1518,6 +1633,40 @@ private constructor( additionalProperties(percentageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1580,6 +1729,9 @@ private constructor( fun build(): PercentageDiscountAdjustment = PercentageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1647,23 +1799,26 @@ private constructor( return true } - return /* spotless:off */ other is PercentageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PercentageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, percentageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PercentageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + "PercentageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = UsageDiscountAdjustment.Builder::class) @NoAutoDetect class UsageDiscountAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1673,6 +1828,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1688,6 +1855,21 @@ private constructor( */ fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1712,6 +1894,9 @@ private constructor( fun validate(): UsageDiscountAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1729,6 +1914,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1737,6 +1925,9 @@ private constructor( @JvmSynthetic internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + this.id = usageDiscountAdjustment.id + this.isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + this.planPhaseOrder = usageDiscountAdjustment.planPhaseOrder this.appliesToPriceIds = usageDiscountAdjustment.appliesToPriceIds this.reason = usageDiscountAdjustment.reason this.adjustmentType = usageDiscountAdjustment.adjustmentType @@ -1744,6 +1935,40 @@ private constructor( additionalProperties(usageDiscountAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -1806,6 +2031,9 @@ private constructor( fun build(): UsageDiscountAdjustment = UsageDiscountAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -1872,23 +2100,26 @@ private constructor( return true } - return /* spotless:off */ other is UsageDiscountAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UsageDiscountAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, usageDiscount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UsageDiscountAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + "UsageDiscountAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MinimumAdjustment.Builder::class) @NoAutoDetect class MinimumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -1899,6 +2130,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -1917,6 +2160,21 @@ private constructor( /** The item ID that revenue from this minimum will be attributed to. */ fun itemId(): String = itemId.getRequired("item_id") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -1944,6 +2202,9 @@ private constructor( fun validate(): MinimumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -1962,6 +2223,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -1971,6 +2235,9 @@ private constructor( @JvmSynthetic internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + this.id = minimumAdjustment.id + this.isInvoiceLevel = minimumAdjustment.isInvoiceLevel + this.planPhaseOrder = minimumAdjustment.planPhaseOrder this.appliesToPriceIds = minimumAdjustment.appliesToPriceIds this.reason = minimumAdjustment.reason this.adjustmentType = minimumAdjustment.adjustmentType @@ -1979,6 +2246,40 @@ private constructor( additionalProperties(minimumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2049,6 +2350,9 @@ private constructor( fun build(): MinimumAdjustment = MinimumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2115,23 +2419,26 @@ private constructor( return true } - return /* spotless:off */ other is MinimumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MinimumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && minimumAmount == other.minimumAmount && itemId == other.itemId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, minimumAmount, itemId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MinimumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" + "MinimumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, minimumAmount=$minimumAmount, itemId=$itemId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = MaximumAdjustment.Builder::class) @NoAutoDetect class MaximumAdjustment private constructor( + private val id: JsonField, + private val isInvoiceLevel: JsonField, + private val planPhaseOrder: JsonField, private val appliesToPriceIds: JsonField>, private val reason: JsonField, private val adjustmentType: JsonField, @@ -2141,6 +2448,18 @@ private constructor( private var validated: Boolean = false + fun id(): String = id.getRequired("id") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(): List = appliesToPriceIds.getRequired("applies_to_price_ids") @@ -2156,6 +2475,21 @@ private constructor( */ fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + @JsonProperty("id") @ExcludeMissing fun _id() = id + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel() = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder() = planPhaseOrder + /** The price IDs that this adjustment applies to. */ @JsonProperty("applies_to_price_ids") @ExcludeMissing @@ -2180,6 +2514,9 @@ private constructor( fun validate(): MaximumAdjustment = apply { if (!validated) { + id() + isInvoiceLevel() + planPhaseOrder() appliesToPriceIds() reason() adjustmentType() @@ -2197,6 +2534,9 @@ private constructor( class Builder { + private var id: JsonField = JsonMissing.of() + private var isInvoiceLevel: JsonField = JsonMissing.of() + private var planPhaseOrder: JsonField = JsonMissing.of() private var appliesToPriceIds: JsonField> = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var adjustmentType: JsonField = JsonMissing.of() @@ -2205,6 +2545,9 @@ private constructor( @JvmSynthetic internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + this.id = maximumAdjustment.id + this.isInvoiceLevel = maximumAdjustment.isInvoiceLevel + this.planPhaseOrder = maximumAdjustment.planPhaseOrder this.appliesToPriceIds = maximumAdjustment.appliesToPriceIds this.reason = maximumAdjustment.reason this.adjustmentType = maximumAdjustment.adjustmentType @@ -2212,6 +2555,40 @@ private constructor( additionalProperties(maximumAdjustment.additionalProperties) } + fun id(id: String) = id(JsonField.of(id)) + + @JsonProperty("id") + @ExcludeMissing + fun id(id: JsonField) = apply { this.id = id } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(JsonField.of(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + /** The price IDs that this adjustment applies to. */ fun appliesToPriceIds(appliesToPriceIds: List) = appliesToPriceIds(JsonField.of(appliesToPriceIds)) @@ -2274,6 +2651,9 @@ private constructor( fun build(): MaximumAdjustment = MaximumAdjustment( + id, + isInvoiceLevel, + planPhaseOrder, appliesToPriceIds.map { it.toImmutable() }, reason, adjustmentType, @@ -2339,17 +2719,17 @@ private constructor( return true } - return /* spotless:off */ other is MaximumAdjustment && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MaximumAdjustment && id == other.id && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && appliesToPriceIds == other.appliesToPriceIds && reason == other.reason && adjustmentType == other.adjustmentType && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, isInvoiceLevel, planPhaseOrder, appliesToPriceIds, reason, adjustmentType, maximumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MaximumAdjustment{appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" + "MaximumAdjustment{id=$id, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, appliesToPriceIds=$appliesToPriceIds, reason=$reason, adjustmentType=$adjustmentType, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanTest.kt index a60385ea..a00991a0 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanTest.kt @@ -13,6 +13,24 @@ class PlanTest { val plan = Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") @@ -187,6 +205,22 @@ class PlanTest { .build() assertThat(plan).isNotNull assertThat(plan.id()).isEqualTo("id") + assertThat(plan.adjustments()) + .containsExactly( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType.AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) assertThat(plan.basePlan()) .contains( Plan.BasePlan.builder() diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCancelResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCancelResponseTest.kt index 484c225a..afb2e4a5 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCancelResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCancelResponseTest.kt @@ -24,6 +24,7 @@ class SubscriptionCancelResponseTest { SubscriptionCancelResponse.AdjustmentInterval.Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionCancelResponse.AdjustmentInterval .Adjustment @@ -33,6 +34,8 @@ class SubscriptionCancelResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -184,6 +187,24 @@ class SubscriptionCancelResponseTest { .plan( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") @@ -511,6 +532,7 @@ class SubscriptionCancelResponseTest { SubscriptionCancelResponse.AdjustmentInterval.Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionCancelResponse.AdjustmentInterval.Adjustment .AmountDiscountAdjustment @@ -519,6 +541,8 @@ class SubscriptionCancelResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -670,6 +694,24 @@ class SubscriptionCancelResponseTest { .isEqualTo( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateParamsTest.kt index 5ff8ed1e..0dd11732 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateParamsTest.kt @@ -30,6 +30,7 @@ class SubscriptionCreateParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -199,6 +200,7 @@ class SubscriptionCreateParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -331,6 +333,7 @@ class SubscriptionCreateParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -501,6 +504,7 @@ class SubscriptionCreateParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -633,6 +637,7 @@ class SubscriptionCreateParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -809,6 +814,7 @@ class SubscriptionCreateParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateResponseTest.kt index c681c7b1..59ac3928 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateResponseTest.kt @@ -24,6 +24,7 @@ class SubscriptionCreateResponseTest { SubscriptionCreateResponse.AdjustmentInterval.Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionCreateResponse.AdjustmentInterval .Adjustment @@ -33,6 +34,8 @@ class SubscriptionCreateResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -184,6 +187,24 @@ class SubscriptionCreateResponseTest { .plan( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") @@ -511,6 +532,7 @@ class SubscriptionCreateResponseTest { SubscriptionCreateResponse.AdjustmentInterval.Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionCreateResponse.AdjustmentInterval.Adjustment .AmountDiscountAdjustment @@ -519,6 +541,8 @@ class SubscriptionCreateResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -670,6 +694,24 @@ class SubscriptionCreateResponseTest { .isEqualTo( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParamsTest.kt index f842d3f9..42e3b819 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParamsTest.kt @@ -162,6 +162,7 @@ class SubscriptionPriceIntervalsParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -381,6 +382,7 @@ class SubscriptionPriceIntervalsParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -596,6 +598,7 @@ class SubscriptionPriceIntervalsParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponseTest.kt index aff34cfe..cd0ee26c 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponseTest.kt @@ -25,6 +25,7 @@ class SubscriptionPriceIntervalsResponseTest { .Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionPriceIntervalsResponse .AdjustmentInterval @@ -35,6 +36,8 @@ class SubscriptionPriceIntervalsResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -188,6 +191,24 @@ class SubscriptionPriceIntervalsResponseTest { .plan( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") @@ -515,6 +536,7 @@ class SubscriptionPriceIntervalsResponseTest { SubscriptionPriceIntervalsResponse.AdjustmentInterval.Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionPriceIntervalsResponse.AdjustmentInterval .Adjustment @@ -524,6 +546,8 @@ class SubscriptionPriceIntervalsResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -679,6 +703,24 @@ class SubscriptionPriceIntervalsResponseTest { .isEqualTo( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParamsTest.kt index afb1e0e8..24087f7a 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParamsTest.kt @@ -33,6 +33,7 @@ class SubscriptionSchedulePlanChangeParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -206,6 +207,7 @@ class SubscriptionSchedulePlanChangeParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -348,6 +350,7 @@ class SubscriptionSchedulePlanChangeParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -524,6 +527,7 @@ class SubscriptionSchedulePlanChangeParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -670,6 +674,7 @@ class SubscriptionSchedulePlanChangeParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -847,6 +852,7 @@ class SubscriptionSchedulePlanChangeParamsTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponseTest.kt index 74b51ad9..7440256e 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponseTest.kt @@ -25,6 +25,7 @@ class SubscriptionSchedulePlanChangeResponseTest { .Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionSchedulePlanChangeResponse .AdjustmentInterval @@ -35,6 +36,8 @@ class SubscriptionSchedulePlanChangeResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -188,6 +191,24 @@ class SubscriptionSchedulePlanChangeResponseTest { .plan( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") @@ -515,6 +536,7 @@ class SubscriptionSchedulePlanChangeResponseTest { SubscriptionSchedulePlanChangeResponse.AdjustmentInterval.Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionSchedulePlanChangeResponse.AdjustmentInterval .Adjustment @@ -524,6 +546,8 @@ class SubscriptionSchedulePlanChangeResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -679,6 +703,24 @@ class SubscriptionSchedulePlanChangeResponseTest { .isEqualTo( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTest.kt index f9585e9a..433a9d1d 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTest.kt @@ -24,6 +24,7 @@ class SubscriptionTest { Subscription.AdjustmentInterval.Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( Subscription.AdjustmentInterval.Adjustment .AmountDiscountAdjustment @@ -32,6 +33,8 @@ class SubscriptionTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -181,6 +184,24 @@ class SubscriptionTest { .plan( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") @@ -504,6 +525,7 @@ class SubscriptionTest { Subscription.AdjustmentInterval.Adjustment.ofAmountDiscountAdjustment( Subscription.AdjustmentInterval.Adjustment.AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( Subscription.AdjustmentInterval.Adjustment .AmountDiscountAdjustment @@ -512,6 +534,8 @@ class SubscriptionTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -660,6 +684,24 @@ class SubscriptionTest { .isEqualTo( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponseTest.kt index cae7cfc5..78f98908 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponseTest.kt @@ -25,6 +25,7 @@ class SubscriptionTriggerPhaseResponseTest { .Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionTriggerPhaseResponse.AdjustmentInterval .Adjustment @@ -34,6 +35,8 @@ class SubscriptionTriggerPhaseResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -185,6 +188,24 @@ class SubscriptionTriggerPhaseResponseTest { .plan( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") @@ -512,6 +533,7 @@ class SubscriptionTriggerPhaseResponseTest { SubscriptionTriggerPhaseResponse.AdjustmentInterval.Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionTriggerPhaseResponse.AdjustmentInterval .Adjustment @@ -521,6 +543,8 @@ class SubscriptionTriggerPhaseResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -675,6 +699,24 @@ class SubscriptionTriggerPhaseResponseTest { .isEqualTo( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponseTest.kt index 63eaa454..e5fe2d8a 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponseTest.kt @@ -27,6 +27,7 @@ class SubscriptionUnscheduleCancellationResponseTest { .Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionUnscheduleCancellationResponse .AdjustmentInterval @@ -37,6 +38,8 @@ class SubscriptionUnscheduleCancellationResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -192,6 +195,24 @@ class SubscriptionUnscheduleCancellationResponseTest { .plan( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") @@ -520,6 +541,7 @@ class SubscriptionUnscheduleCancellationResponseTest { .Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionUnscheduleCancellationResponse .AdjustmentInterval @@ -530,6 +552,8 @@ class SubscriptionUnscheduleCancellationResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -687,6 +711,24 @@ class SubscriptionUnscheduleCancellationResponseTest { .isEqualTo( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest.kt index adc43838..b6d6d145 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest.kt @@ -29,6 +29,7 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest { .Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse .AdjustmentInterval @@ -39,6 +40,8 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -202,6 +205,24 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest { .plan( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") @@ -535,6 +556,7 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest { .Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse .AdjustmentInterval @@ -545,6 +567,8 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -718,6 +742,24 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest { .isEqualTo( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponseTest.kt index a50a537a..86d4700a 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponseTest.kt @@ -28,6 +28,7 @@ class SubscriptionUnschedulePendingPlanChangesResponseTest { .Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionUnschedulePendingPlanChangesResponse .AdjustmentInterval @@ -38,6 +39,8 @@ class SubscriptionUnschedulePendingPlanChangesResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -196,6 +199,24 @@ class SubscriptionUnschedulePendingPlanChangesResponseTest { .plan( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") @@ -526,6 +547,7 @@ class SubscriptionUnschedulePendingPlanChangesResponseTest { .Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionUnschedulePendingPlanChangesResponse .AdjustmentInterval @@ -536,6 +558,8 @@ class SubscriptionUnschedulePendingPlanChangesResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -696,6 +720,24 @@ class SubscriptionUnschedulePendingPlanChangesResponseTest { .isEqualTo( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponseTest.kt index bcdaf067..1abfe382 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponseTest.kt @@ -27,6 +27,7 @@ class SubscriptionUpdateFixedFeeQuantityResponseTest { .Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionUpdateFixedFeeQuantityResponse .AdjustmentInterval @@ -37,6 +38,8 @@ class SubscriptionUpdateFixedFeeQuantityResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -192,6 +195,24 @@ class SubscriptionUpdateFixedFeeQuantityResponseTest { .plan( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") @@ -520,6 +541,7 @@ class SubscriptionUpdateFixedFeeQuantityResponseTest { .Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionUpdateFixedFeeQuantityResponse .AdjustmentInterval @@ -530,6 +552,8 @@ class SubscriptionUpdateFixedFeeQuantityResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -687,6 +711,24 @@ class SubscriptionUpdateFixedFeeQuantityResponseTest { .isEqualTo( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponseTest.kt index f014d16d..31a8b262 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponseTest.kt @@ -25,6 +25,7 @@ class SubscriptionUpdateTrialResponseTest { .Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionUpdateTrialResponse.AdjustmentInterval .Adjustment @@ -34,6 +35,8 @@ class SubscriptionUpdateTrialResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -185,6 +188,24 @@ class SubscriptionUpdateTrialResponseTest { .plan( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") @@ -512,6 +533,7 @@ class SubscriptionUpdateTrialResponseTest { SubscriptionUpdateTrialResponse.AdjustmentInterval.Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( SubscriptionUpdateTrialResponse.AdjustmentInterval .Adjustment @@ -521,6 +543,8 @@ class SubscriptionUpdateTrialResponseTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -675,6 +699,24 @@ class SubscriptionUpdateTrialResponseTest { .isEqualTo( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionsTest.kt index 19e94b83..acaf1b88 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionsTest.kt @@ -27,6 +27,7 @@ class SubscriptionsTest { Subscription.AdjustmentInterval.Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( Subscription.AdjustmentInterval .Adjustment @@ -36,6 +37,8 @@ class SubscriptionsTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -197,6 +200,25 @@ class SubscriptionsTest { .plan( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment + .AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") @@ -566,6 +588,7 @@ class SubscriptionsTest { Subscription.AdjustmentInterval.Adjustment .AmountDiscountAdjustment .builder() + .id("id") .adjustmentType( Subscription.AdjustmentInterval.Adjustment .AmountDiscountAdjustment @@ -574,6 +597,8 @@ class SubscriptionsTest { ) .amountDiscount("amount_discount") .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) .reason("reason") .build() ) @@ -723,6 +748,25 @@ class SubscriptionsTest { .plan( Plan.builder() .id("id") + .adjustments( + listOf( + Plan.Adjustment.ofAmountDiscountAdjustment( + Plan.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Plan.Adjustment.AmountDiscountAdjustment + .AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .appliesToPriceIds(listOf("string")) + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) + ) .basePlan( Plan.BasePlan.builder() .id("m2t5akQeh2obwxeU") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/SubscriptionServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/SubscriptionServiceTest.kt index f7613c9f..f9d73b46 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/SubscriptionServiceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/SubscriptionServiceTest.kt @@ -46,6 +46,7 @@ class SubscriptionServiceTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -219,6 +220,7 @@ class SubscriptionServiceTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -648,6 +650,7 @@ class SubscriptionServiceTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -754,6 +757,7 @@ class SubscriptionServiceTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) ) @@ -940,6 +944,7 @@ class SubscriptionServiceTest { ) .appliesToPriceIds(listOf("string")) .percentageDiscount(0.0) + .isInvoiceLevel(true) .build() ) )