Skip to content

Commit 0eeadac

Browse files
Merge pull request #2156 from stripe/latest-codegen-private-preview
Update generated code for private-preview
2 parents c0aff82 + 2bbe128 commit 0eeadac

File tree

10 files changed

+1162
-63
lines changed

10 files changed

+1162
-63
lines changed

CODEGEN_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
afce9794b52053b2efda64fd3af04dcf9225eafa
1+
68065dff88008f079e79eb1ef0add5e261b416e1

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2169
1+
v2176

src/main/java/com/stripe/model/InvoiceLineItem.java

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,58 @@ public static class RateCardSubscriptionDetails extends StripeObject {
551551
@Setter
552552
@EqualsAndHashCode(callSuper = false)
553553
public static class ScheduleDetails extends StripeObject {
554+
/** The invoice item that generated this line item. */
555+
@SerializedName("invoice_item")
556+
String invoiceItem;
557+
558+
/** Whether this is a proration. */
559+
@SerializedName("proration")
560+
Boolean proration;
561+
562+
/** Additional details for proration line items. */
563+
@SerializedName("proration_details")
564+
ProrationDetails prorationDetails;
565+
554566
/** The subscription schedule that generated this line item. */
555567
@SerializedName("schedule")
556568
String schedule;
569+
570+
/** The subscription that the schedule belongs to. */
571+
@SerializedName("subscription")
572+
String subscription;
573+
574+
/**
575+
* For more details about ProrationDetails, please refer to the <a
576+
* href="https://docs.stripe.com/api">API Reference.</a>
577+
*/
578+
@Getter
579+
@Setter
580+
@EqualsAndHashCode(callSuper = false)
581+
public static class ProrationDetails extends StripeObject {
582+
/**
583+
* For a credit proration {@code line_item}, the original debit line_items to which the
584+
* credit proration applies.
585+
*/
586+
@SerializedName("credited_items")
587+
CreditedItems creditedItems;
588+
589+
/**
590+
* For more details about CreditedItems, please refer to the <a
591+
* href="https://docs.stripe.com/api">API Reference.</a>
592+
*/
593+
@Getter
594+
@Setter
595+
@EqualsAndHashCode(callSuper = false)
596+
public static class CreditedItems extends StripeObject {
597+
/** Invoice containing the credited invoice line items. */
598+
@SerializedName("invoice")
599+
String invoice;
600+
601+
/** Credited invoice line items. */
602+
@SerializedName("invoice_line_items")
603+
List<String> invoiceLineItems;
604+
}
605+
}
557606
}
558607

559608
/**

src/main/java/com/stripe/model/PaymentMethod.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,10 +1918,22 @@ public static class Custom extends StripeObject {
19181918
@SerializedName("logo")
19191919
Logo logo;
19201920

1921+
/** A reference to an external payment method, such as a PayPal Billing Agreement ID. */
1922+
@SerializedName("payment_method_reference")
1923+
String paymentMethodReference;
1924+
19211925
/** ID of the Dashboard-only CustomPaymentMethodType. Not expandable. */
19221926
@SerializedName("type")
19231927
String type;
19241928

1929+
/**
1930+
* Indicates whether the payment method supports off-session payments.
1931+
*
1932+
* <p>Equal to {@code off_session}.
1933+
*/
1934+
@SerializedName("usage")
1935+
String usage;
1936+
19251937
/**
19261938
* For more details about Logo, please refer to the <a href="https://docs.stripe.com/api">API
19271939
* Reference.</a>

src/main/java/com/stripe/model/billing/Alert.java

Lines changed: 165 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public class Alert extends ApiResource implements HasId {
3838
/**
3939
* Defines the type of the alert.
4040
*
41-
* <p>One of {@code credit_balance_threshold}, or {@code usage_threshold}.
41+
* <p>One of {@code credit_balance_threshold}, {@code spend_threshold}, or {@code
42+
* usage_threshold}.
4243
*/
4344
@SerializedName("alert_type")
4445
String alertType;
@@ -67,6 +68,10 @@ public class Alert extends ApiResource implements HasId {
6768
@SerializedName("object")
6869
String object;
6970

71+
/** Encapsulates the alert's configuration to monitor spend on pricing plan subscriptions. */
72+
@SerializedName("spend_threshold")
73+
SpendThreshold spendThreshold;
74+
7075
/**
7176
* Status of the alert. This can be active, inactive or archived.
7277
*
@@ -483,6 +488,164 @@ public static class Monetary extends StripeObject {
483488
}
484489
}
485490

491+
/**
492+
* The spend threshold alert configuration enables setting up alerts for when a customer's spend
493+
* exceeds a threshold within a billing period.
494+
*/
495+
@Getter
496+
@Setter
497+
@EqualsAndHashCode(callSuper = false)
498+
public static class SpendThreshold extends StripeObject {
499+
/**
500+
* Defines the period over which spend is aggregated.
501+
*
502+
* <p>Equal to {@code billing}.
503+
*/
504+
@SerializedName("aggregation_period")
505+
String aggregationPeriod;
506+
507+
/** Filters to scope the spend calculation. */
508+
@SerializedName("filters")
509+
Filters filters;
510+
511+
/**
512+
* Defines the granularity of spend aggregation.
513+
*
514+
* <p>Equal to {@code pricing_plan_subscription}.
515+
*/
516+
@SerializedName("group_by")
517+
String groupBy;
518+
519+
/** The threshold value configuration for a spend threshold alert. */
520+
@SerializedName("gte")
521+
Gte gte;
522+
523+
/** Filters to scope the spend calculation for a spend threshold alert. */
524+
@Getter
525+
@Setter
526+
@EqualsAndHashCode(callSuper = false)
527+
public static class Filters extends StripeObject {
528+
/** Filter by billable item IDs. */
529+
@SerializedName("billable_items")
530+
List<String> billableItems;
531+
532+
/** Filter by billing cadence ID. */
533+
@SerializedName("billing_cadence")
534+
String billingCadence;
535+
536+
/** Filter by pricing plan ID. */
537+
@SerializedName("pricing_plan")
538+
String pricingPlan;
539+
540+
/** Filter by pricing plan subscription ID. */
541+
@SerializedName("pricing_plan_subscription")
542+
String pricingPlanSubscription;
543+
}
544+
545+
/** The threshold value configuration for a spend threshold alert. */
546+
@Getter
547+
@Setter
548+
@EqualsAndHashCode(callSuper = false)
549+
public static class Gte extends StripeObject {
550+
/** The monetary amount. Present when type is {@code amount}. */
551+
@SerializedName("amount")
552+
Amount amount;
553+
554+
/** The custom pricing unit amount. Present when type is {@code custom_pricing_unit}. */
555+
@SerializedName("custom_pricing_unit")
556+
CustomPricingUnit customPricingUnit;
557+
558+
/**
559+
* The type of the threshold amount.
560+
*
561+
* <p>One of {@code amount}, or {@code custom_pricing_unit}.
562+
*/
563+
@SerializedName("type")
564+
String type;
565+
566+
/**
567+
* For more details about Amount, please refer to the <a
568+
* href="https://docs.stripe.com/api">API Reference.</a>
569+
*/
570+
@Getter
571+
@Setter
572+
@EqualsAndHashCode(callSuper = false)
573+
public static class Amount extends StripeObject {
574+
/**
575+
* Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
576+
* code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
577+
* currency</a>.
578+
*/
579+
@SerializedName("currency")
580+
String currency;
581+
582+
/** A positive integer representing the amount. */
583+
@SerializedName("value")
584+
Long value;
585+
}
586+
587+
/**
588+
* For more details about CustomPricingUnit, please refer to the <a
589+
* href="https://docs.stripe.com/api">API Reference.</a>
590+
*/
591+
@Getter
592+
@Setter
593+
@EqualsAndHashCode(callSuper = false)
594+
public static class CustomPricingUnit extends StripeObject implements HasId {
595+
/** The custom pricing unit object. */
596+
@SerializedName("custom_pricing_unit_details")
597+
CustomPricingUnitDetails customPricingUnitDetails;
598+
599+
/** Unique identifier for the object. */
600+
@Getter(onMethod_ = {@Override})
601+
@SerializedName("id")
602+
String id;
603+
604+
/** A positive decimal string representing the amount. */
605+
@SerializedName("value")
606+
BigDecimal value;
607+
608+
/**
609+
* For more details about CustomPricingUnitDetails, please refer to the <a
610+
* href="https://docs.stripe.com/api">API Reference.</a>
611+
*/
612+
@Getter
613+
@Setter
614+
@EqualsAndHashCode(callSuper = false)
615+
public static class CustomPricingUnitDetails extends StripeObject implements HasId {
616+
/** Time at which the object was created. Measured in seconds since the Unix epoch. */
617+
@SerializedName("created")
618+
Long created;
619+
620+
/** The name of the custom pricing unit. */
621+
@SerializedName("display_name")
622+
String displayName;
623+
624+
/** Unique identifier for the object. */
625+
@Getter(onMethod_ = {@Override})
626+
@SerializedName("id")
627+
String id;
628+
629+
/** A lookup key for the custom pricing unit. */
630+
@SerializedName("lookup_key")
631+
String lookupKey;
632+
633+
/**
634+
* Set of <a href="https://docs.stripe.com/api/metadata">key-value pairs</a> that you can
635+
* attach to an object. This can be useful for storing additional information about the
636+
* object in a structured format.
637+
*/
638+
@SerializedName("metadata")
639+
Map<String, String> metadata;
640+
641+
/** The status of the custom pricing unit. */
642+
@SerializedName("status")
643+
String status;
644+
}
645+
}
646+
}
647+
}
648+
486649
/**
487650
* The usage threshold alert configuration enables setting up alerts for when a certain usage
488651
* threshold on a specific meter is crossed.
@@ -578,6 +741,7 @@ public void setCustomerObject(Customer expandableObject) {
578741
public void setResponseGetter(StripeResponseGetter responseGetter) {
579742
super.setResponseGetter(responseGetter);
580743
trySetResponseGetter(creditBalanceThreshold, responseGetter);
744+
trySetResponseGetter(spendThreshold, responseGetter);
581745
trySetResponseGetter(usageThreshold, responseGetter);
582746
}
583747
}

0 commit comments

Comments
 (0)