@@ -30,6 +30,7 @@ private constructor(
3030 private val filters: JsonField <List <TransformPriceFilter >>,
3131 private val isInvoiceLevel: JsonField <Boolean >,
3232 private val reason: JsonField <String >,
33+ private val replacesAdjustmentId: JsonField <String >,
3334 private val additionalProperties: MutableMap <String , JsonValue >,
3435) {
3536
@@ -53,6 +54,9 @@ private constructor(
5354 @ExcludeMissing
5455 isInvoiceLevel: JsonField <Boolean > = JsonMissing .of(),
5556 @JsonProperty(" reason" ) @ExcludeMissing reason: JsonField <String > = JsonMissing .of(),
57+ @JsonProperty(" replaces_adjustment_id" )
58+ @ExcludeMissing
59+ replacesAdjustmentId: JsonField <String > = JsonMissing .of(),
5660 ) : this (
5761 id,
5862 adjustmentType,
@@ -62,6 +66,7 @@ private constructor(
6266 filters,
6367 isInvoiceLevel,
6468 reason,
69+ replacesAdjustmentId,
6570 mutableMapOf (),
6671 )
6772
@@ -128,6 +133,16 @@ private constructor(
128133 */
129134 fun reason (): Optional <String > = reason.getOptional(" reason" )
130135
136+ /* *
137+ * The adjustment id this adjustment replaces. This adjustment will take the place of the
138+ * replaced adjustment in plan version migrations.
139+ *
140+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
141+ * responded with an unexpected value).
142+ */
143+ fun replacesAdjustmentId (): Optional <String > =
144+ replacesAdjustmentId.getOptional(" replaces_adjustment_id" )
145+
131146 /* *
132147 * Returns the raw JSON value of [id].
133148 *
@@ -196,6 +211,16 @@ private constructor(
196211 */
197212 @JsonProperty(" reason" ) @ExcludeMissing fun _reason (): JsonField <String > = reason
198213
214+ /* *
215+ * Returns the raw JSON value of [replacesAdjustmentId].
216+ *
217+ * Unlike [replacesAdjustmentId], this method doesn't throw if the JSON field has an unexpected
218+ * type.
219+ */
220+ @JsonProperty(" replaces_adjustment_id" )
221+ @ExcludeMissing
222+ fun _replacesAdjustmentId (): JsonField <String > = replacesAdjustmentId
223+
199224 @JsonAnySetter
200225 private fun putAdditionalProperty (key : String , value : JsonValue ) {
201226 additionalProperties.put(key, value)
@@ -224,6 +249,7 @@ private constructor(
224249 * .filters()
225250 * .isInvoiceLevel()
226251 * .reason()
252+ * .replacesAdjustmentId()
227253 * ```
228254 */
229255 @JvmStatic fun builder () = Builder ()
@@ -240,6 +266,7 @@ private constructor(
240266 private var filters: JsonField <MutableList <TransformPriceFilter >>? = null
241267 private var isInvoiceLevel: JsonField <Boolean >? = null
242268 private var reason: JsonField <String >? = null
269+ private var replacesAdjustmentId: JsonField <String >? = null
243270 private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
244271
245272 @JvmSynthetic
@@ -254,6 +281,7 @@ private constructor(
254281 filters = monetaryAmountDiscountAdjustment.filters.map { it.toMutableList() }
255282 isInvoiceLevel = monetaryAmountDiscountAdjustment.isInvoiceLevel
256283 reason = monetaryAmountDiscountAdjustment.reason
284+ replacesAdjustmentId = monetaryAmountDiscountAdjustment.replacesAdjustmentId
257285 additionalProperties =
258286 monetaryAmountDiscountAdjustment.additionalProperties.toMutableMap()
259287 }
@@ -397,6 +425,31 @@ private constructor(
397425 */
398426 fun reason (reason : JsonField <String >) = apply { this .reason = reason }
399427
428+ /* *
429+ * The adjustment id this adjustment replaces. This adjustment will take the place of the
430+ * replaced adjustment in plan version migrations.
431+ */
432+ fun replacesAdjustmentId (replacesAdjustmentId : String? ) =
433+ replacesAdjustmentId(JsonField .ofNullable(replacesAdjustmentId))
434+
435+ /* *
436+ * Alias for calling [Builder.replacesAdjustmentId] with
437+ * `replacesAdjustmentId.orElse(null)`.
438+ */
439+ fun replacesAdjustmentId (replacesAdjustmentId : Optional <String >) =
440+ replacesAdjustmentId(replacesAdjustmentId.getOrNull())
441+
442+ /* *
443+ * Sets [Builder.replacesAdjustmentId] to an arbitrary JSON value.
444+ *
445+ * You should usually call [Builder.replacesAdjustmentId] with a well-typed [String] value
446+ * instead. This method is primarily for setting the field to an undocumented or not yet
447+ * supported value.
448+ */
449+ fun replacesAdjustmentId (replacesAdjustmentId : JsonField <String >) = apply {
450+ this .replacesAdjustmentId = replacesAdjustmentId
451+ }
452+
400453 fun additionalProperties (additionalProperties : Map <String , JsonValue >) = apply {
401454 this .additionalProperties.clear()
402455 putAllAdditionalProperties(additionalProperties)
@@ -431,6 +484,7 @@ private constructor(
431484 * .filters()
432485 * .isInvoiceLevel()
433486 * .reason()
487+ * .replacesAdjustmentId()
434488 * ```
435489 *
436490 * @throws IllegalStateException if any required field is unset.
@@ -445,6 +499,7 @@ private constructor(
445499 checkRequired(" filters" , filters).map { it.toImmutable() },
446500 checkRequired(" isInvoiceLevel" , isInvoiceLevel),
447501 checkRequired(" reason" , reason),
502+ checkRequired(" replacesAdjustmentId" , replacesAdjustmentId),
448503 additionalProperties.toMutableMap(),
449504 )
450505 }
@@ -464,6 +519,7 @@ private constructor(
464519 filters().forEach { it.validate() }
465520 isInvoiceLevel()
466521 reason()
522+ replacesAdjustmentId()
467523 validated = true
468524 }
469525
@@ -489,7 +545,8 @@ private constructor(
489545 (appliesToPriceIds.asKnown().getOrNull()?.size ? : 0 ) +
490546 (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ? : 0 ) +
491547 (if (isInvoiceLevel.asKnown().isPresent) 1 else 0 ) +
492- (if (reason.asKnown().isPresent) 1 else 0 )
548+ (if (reason.asKnown().isPresent) 1 else 0 ) +
549+ (if (replacesAdjustmentId.asKnown().isPresent) 1 else 0 )
493550
494551 class AdjustmentType @JsonCreator private constructor(private val value : JsonField <String >) :
495552 Enum {
@@ -618,15 +675,15 @@ private constructor(
618675 return true
619676 }
620677
621- return /* spotless:off */ other is MonetaryAmountDiscountAdjustment && id == other.id && adjustmentType == other.adjustmentType && amount == other.amount && amountDiscount == other.amountDiscount && appliesToPriceIds == other.appliesToPriceIds && filters == other.filters && isInvoiceLevel == other.isInvoiceLevel && reason == other.reason && additionalProperties == other.additionalProperties /* spotless:on */
678+ return /* spotless:off */ other is MonetaryAmountDiscountAdjustment && id == other.id && adjustmentType == other.adjustmentType && amount == other.amount && amountDiscount == other.amountDiscount && appliesToPriceIds == other.appliesToPriceIds && filters == other.filters && isInvoiceLevel == other.isInvoiceLevel && reason == other.reason && replacesAdjustmentId == other.replacesAdjustmentId && additionalProperties == other.additionalProperties /* spotless:on */
622679 }
623680
624681 /* spotless:off */
625- private val hashCode: Int by lazy { Objects .hash(id, adjustmentType, amount, amountDiscount, appliesToPriceIds, filters, isInvoiceLevel, reason, additionalProperties) }
682+ private val hashCode: Int by lazy { Objects .hash(id, adjustmentType, amount, amountDiscount, appliesToPriceIds, filters, isInvoiceLevel, reason, replacesAdjustmentId, additionalProperties) }
626683 /* spotless:on */
627684
628685 override fun hashCode (): Int = hashCode
629686
630687 override fun toString () =
631- " MonetaryAmountDiscountAdjustment{id=$id , adjustmentType=$adjustmentType , amount=$amount , amountDiscount=$amountDiscount , appliesToPriceIds=$appliesToPriceIds , filters=$filters , isInvoiceLevel=$isInvoiceLevel , reason=$reason , additionalProperties=$additionalProperties }"
688+ " MonetaryAmountDiscountAdjustment{id=$id , adjustmentType=$adjustmentType , amount=$amount , amountDiscount=$amountDiscount , appliesToPriceIds=$appliesToPriceIds , filters=$filters , isInvoiceLevel=$isInvoiceLevel , reason=$reason , replacesAdjustmentId= $replacesAdjustmentId , additionalProperties=$additionalProperties }"
632689}
0 commit comments