Skip to content

Commit ca59835

Browse files
Merge pull request #2119 from stripe/latest-codegen-private-preview
Update generated code for private-preview
2 parents 40ce066 + d69c3c0 commit ca59835

File tree

12 files changed

+862
-24
lines changed

12 files changed

+862
-24
lines changed

API_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7f436e73385732b1c5502f408a6fe37f7b6b0612
1+
368be7755d15d02a1038325c7d159703b01662b0

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2128
1+
v2129

src/main/java/com/stripe/StripeClient.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,18 @@ public com.stripe.service.PrivacyService privacy() {
761761
return new com.stripe.service.PrivacyService(this.getResponseGetter());
762762
}
763763

764+
/**
765+
* @deprecated StripeClient.productCatalog() is deprecated, use StripeClient.v1().productCatalog()
766+
* instead. All functionality under it has been copied over to
767+
* StripeClient.v1().productCatalog(). See <a
768+
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
769+
* guide</a> for more on this and tips on migrating to the new v1 namespace.
770+
*/
771+
@Deprecated
772+
public com.stripe.service.ProductCatalogService productCatalog() {
773+
return new com.stripe.service.ProductCatalogService(this.getResponseGetter());
774+
}
775+
764776
/**
765777
* @deprecated StripeClient.products() is deprecated, use StripeClient.v1().products() instead.
766778
* All functionality under it has been copied over to StripeClient.v1().products(). See <a

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ public final class EventDataClassLookup {
214214
"privacy.redaction_job_validation_error",
215215
com.stripe.model.privacy.RedactionJobValidationError.class);
216216

217+
classLookup.put(
218+
"product_catalog.trial_offer", com.stripe.model.productcatalog.TrialOffer.class);
219+
217220
classLookup.put("radar.account_evaluation", com.stripe.model.radar.AccountEvaluation.class);
218221
classLookup.put("radar.early_fraud_warning", com.stripe.model.radar.EarlyFraudWarning.class);
219222
classLookup.put("radar.value_list", com.stripe.model.radar.ValueList.class);

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,13 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
303303
@SerializedName("payment_method_types")
304304
List<String> paymentMethodTypes;
305305

306+
/**
307+
* When you enable this parameter, this PaymentIntent will route your payment to processors that
308+
* you configure in the dashboard.
309+
*/
310+
@SerializedName("payments_orchestration")
311+
PaymentsOrchestration paymentsOrchestration;
312+
306313
@SerializedName("presentment_details")
307314
PresentmentDetails presentmentDetails;
308315

@@ -6342,6 +6349,19 @@ public static class Zip extends StripeObject {
63426349
}
63436350
}
63446351

6352+
/**
6353+
* For more details about PaymentsOrchestration, please refer to the <a
6354+
* href="https://docs.stripe.com/api">API Reference.</a>
6355+
*/
6356+
@Getter
6357+
@Setter
6358+
@EqualsAndHashCode(callSuper = false)
6359+
public static class PaymentsOrchestration extends StripeObject {
6360+
/** Whether this feature is enabled. */
6361+
@SerializedName("enabled")
6362+
Boolean enabled;
6363+
}
6364+
63456365
/**
63466366
* For more details about PresentmentDetails, please refer to the <a
63476367
* href="https://docs.stripe.com/api">API Reference.</a>
@@ -6477,6 +6497,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) {
64776497
trySetResponseGetter(paymentMethod, responseGetter);
64786498
trySetResponseGetter(paymentMethodConfigurationDetails, responseGetter);
64796499
trySetResponseGetter(paymentMethodOptions, responseGetter);
6500+
trySetResponseGetter(paymentsOrchestration, responseGetter);
64806501
trySetResponseGetter(presentmentDetails, responseGetter);
64816502
trySetResponseGetter(processing, responseGetter);
64826503
trySetResponseGetter(review, responseGetter);

src/main/java/com/stripe/model/delegatedcheckout/RequestedSession.java

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -536,14 +536,6 @@ public static class LineItemDetail extends StripeObject {
536536
@SerializedName("amount_subtotal")
537537
Long amountSubtotal;
538538

539-
/** The total after discounts but before taxes are applied. */
540-
@SerializedName("amount_subtotal_after_discount")
541-
Long amountSubtotalAfterDiscount;
542-
543-
/** The total after discounts and taxes. */
544-
@SerializedName("amount_total")
545-
Long amountTotal;
546-
547539
/** The description of the line item. */
548540
@SerializedName("description")
549541
String description;
@@ -571,14 +563,6 @@ public static class LineItemDetail extends StripeObject {
571563
/** The per-unit amount of the item before any discounts or taxes are applied. */
572564
@SerializedName("unit_amount")
573565
Long unitAmount;
574-
575-
/** The per-unit amount of the item after discounts but before taxes are applied. */
576-
@SerializedName("unit_amount_after_discount")
577-
Long unitAmountAfterDiscount;
578-
579-
/** The per-unit discount amount. If no discount were applied, defaults to 0. */
580-
@SerializedName("unit_discount")
581-
Long unitDiscount;
582566
}
583567

584568
/**
@@ -718,17 +702,23 @@ public static class SellerDetails extends StripeObject {}
718702
@Setter
719703
@EqualsAndHashCode(callSuper = false)
720704
public static class TotalDetails extends StripeObject {
721-
/** The amount discount of the total details. */
722-
@SerializedName("amount_discount")
723-
Long amountDiscount;
705+
/**
706+
* The amount of order-level discounts applied to the cart. The total discount amount for this
707+
* session can be computed by summing the cart discount and the item discounts.
708+
*/
709+
@SerializedName("amount_cart_discount")
710+
Long amountCartDiscount;
724711

725712
/** The amount fulfillment of the total details. */
726713
@SerializedName("amount_fulfillment")
727714
Long amountFulfillment;
728715

729-
/** Total of all items after discounts but before taxes are applied. */
730-
@SerializedName("amount_subtotal_after_discount")
731-
Long amountSubtotalAfterDiscount;
716+
/**
717+
* The amount of item-level discounts applied to the cart. The total discount amount for this
718+
* session can be computed by summing the cart discount and the item discounts.
719+
*/
720+
@SerializedName("amount_items_discount")
721+
Long amountItemsDiscount;
732722

733723
/** The amount tax of the total details. */
734724
@SerializedName("amount_tax")
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
// File generated from our OpenAPI spec
2+
package com.stripe.model.productcatalog;
3+
4+
import com.google.gson.annotations.SerializedName;
5+
import com.stripe.exception.StripeException;
6+
import com.stripe.model.ExpandableField;
7+
import com.stripe.model.HasId;
8+
import com.stripe.model.Price;
9+
import com.stripe.model.StripeObject;
10+
import com.stripe.net.ApiRequest;
11+
import com.stripe.net.ApiRequestParams;
12+
import com.stripe.net.ApiResource;
13+
import com.stripe.net.BaseAddress;
14+
import com.stripe.net.RequestOptions;
15+
import com.stripe.net.StripeResponseGetter;
16+
import com.stripe.param.productcatalog.TrialOfferCreateParams;
17+
import java.util.Map;
18+
import lombok.EqualsAndHashCode;
19+
import lombok.Getter;
20+
import lombok.Setter;
21+
22+
/**
23+
* Resource for the TrialOffer API, used to describe a subscription item's trial period settings.
24+
* Renders a TrialOffer object that describes the price, duration, end_behavior of a trial offer.
25+
*/
26+
@Getter
27+
@Setter
28+
@EqualsAndHashCode(callSuper = false)
29+
public class TrialOffer extends ApiResource implements HasId {
30+
@SerializedName("duration")
31+
Duration duration;
32+
33+
@SerializedName("end_behavior")
34+
EndBehavior endBehavior;
35+
36+
/** Unique identifier for the object. */
37+
@Getter(onMethod_ = {@Override})
38+
@SerializedName("id")
39+
String id;
40+
41+
/**
42+
* Has the value {@code true} if the object exists in live mode or the value {@code false} if the
43+
* object exists in test mode.
44+
*/
45+
@SerializedName("livemode")
46+
Boolean livemode;
47+
48+
/**
49+
* String representing the object's type. Objects of the same type share the same value.
50+
*
51+
* <p>Equal to {@code product_catalog.trial_offer}.
52+
*/
53+
@SerializedName("object")
54+
String object;
55+
56+
/** The price during the trial offer. */
57+
@SerializedName("price")
58+
@Getter(lombok.AccessLevel.NONE)
59+
@Setter(lombok.AccessLevel.NONE)
60+
ExpandableField<Price> price;
61+
62+
/** Get ID of expandable {@code price} object. */
63+
public String getPrice() {
64+
return (this.price != null) ? this.price.getId() : null;
65+
}
66+
67+
public void setPrice(String id) {
68+
this.price = ApiResource.setExpandableFieldId(id, this.price);
69+
}
70+
71+
/** Get expanded {@code price}. */
72+
public Price getPriceObject() {
73+
return (this.price != null) ? this.price.getExpanded() : null;
74+
}
75+
76+
public void setPriceObject(Price expandableObject) {
77+
this.price = new ExpandableField<Price>(expandableObject.getId(), expandableObject);
78+
}
79+
80+
/** Creates a trial offer. */
81+
public static TrialOffer create(Map<String, Object> params) throws StripeException {
82+
return create(params, (RequestOptions) null);
83+
}
84+
85+
/** Creates a trial offer. */
86+
public static TrialOffer create(Map<String, Object> params, RequestOptions options)
87+
throws StripeException {
88+
String path = "/v1/product_catalog/trial_offers";
89+
ApiRequest request =
90+
new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
91+
return getGlobalResponseGetter().request(request, TrialOffer.class);
92+
}
93+
94+
/** Creates a trial offer. */
95+
public static TrialOffer create(TrialOfferCreateParams params) throws StripeException {
96+
return create(params, (RequestOptions) null);
97+
}
98+
99+
/** Creates a trial offer. */
100+
public static TrialOffer create(TrialOfferCreateParams params, RequestOptions options)
101+
throws StripeException {
102+
String path = "/v1/product_catalog/trial_offers";
103+
ApiResource.checkNullTypedParams(path, params);
104+
ApiRequest request =
105+
new ApiRequest(
106+
BaseAddress.API,
107+
ApiResource.RequestMethod.POST,
108+
path,
109+
ApiRequestParams.paramsToMap(params),
110+
options);
111+
return getGlobalResponseGetter().request(request, TrialOffer.class);
112+
}
113+
114+
/**
115+
* For more details about Duration, please refer to the <a href="https://docs.stripe.com/api">API
116+
* Reference.</a>
117+
*/
118+
@Getter
119+
@Setter
120+
@EqualsAndHashCode(callSuper = false)
121+
public static class Duration extends StripeObject {
122+
@SerializedName("relative")
123+
Relative relative;
124+
125+
/**
126+
* The type of trial offer duration.
127+
*
128+
* <p>One of {@code relative}, or {@code timestamp}.
129+
*/
130+
@SerializedName("type")
131+
String type;
132+
133+
/**
134+
* For more details about Relative, please refer to the <a
135+
* href="https://docs.stripe.com/api">API Reference.</a>
136+
*/
137+
@Getter
138+
@Setter
139+
@EqualsAndHashCode(callSuper = false)
140+
public static class Relative extends StripeObject {
141+
/** The number of iterations of the price's interval for this trial offer. */
142+
@SerializedName("iterations")
143+
Long iterations;
144+
}
145+
}
146+
147+
/**
148+
* For more details about EndBehavior, please refer to the <a
149+
* href="https://docs.stripe.com/api">API Reference.</a>
150+
*/
151+
@Getter
152+
@Setter
153+
@EqualsAndHashCode(callSuper = false)
154+
public static class EndBehavior extends StripeObject {
155+
@SerializedName("transition")
156+
Transition transition;
157+
158+
/**
159+
* The type of behavior when the trial offer ends.
160+
*
161+
* <p>Equal to {@code transition}.
162+
*/
163+
@SerializedName("type")
164+
String type;
165+
166+
/**
167+
* For more details about Transition, please refer to the <a
168+
* href="https://docs.stripe.com/api">API Reference.</a>
169+
*/
170+
@Getter
171+
@Setter
172+
@EqualsAndHashCode(callSuper = false)
173+
public static class Transition extends StripeObject {
174+
/** The new price to use at the end of the trial offer period. */
175+
@SerializedName("price")
176+
String price;
177+
}
178+
}
179+
180+
@Override
181+
public void setResponseGetter(StripeResponseGetter responseGetter) {
182+
super.setResponseGetter(responseGetter);
183+
trySetResponseGetter(duration, responseGetter);
184+
trySetResponseGetter(endBehavior, responseGetter);
185+
trySetResponseGetter(price, responseGetter);
186+
}
187+
}

0 commit comments

Comments
 (0)