@@ -68,6 +68,7 @@ private constructor(
6868 private val netTerms: JsonField <Long >,
6969 private val redeemedCoupon: JsonField <RedeemedCoupon >,
7070 private val billingCycleDay: JsonField <Long >,
71+ private val billingCycleAnchorConfiguration: JsonField <BillingCycleAnchorConfiguration >,
7172 private val invoicingThreshold: JsonField <String >,
7273 private val priceIntervals: JsonField <List <PriceInterval >>,
7374 private val adjustmentIntervals: JsonField <List <AdjustmentInterval >>,
@@ -188,6 +189,9 @@ private constructor(
188189 */
189190 fun billingCycleDay (): Long = billingCycleDay.getRequired(" billing_cycle_day" )
190191
192+ fun billingCycleAnchorConfiguration (): BillingCycleAnchorConfiguration =
193+ billingCycleAnchorConfiguration.getRequired(" billing_cycle_anchor_configuration" )
194+
191195 fun invoicingThreshold (): Optional <String > =
192196 Optional .ofNullable(invoicingThreshold.getNullable(" invoicing_threshold" ))
193197
@@ -316,6 +320,10 @@ private constructor(
316320 */
317321 @JsonProperty(" billing_cycle_day" ) @ExcludeMissing fun _billingCycleDay () = billingCycleDay
318322
323+ @JsonProperty(" billing_cycle_anchor_configuration" )
324+ @ExcludeMissing
325+ fun _billingCycleAnchorConfiguration () = billingCycleAnchorConfiguration
326+
319327 @JsonProperty(" invoicing_threshold" )
320328 @ExcludeMissing
321329 fun _invoicingThreshold () = invoicingThreshold
@@ -361,6 +369,7 @@ private constructor(
361369 netTerms()
362370 redeemedCoupon().map { it.validate() }
363371 billingCycleDay()
372+ billingCycleAnchorConfiguration().validate()
364373 invoicingThreshold()
365374 priceIntervals().forEach { it.validate() }
366375 adjustmentIntervals().forEach { it.validate() }
@@ -397,6 +406,7 @@ private constructor(
397406 this .netTerms == other.netTerms &&
398407 this .redeemedCoupon == other.redeemedCoupon &&
399408 this .billingCycleDay == other.billingCycleDay &&
409+ this .billingCycleAnchorConfiguration == other.billingCycleAnchorConfiguration &&
400410 this .invoicingThreshold == other.invoicingThreshold &&
401411 this .priceIntervals == other.priceIntervals &&
402412 this .adjustmentIntervals == other.adjustmentIntervals &&
@@ -428,6 +438,7 @@ private constructor(
428438 netTerms,
429439 redeemedCoupon,
430440 billingCycleDay,
441+ billingCycleAnchorConfiguration,
431442 invoicingThreshold,
432443 priceIntervals,
433444 adjustmentIntervals,
@@ -441,7 +452,7 @@ private constructor(
441452 }
442453
443454 override fun toString () =
444- " Subscription{metadata=$metadata , id=$id , customer=$customer , plan=$plan , startDate=$startDate , endDate=$endDate , createdAt=$createdAt , currentBillingPeriodStartDate=$currentBillingPeriodStartDate , currentBillingPeriodEndDate=$currentBillingPeriodEndDate , status=$status , trialInfo=$trialInfo , activePlanPhaseOrder=$activePlanPhaseOrder , fixedFeeQuantitySchedule=$fixedFeeQuantitySchedule , defaultInvoiceMemo=$defaultInvoiceMemo , autoCollection=$autoCollection , netTerms=$netTerms , redeemedCoupon=$redeemedCoupon , billingCycleDay=$billingCycleDay , invoicingThreshold=$invoicingThreshold , priceIntervals=$priceIntervals , adjustmentIntervals=$adjustmentIntervals , discountIntervals=$discountIntervals , minimumIntervals=$minimumIntervals , maximumIntervals=$maximumIntervals , additionalProperties=$additionalProperties }"
455+ " Subscription{metadata=$metadata , id=$id , customer=$customer , plan=$plan , startDate=$startDate , endDate=$endDate , createdAt=$createdAt , currentBillingPeriodStartDate=$currentBillingPeriodStartDate , currentBillingPeriodEndDate=$currentBillingPeriodEndDate , status=$status , trialInfo=$trialInfo , activePlanPhaseOrder=$activePlanPhaseOrder , fixedFeeQuantitySchedule=$fixedFeeQuantitySchedule , defaultInvoiceMemo=$defaultInvoiceMemo , autoCollection=$autoCollection , netTerms=$netTerms , redeemedCoupon=$redeemedCoupon , billingCycleDay=$billingCycleDay , billingCycleAnchorConfiguration= $billingCycleAnchorConfiguration , invoicingThreshold=$invoicingThreshold , priceIntervals=$priceIntervals , adjustmentIntervals=$adjustmentIntervals , discountIntervals=$discountIntervals , minimumIntervals=$minimumIntervals , maximumIntervals=$maximumIntervals , additionalProperties=$additionalProperties }"
445456
446457 companion object {
447458
@@ -469,6 +480,8 @@ private constructor(
469480 private var netTerms: JsonField <Long > = JsonMissing .of()
470481 private var redeemedCoupon: JsonField <RedeemedCoupon > = JsonMissing .of()
471482 private var billingCycleDay: JsonField <Long > = JsonMissing .of()
483+ private var billingCycleAnchorConfiguration: JsonField <BillingCycleAnchorConfiguration > =
484+ JsonMissing .of()
472485 private var invoicingThreshold: JsonField <String > = JsonMissing .of()
473486 private var priceIntervals: JsonField <List <PriceInterval >> = JsonMissing .of()
474487 private var adjustmentIntervals: JsonField <List <AdjustmentInterval >> = JsonMissing .of()
@@ -497,6 +510,7 @@ private constructor(
497510 this .netTerms = subscription.netTerms
498511 this .redeemedCoupon = subscription.redeemedCoupon
499512 this .billingCycleDay = subscription.billingCycleDay
513+ this .billingCycleAnchorConfiguration = subscription.billingCycleAnchorConfiguration
500514 this .invoicingThreshold = subscription.invoicingThreshold
501515 this .priceIntervals = subscription.priceIntervals
502516 this .adjustmentIntervals = subscription.adjustmentIntervals
@@ -759,6 +773,16 @@ private constructor(
759773 this .billingCycleDay = billingCycleDay
760774 }
761775
776+ fun billingCycleAnchorConfiguration (
777+ billingCycleAnchorConfiguration : BillingCycleAnchorConfiguration
778+ ) = billingCycleAnchorConfiguration(JsonField .of(billingCycleAnchorConfiguration))
779+
780+ @JsonProperty(" billing_cycle_anchor_configuration" )
781+ @ExcludeMissing
782+ fun billingCycleAnchorConfiguration (
783+ billingCycleAnchorConfiguration : JsonField <BillingCycleAnchorConfiguration >
784+ ) = apply { this .billingCycleAnchorConfiguration = billingCycleAnchorConfiguration }
785+
762786 fun invoicingThreshold (invoicingThreshold : String ) =
763787 invoicingThreshold(JsonField .of(invoicingThreshold))
764788
@@ -857,6 +881,7 @@ private constructor(
857881 netTerms,
858882 redeemedCoupon,
859883 billingCycleDay,
884+ billingCycleAnchorConfiguration,
860885 invoicingThreshold,
861886 priceIntervals.map { it.toUnmodifiable() },
862887 adjustmentIntervals.map { it.toUnmodifiable() },
@@ -2518,6 +2543,194 @@ private constructor(
25182543 }
25192544 }
25202545
2546+ @JsonDeserialize(builder = BillingCycleAnchorConfiguration .Builder ::class )
2547+ @NoAutoDetect
2548+ class BillingCycleAnchorConfiguration
2549+ private constructor (
2550+ private val day: JsonField <Long >,
2551+ private val month: JsonField <Long >,
2552+ private val year: JsonField <Long >,
2553+ private val additionalProperties: Map <String , JsonValue >,
2554+ ) {
2555+
2556+ private var validated: Boolean = false
2557+
2558+ private var hashCode: Int = 0
2559+
2560+ /* *
2561+ * The day of the month on which the billing cycle is anchored. If the maximum number of
2562+ * days in a month is greater than this value, the last day of the month is the billing
2563+ * cycle day (e.g. billing_cycle_day=31 for April means the billing period begins on the
2564+ * 30th.
2565+ */
2566+ fun day (): Long = day.getRequired(" day" )
2567+
2568+ /* *
2569+ * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in
2570+ * February would have cycles starting February, May, August, and November).
2571+ */
2572+ fun month (): Optional <Long > = Optional .ofNullable(month.getNullable(" month" ))
2573+
2574+ /* *
2575+ * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored on
2576+ * 2021 would have cycles starting on 2021, 2023, 2025, etc.).
2577+ */
2578+ fun year (): Optional <Long > = Optional .ofNullable(year.getNullable(" year" ))
2579+
2580+ /* *
2581+ * The day of the month on which the billing cycle is anchored. If the maximum number of
2582+ * days in a month is greater than this value, the last day of the month is the billing
2583+ * cycle day (e.g. billing_cycle_day=31 for April means the billing period begins on the
2584+ * 30th.
2585+ */
2586+ @JsonProperty(" day" ) @ExcludeMissing fun _day () = day
2587+
2588+ /* *
2589+ * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in
2590+ * February would have cycles starting February, May, August, and November).
2591+ */
2592+ @JsonProperty(" month" ) @ExcludeMissing fun _month () = month
2593+
2594+ /* *
2595+ * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored on
2596+ * 2021 would have cycles starting on 2021, 2023, 2025, etc.).
2597+ */
2598+ @JsonProperty(" year" ) @ExcludeMissing fun _year () = year
2599+
2600+ @JsonAnyGetter
2601+ @ExcludeMissing
2602+ fun _additionalProperties (): Map <String , JsonValue > = additionalProperties
2603+
2604+ fun validate (): BillingCycleAnchorConfiguration = apply {
2605+ if (! validated) {
2606+ day()
2607+ month()
2608+ year()
2609+ validated = true
2610+ }
2611+ }
2612+
2613+ fun toBuilder () = Builder ().from(this )
2614+
2615+ override fun equals (other : Any? ): Boolean {
2616+ if (this == = other) {
2617+ return true
2618+ }
2619+
2620+ return other is BillingCycleAnchorConfiguration &&
2621+ this .day == other.day &&
2622+ this .month == other.month &&
2623+ this .year == other.year &&
2624+ this .additionalProperties == other.additionalProperties
2625+ }
2626+
2627+ override fun hashCode (): Int {
2628+ if (hashCode == 0 ) {
2629+ hashCode =
2630+ Objects .hash(
2631+ day,
2632+ month,
2633+ year,
2634+ additionalProperties,
2635+ )
2636+ }
2637+ return hashCode
2638+ }
2639+
2640+ override fun toString () =
2641+ " BillingCycleAnchorConfiguration{day=$day , month=$month , year=$year , additionalProperties=$additionalProperties }"
2642+
2643+ companion object {
2644+
2645+ @JvmStatic fun builder () = Builder ()
2646+ }
2647+
2648+ class Builder {
2649+
2650+ private var day: JsonField <Long > = JsonMissing .of()
2651+ private var month: JsonField <Long > = JsonMissing .of()
2652+ private var year: JsonField <Long > = JsonMissing .of()
2653+ private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
2654+
2655+ @JvmSynthetic
2656+ internal fun from (billingCycleAnchorConfiguration : BillingCycleAnchorConfiguration ) =
2657+ apply {
2658+ this .day = billingCycleAnchorConfiguration.day
2659+ this .month = billingCycleAnchorConfiguration.month
2660+ this .year = billingCycleAnchorConfiguration.year
2661+ additionalProperties(billingCycleAnchorConfiguration.additionalProperties)
2662+ }
2663+
2664+ /* *
2665+ * The day of the month on which the billing cycle is anchored. If the maximum number of
2666+ * days in a month is greater than this value, the last day of the month is the billing
2667+ * cycle day (e.g. billing_cycle_day=31 for April means the billing period begins on the
2668+ * 30th.
2669+ */
2670+ fun day (day : Long ) = day(JsonField .of(day))
2671+
2672+ /* *
2673+ * The day of the month on which the billing cycle is anchored. If the maximum number of
2674+ * days in a month is greater than this value, the last day of the month is the billing
2675+ * cycle day (e.g. billing_cycle_day=31 for April means the billing period begins on the
2676+ * 30th.
2677+ */
2678+ @JsonProperty(" day" )
2679+ @ExcludeMissing
2680+ fun day (day : JsonField <Long >) = apply { this .day = day }
2681+
2682+ /* *
2683+ * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in
2684+ * February would have cycles starting February, May, August, and November).
2685+ */
2686+ fun month (month : Long ) = month(JsonField .of(month))
2687+
2688+ /* *
2689+ * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in
2690+ * February would have cycles starting February, May, August, and November).
2691+ */
2692+ @JsonProperty(" month" )
2693+ @ExcludeMissing
2694+ fun month (month : JsonField <Long >) = apply { this .month = month }
2695+
2696+ /* *
2697+ * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored
2698+ * on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
2699+ */
2700+ fun year (year : Long ) = year(JsonField .of(year))
2701+
2702+ /* *
2703+ * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored
2704+ * on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
2705+ */
2706+ @JsonProperty(" year" )
2707+ @ExcludeMissing
2708+ fun year (year : JsonField <Long >) = apply { this .year = year }
2709+
2710+ fun additionalProperties (additionalProperties : Map <String , JsonValue >) = apply {
2711+ this .additionalProperties.clear()
2712+ this .additionalProperties.putAll(additionalProperties)
2713+ }
2714+
2715+ @JsonAnySetter
2716+ fun putAdditionalProperty (key : String , value : JsonValue ) = apply {
2717+ this .additionalProperties.put(key, value)
2718+ }
2719+
2720+ fun putAllAdditionalProperties (additionalProperties : Map <String , JsonValue >) = apply {
2721+ this .additionalProperties.putAll(additionalProperties)
2722+ }
2723+
2724+ fun build (): BillingCycleAnchorConfiguration =
2725+ BillingCycleAnchorConfiguration (
2726+ day,
2727+ month,
2728+ year,
2729+ additionalProperties.toUnmodifiable(),
2730+ )
2731+ }
2732+ }
2733+
25212734 @JsonDeserialize(using = DiscountInterval .Deserializer ::class )
25222735 @JsonSerialize(using = DiscountInterval .Serializer ::class )
25232736 class DiscountInterval
0 commit comments