Skip to content

Commit 3ae4c00

Browse files
jar-stripeclaude
andcommitted
Regenerate with decimal_string enabled for v2 APIs
V2 API fields with `format: decimal` now generate as `BigDecimal` instead of `String`. Driven by sdk-codegen#3369. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Committed-By-Agent: claude
1 parent 608ca74 commit 3ae4c00

22 files changed

Lines changed: 163 additions & 908 deletions

src/main/java/com/stripe/exception/StripeException.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ public static StripeException parseV2Exception(
110110
StripeResponseGetter responseGetter) {
111111
switch (type) {
112112
// The beginning of the section generated from our OpenAPI spec
113+
case "rate_limit":
114+
return com.stripe.exception.RateLimitException.parse(
115+
body, statusCode, requestId, responseGetter);
113116
case "temporary_session_expired":
114117
return com.stripe.exception.TemporarySessionExpiredException.parse(
115118
body, statusCode, requestId, responseGetter);

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5120,14 +5120,6 @@ public static class UsBankAccount extends StripeObject {
51205120
@SerializedName("mandate_options")
51215121
MandateOptions mandateOptions;
51225122

5123-
/**
5124-
* Preferred transaction settlement speed
5125-
*
5126-
* <p>One of {@code fastest}, or {@code standard}.
5127-
*/
5128-
@SerializedName("preferred_settlement_speed")
5129-
String preferredSettlementSpeed;
5130-
51315123
/**
51325124
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
51335125
*

src/main/java/com/stripe/model/v2/core/Account.java

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import com.google.gson.annotations.SerializedName;
55
import com.stripe.model.HasId;
66
import com.stripe.model.StripeObject;
7+
import com.stripe.v2.Amount;
8+
import java.math.BigDecimal;
79
import java.time.Instant;
810
import java.util.List;
911
import java.util.Map;
@@ -4250,27 +4252,6 @@ public static class AnnualRevenue extends StripeObject {
42504252
*/
42514253
@SerializedName("fiscal_year_end")
42524254
String fiscalYearEnd;
4253-
4254-
/** Annual revenue amount in minor currency units (for example, '123' for 1.23 USD). */
4255-
@Getter
4256-
@Setter
4257-
@EqualsAndHashCode(callSuper = false)
4258-
public static class Amount extends StripeObject {
4259-
/**
4260-
* Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
4261-
* code</a>, in lowercase. Must be a <a
4262-
* href="https://stripe.com/docs/currencies">supported currency</a>.
4263-
*/
4264-
@SerializedName("currency")
4265-
String currency;
4266-
4267-
/**
4268-
* A non-negative integer representing how much to charge in the <a
4269-
* href="https://docs.stripe.com/currencies#minor-units">smallest currency unit</a>.
4270-
*/
4271-
@SerializedName("value")
4272-
Long value;
4273-
}
42744255
}
42754256

42764257
/** Documents that may be submitted to satisfy various informational requests. */
@@ -4649,30 +4630,6 @@ public static class MonthlyEstimatedRevenue extends StripeObject {
46494630
*/
46504631
@SerializedName("amount")
46514632
Amount amount;
4652-
4653-
/**
4654-
* Estimated monthly revenue amount in minor currency units (for example, '123' for 1.23
4655-
* USD).
4656-
*/
4657-
@Getter
4658-
@Setter
4659-
@EqualsAndHashCode(callSuper = false)
4660-
public static class Amount extends StripeObject {
4661-
/**
4662-
* Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
4663-
* code</a>, in lowercase. Must be a <a
4664-
* href="https://stripe.com/docs/currencies">supported currency</a>.
4665-
*/
4666-
@SerializedName("currency")
4667-
String currency;
4668-
4669-
/**
4670-
* A non-negative integer representing how much to charge in the <a
4671-
* href="https://docs.stripe.com/currencies#minor-units">smallest currency unit</a>.
4672-
*/
4673-
@SerializedName("value")
4674-
Long value;
4675-
}
46764633
}
46774634

46784635
/** When the business was incorporated or registered. */
@@ -5389,7 +5346,7 @@ public static class Relationship extends StripeObject {
53895346

53905347
/** The percentage of the Account's identity that the individual owns. */
53915348
@SerializedName("percent_ownership")
5392-
String percentOwnership;
5349+
BigDecimal percentOwnership;
53935350

53945351
/**
53955352
* Whether the individual is authorized as the primary representative of the Account. This

src/main/java/com/stripe/model/v2/core/AccountPerson.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.google.gson.annotations.SerializedName;
55
import com.stripe.model.HasId;
66
import com.stripe.model.StripeObject;
7+
import java.math.BigDecimal;
78
import java.time.Instant;
89
import java.util.List;
910
import java.util.Map;
@@ -584,7 +585,7 @@ public static class Relationship extends StripeObject {
584585

585586
/** The percentage of the Account's identity that the individual owns. */
586587
@SerializedName("percent_ownership")
587-
String percentOwnership;
588+
BigDecimal percentOwnership;
588589

589590
/**
590591
* Whether the individual is authorized as the primary representative of the Account. This is

src/main/java/com/stripe/model/v2/core/Event.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected StripeObject fetchRelatedObject(RelatedObject relatedObject) throws St
9999
}
100100

101101
RequestOptions.RequestOptionsBuilder optsBuilder = new RequestOptions.RequestOptionsBuilder();
102-
optsBuilder.setStripeRequestTrigger("event=" + id);
102+
// optsBuilder.setStripeRequestTrigger("event=" + id); // TODO https://go/j/DEVSDK-3018
103103

104104
if (context != null) {
105105
optsBuilder.setStripeAccount(context);

src/main/java/com/stripe/model/v2/core/EventDestination.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,14 @@ public class EventDestination extends StripeObject implements HasId {
4646
@SerializedName("event_payload")
4747
String eventPayload;
4848

49-
/** Where events should be routed from. */
49+
/**
50+
* Specifies which accounts' events route to this destination. {@code @self}: Receive events from
51+
* the account that owns the event destination. {@code @accounts}: Receive events emitted from
52+
* other accounts you manage which includes your v1 and v2 accounts.
53+
* {@code @organization_members}: Receive events from accounts directly linked to the
54+
* organization. {@code @organization_members/@accounts}: Receive events from all accounts
55+
* connected to any platform accounts in the organization.
56+
*/
5057
@SerializedName("events_from")
5158
List<String> eventsFrom;
5259

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

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22206,10 +22206,6 @@ public static class UsBankAccount {
2220622206
@SerializedName("networks")
2220722207
Networks networks;
2220822208

22209-
/** Preferred transaction settlement speed. */
22210-
@SerializedName("preferred_settlement_speed")
22211-
ApiRequestParams.EnumParam preferredSettlementSpeed;
22212-
2221322209
/**
2221422210
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
2221522211
*
@@ -22257,7 +22253,6 @@ private UsBankAccount(
2225722253
FinancialConnections financialConnections,
2225822254
MandateOptions mandateOptions,
2225922255
Networks networks,
22260-
ApiRequestParams.EnumParam preferredSettlementSpeed,
2226122256
ApiRequestParams.EnumParam setupFutureUsage,
2226222257
String targetDate,
2226322258
ApiRequestParams.EnumParam transactionPurpose,
@@ -22266,7 +22261,6 @@ private UsBankAccount(
2226622261
this.financialConnections = financialConnections;
2226722262
this.mandateOptions = mandateOptions;
2226822263
this.networks = networks;
22269-
this.preferredSettlementSpeed = preferredSettlementSpeed;
2227022264
this.setupFutureUsage = setupFutureUsage;
2227122265
this.targetDate = targetDate;
2227222266
this.transactionPurpose = transactionPurpose;
@@ -22286,8 +22280,6 @@ public static class Builder {
2228622280

2228722281
private Networks networks;
2228822282

22289-
private ApiRequestParams.EnumParam preferredSettlementSpeed;
22290-
2229122283
private ApiRequestParams.EnumParam setupFutureUsage;
2229222284

2229322285
private String targetDate;
@@ -22303,7 +22295,6 @@ public PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount build() {
2230322295
this.financialConnections,
2230422296
this.mandateOptions,
2230522297
this.networks,
22306-
this.preferredSettlementSpeed,
2230722298
this.setupFutureUsage,
2230822299
this.targetDate,
2230922300
this.transactionPurpose,
@@ -22363,20 +22354,6 @@ public Builder setNetworks(
2236322354
return this;
2236422355
}
2236522356

22366-
/** Preferred transaction settlement speed. */
22367-
public Builder setPreferredSettlementSpeed(
22368-
PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.PreferredSettlementSpeed
22369-
preferredSettlementSpeed) {
22370-
this.preferredSettlementSpeed = preferredSettlementSpeed;
22371-
return this;
22372-
}
22373-
22374-
/** Preferred transaction settlement speed. */
22375-
public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) {
22376-
this.preferredSettlementSpeed = preferredSettlementSpeed;
22377-
return this;
22378-
}
22379-
2238022357
/**
2238122358
* Indicates that you intend to make future payments with this PaymentIntent's payment
2238222359
* method.
@@ -23083,21 +23060,6 @@ public enum Requested implements ApiRequestParams.EnumParam {
2308323060
}
2308423061
}
2308523062

23086-
public enum PreferredSettlementSpeed implements ApiRequestParams.EnumParam {
23087-
@SerializedName("fastest")
23088-
FASTEST("fastest"),
23089-
23090-
@SerializedName("standard")
23091-
STANDARD("standard");
23092-
23093-
@Getter(onMethod_ = {@Override})
23094-
private final String value;
23095-
23096-
PreferredSettlementSpeed(String value) {
23097-
this.value = value;
23098-
}
23099-
}
23100-
2310123063
public enum SetupFutureUsage implements ApiRequestParams.EnumParam {
2310223064
@SerializedName("none")
2310323065
NONE("none"),

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

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22708,10 +22708,6 @@ public static class UsBankAccount {
2270822708
@SerializedName("networks")
2270922709
Networks networks;
2271022710

22711-
/** Preferred transaction settlement speed. */
22712-
@SerializedName("preferred_settlement_speed")
22713-
ApiRequestParams.EnumParam preferredSettlementSpeed;
22714-
2271522711
/**
2271622712
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
2271722713
*
@@ -22759,7 +22755,6 @@ private UsBankAccount(
2275922755
FinancialConnections financialConnections,
2276022756
MandateOptions mandateOptions,
2276122757
Networks networks,
22762-
ApiRequestParams.EnumParam preferredSettlementSpeed,
2276322758
ApiRequestParams.EnumParam setupFutureUsage,
2276422759
String targetDate,
2276522760
ApiRequestParams.EnumParam transactionPurpose,
@@ -22768,7 +22763,6 @@ private UsBankAccount(
2276822763
this.financialConnections = financialConnections;
2276922764
this.mandateOptions = mandateOptions;
2277022765
this.networks = networks;
22771-
this.preferredSettlementSpeed = preferredSettlementSpeed;
2277222766
this.setupFutureUsage = setupFutureUsage;
2277322767
this.targetDate = targetDate;
2277422768
this.transactionPurpose = transactionPurpose;
@@ -22788,8 +22782,6 @@ public static class Builder {
2278822782

2278922783
private Networks networks;
2279022784

22791-
private ApiRequestParams.EnumParam preferredSettlementSpeed;
22792-
2279322785
private ApiRequestParams.EnumParam setupFutureUsage;
2279422786

2279522787
private String targetDate;
@@ -22805,7 +22797,6 @@ public PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount build() {
2280522797
this.financialConnections,
2280622798
this.mandateOptions,
2280722799
this.networks,
22808-
this.preferredSettlementSpeed,
2280922800
this.setupFutureUsage,
2281022801
this.targetDate,
2281122802
this.transactionPurpose,
@@ -22863,20 +22854,6 @@ public Builder setNetworks(
2286322854
return this;
2286422855
}
2286522856

22866-
/** Preferred transaction settlement speed. */
22867-
public Builder setPreferredSettlementSpeed(
22868-
PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.PreferredSettlementSpeed
22869-
preferredSettlementSpeed) {
22870-
this.preferredSettlementSpeed = preferredSettlementSpeed;
22871-
return this;
22872-
}
22873-
22874-
/** Preferred transaction settlement speed. */
22875-
public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) {
22876-
this.preferredSettlementSpeed = preferredSettlementSpeed;
22877-
return this;
22878-
}
22879-
2288022857
/**
2288122858
* Indicates that you intend to make future payments with this PaymentIntent's payment
2288222859
* method.
@@ -23583,21 +23560,6 @@ public enum Requested implements ApiRequestParams.EnumParam {
2358323560
}
2358423561
}
2358523562

23586-
public enum PreferredSettlementSpeed implements ApiRequestParams.EnumParam {
23587-
@SerializedName("fastest")
23588-
FASTEST("fastest"),
23589-
23590-
@SerializedName("standard")
23591-
STANDARD("standard");
23592-
23593-
@Getter(onMethod_ = {@Override})
23594-
private final String value;
23595-
23596-
PreferredSettlementSpeed(String value) {
23597-
this.value = value;
23598-
}
23599-
}
23600-
2360123563
public enum SetupFutureUsage implements ApiRequestParams.EnumParam {
2360223564
@SerializedName("none")
2360323565
NONE("none"),

0 commit comments

Comments
 (0)