Skip to content

Commit a941670

Browse files
Merge upstream and update generated code for v2026 and 2025-09-30.preview
2 parents 5dd5e8e + babe753 commit a941670

9 files changed

Lines changed: 341 additions & 3 deletions

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2023
1+
v2026

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2319,6 +2319,10 @@ public void setAccountObject(Account expandableObject) {
23192319
@Setter
23202320
@EqualsAndHashCode(callSuper = false)
23212321
public static class Parent extends StripeObject {
2322+
/** Details about the billing cadence that generated this invoice. */
2323+
@SerializedName("billing_cadence_details")
2324+
BillingCadenceDetails billingCadenceDetails;
2325+
23222326
/** Details about the quote that generated this invoice. */
23232327
@SerializedName("quote_details")
23242328
QuoteDetails quoteDetails;
@@ -2330,11 +2334,25 @@ public static class Parent extends StripeObject {
23302334
/**
23312335
* The type of parent that generated this invoice
23322336
*
2333-
* <p>One of {@code quote_details}, or {@code subscription_details}.
2337+
* <p>One of {@code billing_cadence_details}, {@code quote_details}, or {@code
2338+
* subscription_details}.
23342339
*/
23352340
@SerializedName("type")
23362341
String type;
23372342

2343+
/**
2344+
* For more details about BillingCadenceDetails, please refer to the <a
2345+
* href="https://docs.stripe.com/api">API Reference.</a>
2346+
*/
2347+
@Getter
2348+
@Setter
2349+
@EqualsAndHashCode(callSuper = false)
2350+
public static class BillingCadenceDetails extends StripeObject {
2351+
/** The billing cadence that generated this invoice. */
2352+
@SerializedName("billing_cadence")
2353+
String billingCadence;
2354+
}
2355+
23382356
/**
23392357
* For more details about QuoteDetails, please refer to the <a
23402358
* href="https://docs.stripe.com/api">API Reference.</a>

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,10 @@ public void setAccountObject(Account expandableObject) {
11871187
@Setter
11881188
@EqualsAndHashCode(callSuper = false)
11891189
public static class Parent extends StripeObject {
1190+
/** Details about the billing cadence that generated this invoice. */
1191+
@SerializedName("billing_cadence_details")
1192+
BillingCadenceDetails billingCadenceDetails;
1193+
11901194
/** Details about the quote that generated this invoice. */
11911195
@SerializedName("quote_details")
11921196
QuoteDetails quoteDetails;
@@ -1198,11 +1202,25 @@ public static class Parent extends StripeObject {
11981202
/**
11991203
* The type of parent that generated this invoice
12001204
*
1201-
* <p>One of {@code quote_details}, or {@code subscription_details}.
1205+
* <p>One of {@code billing_cadence_details}, {@code quote_details}, or {@code
1206+
* subscription_details}.
12021207
*/
12031208
@SerializedName("type")
12041209
String type;
12051210

1211+
/**
1212+
* For more details about BillingCadenceDetails, please refer to the <a
1213+
* href="https://docs.stripe.com/api">API Reference.</a>
1214+
*/
1215+
@Getter
1216+
@Setter
1217+
@EqualsAndHashCode(callSuper = false)
1218+
public static class BillingCadenceDetails extends StripeObject {
1219+
/** The billing cadence that generated this invoice. */
1220+
@SerializedName("billing_cadence")
1221+
String billingCadence;
1222+
}
1223+
12061224
/**
12071225
* For more details about QuoteDetails, please refer to the <a
12081226
* href="https://docs.stripe.com/api">API Reference.</a>

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

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.stripe.net.BaseAddress;
1111
import com.stripe.net.RequestOptions;
1212
import com.stripe.net.StripeResponseGetter;
13+
import com.stripe.param.SubscriptionAttachCadenceParams;
1314
import com.stripe.param.SubscriptionCancelParams;
1415
import com.stripe.param.SubscriptionCreateParams;
1516
import com.stripe.param.SubscriptionListParams;
@@ -53,6 +54,15 @@ public class Subscription extends ApiResource implements HasId, MetadataStore<Su
5354
@SerializedName("automatic_tax")
5455
AutomaticTax automaticTax;
5556

57+
/**
58+
* The Billing Cadence which controls the timing of recurring invoice generation for this
59+
* subscription.If unset, the subscription will bill according to its own configured schedule and
60+
* create its own invoices.If set, this subscription will be billed by the cadence instead,
61+
* potentially sharing invoices with the other subscriptions linked to that Cadence.
62+
*/
63+
@SerializedName("billing_cadence")
64+
String billingCadence;
65+
5666
/**
5767
* The reference point that aligns future <a
5868
* href="https://stripe.com/docs/subscriptions/billing-cycle">billing cycle</a> dates. It sets the
@@ -593,6 +603,58 @@ public void setDiscountObjects(List<Discount> objs) {
593603
: null;
594604
}
595605

606+
/**
607+
* Attach a Billing Cadence to an existing subscription. When attached, the subscription is billed
608+
* by the Billing Cadence, potentially sharing invoices with the other subscriptions linked to the
609+
* Billing Cadence.
610+
*/
611+
public Subscription attachCadence(Map<String, Object> params) throws StripeException {
612+
return attachCadence(params, (RequestOptions) null);
613+
}
614+
615+
/**
616+
* Attach a Billing Cadence to an existing subscription. When attached, the subscription is billed
617+
* by the Billing Cadence, potentially sharing invoices with the other subscriptions linked to the
618+
* Billing Cadence.
619+
*/
620+
public Subscription attachCadence(Map<String, Object> params, RequestOptions options)
621+
throws StripeException {
622+
String path =
623+
String.format("/v1/subscriptions/%s/attach_cadence", ApiResource.urlEncodeId(this.getId()));
624+
ApiRequest request =
625+
new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
626+
return getResponseGetter().request(request, Subscription.class);
627+
}
628+
629+
/**
630+
* Attach a Billing Cadence to an existing subscription. When attached, the subscription is billed
631+
* by the Billing Cadence, potentially sharing invoices with the other subscriptions linked to the
632+
* Billing Cadence.
633+
*/
634+
public Subscription attachCadence(SubscriptionAttachCadenceParams params) throws StripeException {
635+
return attachCadence(params, (RequestOptions) null);
636+
}
637+
638+
/**
639+
* Attach a Billing Cadence to an existing subscription. When attached, the subscription is billed
640+
* by the Billing Cadence, potentially sharing invoices with the other subscriptions linked to the
641+
* Billing Cadence.
642+
*/
643+
public Subscription attachCadence(SubscriptionAttachCadenceParams params, RequestOptions options)
644+
throws StripeException {
645+
String path =
646+
String.format("/v1/subscriptions/%s/attach_cadence", ApiResource.urlEncodeId(this.getId()));
647+
ApiResource.checkNullTypedParams(path, params);
648+
ApiRequest request =
649+
new ApiRequest(
650+
BaseAddress.API,
651+
ApiResource.RequestMethod.POST,
652+
path,
653+
ApiRequestParams.paramsToMap(params),
654+
options);
655+
return getResponseGetter().request(request, Subscription.class);
656+
}
657+
596658
/**
597659
* Cancels a customer’s subscription immediately. The customer won’t be charged again for the
598660
* subscription. After it’s canceled, you can no longer update the subscription or its <a

src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ public class InvoiceCreatePreviewParams extends ApiRequestParams {
1919
@SerializedName("automatic_tax")
2020
AutomaticTax automaticTax;
2121

22+
/**
23+
* The identifier of the billing cadence for which you’d like to retrieve the upcoming
24+
* invoice.Cannot be provided when {@code subscription}, {@code schedule}, {@code
25+
* subscription_details} or {@code schedule_details} are provided.
26+
*/
27+
@SerializedName("billing_cadence")
28+
String billingCadence;
29+
2230
/**
2331
* The currency to preview this invoice in. Defaults to that of {@code customer} if not specified.
2432
*/
@@ -131,6 +139,7 @@ public class InvoiceCreatePreviewParams extends ApiRequestParams {
131139

132140
private InvoiceCreatePreviewParams(
133141
AutomaticTax automaticTax,
142+
String billingCadence,
134143
String currency,
135144
String customer,
136145
String customerAccount,
@@ -147,6 +156,7 @@ private InvoiceCreatePreviewParams(
147156
String subscription,
148157
SubscriptionDetails subscriptionDetails) {
149158
this.automaticTax = automaticTax;
159+
this.billingCadence = billingCadence;
150160
this.currency = currency;
151161
this.customer = customer;
152162
this.customerAccount = customerAccount;
@@ -171,6 +181,8 @@ public static Builder builder() {
171181
public static class Builder {
172182
private AutomaticTax automaticTax;
173183

184+
private String billingCadence;
185+
174186
private String currency;
175187

176188
private String customer;
@@ -205,6 +217,7 @@ public static class Builder {
205217
public InvoiceCreatePreviewParams build() {
206218
return new InvoiceCreatePreviewParams(
207219
this.automaticTax,
220+
this.billingCadence,
208221
this.currency,
209222
this.customer,
210223
this.customerAccount,
@@ -228,6 +241,16 @@ public Builder setAutomaticTax(InvoiceCreatePreviewParams.AutomaticTax automatic
228241
return this;
229242
}
230243

244+
/**
245+
* The identifier of the billing cadence for which you’d like to retrieve the upcoming
246+
* invoice.Cannot be provided when {@code subscription}, {@code schedule}, {@code
247+
* subscription_details} or {@code schedule_details} are provided.
248+
*/
249+
public Builder setBillingCadence(String billingCadence) {
250+
this.billingCadence = billingCadence;
251+
return this;
252+
}
253+
231254
/**
232255
* The currency to preview this invoice in. Defaults to that of {@code customer} if not
233256
* specified.
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
// File generated from our OpenAPI spec
2+
package com.stripe.param;
3+
4+
import com.google.gson.annotations.SerializedName;
5+
import com.stripe.net.ApiRequestParams;
6+
import java.util.ArrayList;
7+
import java.util.HashMap;
8+
import java.util.List;
9+
import java.util.Map;
10+
import lombok.EqualsAndHashCode;
11+
import lombok.Getter;
12+
13+
@Getter
14+
@EqualsAndHashCode(callSuper = false)
15+
public class SubscriptionAttachCadenceParams extends ApiRequestParams {
16+
/**
17+
* <strong>Required.</strong> The Billing Cadence which controls the timing of recurring invoice
18+
* generation for this subscription. If unset, the subscription will bill according to its own
19+
* configured schedule and create its own invoices. If set, this subscription will be billed by
20+
* the cadence instead, potentially sharing invoices with the other subscriptions linked to that
21+
* Cadence.
22+
*/
23+
@SerializedName("billing_cadence")
24+
String billingCadence;
25+
26+
/** Specifies which fields in the response should be expanded. */
27+
@SerializedName("expand")
28+
List<String> expand;
29+
30+
/**
31+
* Map of extra parameters for custom features not available in this client library. The content
32+
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
33+
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
34+
* param object. Effectively, this map is flattened to its parent instance.
35+
*/
36+
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
37+
Map<String, Object> extraParams;
38+
39+
private SubscriptionAttachCadenceParams(
40+
String billingCadence, List<String> expand, Map<String, Object> extraParams) {
41+
this.billingCadence = billingCadence;
42+
this.expand = expand;
43+
this.extraParams = extraParams;
44+
}
45+
46+
public static Builder builder() {
47+
return new Builder();
48+
}
49+
50+
public static class Builder {
51+
private String billingCadence;
52+
53+
private List<String> expand;
54+
55+
private Map<String, Object> extraParams;
56+
57+
/** Finalize and obtain parameter instance from this builder. */
58+
public SubscriptionAttachCadenceParams build() {
59+
return new SubscriptionAttachCadenceParams(
60+
this.billingCadence, this.expand, this.extraParams);
61+
}
62+
63+
/**
64+
* <strong>Required.</strong> The Billing Cadence which controls the timing of recurring invoice
65+
* generation for this subscription. If unset, the subscription will bill according to its own
66+
* configured schedule and create its own invoices. If set, this subscription will be billed by
67+
* the cadence instead, potentially sharing invoices with the other subscriptions linked to that
68+
* Cadence.
69+
*/
70+
public Builder setBillingCadence(String billingCadence) {
71+
this.billingCadence = billingCadence;
72+
return this;
73+
}
74+
75+
/**
76+
* Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
77+
* subsequent calls adds additional elements to the original list. See {@link
78+
* SubscriptionAttachCadenceParams#expand} for the field documentation.
79+
*/
80+
public Builder addExpand(String element) {
81+
if (this.expand == null) {
82+
this.expand = new ArrayList<>();
83+
}
84+
this.expand.add(element);
85+
return this;
86+
}
87+
88+
/**
89+
* Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
90+
* subsequent calls adds additional elements to the original list. See {@link
91+
* SubscriptionAttachCadenceParams#expand} for the field documentation.
92+
*/
93+
public Builder addAllExpand(List<String> elements) {
94+
if (this.expand == null) {
95+
this.expand = new ArrayList<>();
96+
}
97+
this.expand.addAll(elements);
98+
return this;
99+
}
100+
101+
/**
102+
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
103+
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
104+
* SubscriptionAttachCadenceParams#extraParams} for the field documentation.
105+
*/
106+
public Builder putExtraParam(String key, Object value) {
107+
if (this.extraParams == null) {
108+
this.extraParams = new HashMap<>();
109+
}
110+
this.extraParams.put(key, value);
111+
return this;
112+
}
113+
114+
/**
115+
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
116+
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
117+
* See {@link SubscriptionAttachCadenceParams#extraParams} for the field documentation.
118+
*/
119+
public Builder putAllExtraParam(Map<String, Object> map) {
120+
if (this.extraParams == null) {
121+
this.extraParams = new HashMap<>();
122+
}
123+
this.extraParams.putAll(map);
124+
return this;
125+
}
126+
}
127+
}

0 commit comments

Comments
 (0)