diff --git a/API_VERSION b/API_VERSION index dc9d80dc3e3..0d5c06d24fb 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -368be7755d15d02a1038325c7d159703b01662b0 \ No newline at end of file +1307ab81356642fb1bf890524815d5cb6997a34d \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 3809bd6156a..3c718cc2c37 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2129 \ No newline at end of file +v2132 \ No newline at end of file diff --git a/build.gradle b/build.gradle index 5c4659785ee..aebb8359c45 100644 --- a/build.gradle +++ b/build.gradle @@ -99,7 +99,8 @@ jar { "Implementation-Version": VERSION_NAME, "Implementation-Vendor": VENDOR_NAME, "Bundle-SymbolicName": POM_ARTIFACT_ID, - "Export-Package": "com.stripe.*") + "Export-Package": "com.stripe.*", + "Automatic-Module-Name": "stripe.java") archiveVersion = VERSION_NAME } diff --git a/src/main/java/com/stripe/model/AccountSession.java b/src/main/java/com/stripe/model/AccountSession.java index ace8aea4254..bc337f43a66 100644 --- a/src/main/java/com/stripe/model/AccountSession.java +++ b/src/main/java/com/stripe/model/AccountSession.java @@ -144,6 +144,14 @@ public static class Components extends StripeObject { @SerializedName("capital_financing_promotion") CapitalFinancingPromotion capitalFinancingPromotion; + /** + * Configuration for the check + * scanning embedded component. + */ + @SerializedName("check_scanning") + CheckScanning checkScanning; + @SerializedName("disputes_list") DisputesList disputesList; @@ -423,6 +431,31 @@ public static class CapitalFinancingPromotion extends StripeObject { public static class Features extends StripeObject {} } + /** + * For more details about CheckScanning, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CheckScanning extends StripeObject { + /** Whether the embedded component is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + @SerializedName("features") + Features features; + + /** + * For more details about Features, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Features extends StripeObject {} + } + /** * For more details about DisputesList, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/Person.java b/src/main/java/com/stripe/model/Person.java index 3e5f16295e6..2e3dc67859d 100644 --- a/src/main/java/com/stripe/model/Person.java +++ b/src/main/java/com/stripe/model/Person.java @@ -850,7 +850,7 @@ public static class Errors extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class SelfReportedIncome extends StripeObject { - /** Amount in the minor currency unit (e.g., cents for USD). */ + /** The amount in the minor currency unit (for example, cents for USD). */ @SerializedName("amount") Long amount; @@ -871,7 +871,7 @@ public static class SelfReportedIncome extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class SelfReportedMonthlyHousingPayment extends StripeObject { - /** Amount in the minor currency unit (e.g., cents for USD). */ + /** The amount in the minor currency unit (for example, cents for USD). */ @SerializedName("amount") Long amount; diff --git a/src/main/java/com/stripe/model/delegatedcheckout/RequestedSession.java b/src/main/java/com/stripe/model/delegatedcheckout/RequestedSession.java index bc2d50a00d8..28b50658cd7 100644 --- a/src/main/java/com/stripe/model/delegatedcheckout/RequestedSession.java +++ b/src/main/java/com/stripe/model/delegatedcheckout/RequestedSession.java @@ -420,7 +420,10 @@ public static class Address extends StripeObject { @SerializedName("postal_code") String postalCode; - /** State, county, province, or region. */ + /** + * State, county, province, or region (ISO + * 3166-2). + */ @SerializedName("state") String state; } @@ -657,7 +660,10 @@ public static class Address extends StripeObject { @SerializedName("postal_code") String postalCode; - /** State, county, province, or region. */ + /** + * State, county, province, or region (ISO 3166-2). + */ @SerializedName("state") String state; } diff --git a/src/main/java/com/stripe/model/v2/core/Event.java b/src/main/java/com/stripe/model/v2/core/Event.java index 1c9b0fed797..c19c433c879 100644 --- a/src/main/java/com/stripe/model/v2/core/Event.java +++ b/src/main/java/com/stripe/model/v2/core/Event.java @@ -161,6 +161,10 @@ public static class Reason extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Request extends StripeObject implements HasId { + /** The client details that made the request. */ + @SerializedName("client") + Client client; + /** ID of the API request that caused the event. */ @Getter(onMethod_ = {@Override}) @SerializedName("id") @@ -169,6 +173,61 @@ public static class Request extends StripeObject implements HasId { /** The idempotency key transmitted during the request. */ @SerializedName("idempotency_key") String idempotencyKey; + + /** The client details that made the request. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Client extends StripeObject { + /** API key that triggered the event. */ + @SerializedName("api_key") + ApiKey apiKey; + + /** Dashboard user that triggered the event. */ + @SerializedName("dashboard_user") + DashboardUser dashboardUser; + + /** Stripe action that triggered the event. */ + @SerializedName("stripe_action") + Map stripeAction; + + /** + * The type of the client. + * + *

One of {@code api_key}, {@code dashboard_user}, or {@code stripe_action}. + */ + @SerializedName("type") + String type; + + /** API key that triggered the event. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ApiKey extends StripeObject implements HasId { + /** The ID of the API key. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + } + + /** Dashboard user that triggered the event. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DashboardUser extends StripeObject { + /** The email of the dashboard user. */ + @SerializedName("email") + String email; + + /** The IP address of the user. */ + @SerializedName("ip_address") + String ipAddress; + + /** The machine identifier of the user. */ + @SerializedName("machine_identifier") + String machineIdentifier; + } + } } } } diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java index 2d5919f6972..e12f6087b48 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java @@ -101,10 +101,18 @@ public class ReceivedCredit extends StripeObject implements HasId { @SerializedName("status_transitions") StatusTransitions statusTransitions; + /** + * This object stores details about the stripe balance pay refund that resulted in the + * ReceivedCredit. Present if {@code type} field value is {@code stripe_balance_payment}. + */ + @SerializedName("stripe_balance_payment") + StripeBalancePayment stripeBalancePayment; + /** * Open Enum. The type of flow that caused the ReceivedCredit. * - *

One of {@code balance_transfer}, {@code bank_transfer}, or {@code external_credit}. + *

One of {@code balance_transfer}, {@code bank_transfer}, {@code external_credit}, or {@code + * stripe_balance_payment}. */ @SerializedName("type") String type; @@ -416,4 +424,17 @@ public static class StatusTransitions extends StripeObject { @SerializedName("succeeded_at") Instant succeededAt; } + + /** + * This object stores details about the stripe balance pay refund that resulted in the + * ReceivedCredit. Present if {@code type} field value is {@code stripe_balance_payment}. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StripeBalancePayment extends StripeObject { + /** Statement descriptor for the Stripe Balance Payment. */ + @SerializedName("statement_descriptor") + String statementDescriptor; + } } diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java index f3b59a9b7e7..a1700b707f7 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java @@ -18,6 +18,13 @@ public class ReceivedDebit extends StripeObject implements HasId { @SerializedName("amount") Amount amount; + /** + * This object stores details about the balance transfer object that resulted in the + * ReceivedDebit. + */ + @SerializedName("balance_transfer") + BalanceTransfer balanceTransfer; + /** * This object stores details about the originating banking transaction that resulted in the * ReceivedDebit. Present if {@code type} field value is {@code bank_transfer}. @@ -87,9 +94,16 @@ public class ReceivedDebit extends StripeObject implements HasId { StatusTransitions statusTransitions; /** - * Open Enum. The type of the ReceivedDebit. + * This object stores details about the Stripe Balance Payment that resulted in the ReceivedDebit. + */ + @SerializedName("stripe_balance_payment") + StripeBalancePayment stripeBalancePayment; + + /** + * Open enum, the type of the received debit. * - *

One of {@code bank_transfer}, or {@code external_debit}. + *

One of {@code balance_transfer}, {@code bank_transfer}, {@code external_debit}, or {@code + * stripe_balance_payment}. */ @SerializedName("type") String type; @@ -115,6 +129,27 @@ public static class Amount extends StripeObject { Long value; } + /** + * This object stores details about the balance transfer object that resulted in the + * ReceivedDebit. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BalanceTransfer extends StripeObject { + /** The ID of the topup object that originated the ReceivedDebit. */ + @SerializedName("topup") + String topup; + + /** + * Open Enum. The type of balance transfer that originated the ReceivedDebit. + * + *

Equal to {@code topup}. + */ + @SerializedName("type") + String type; + } + /** * This object stores details about the originating banking transaction that resulted in the * ReceivedDebit. Present if {@code type} field value is {@code bank_transfer}. @@ -254,4 +289,20 @@ public static class StatusTransitions extends StripeObject { @SerializedName("succeeded_at") Instant succeededAt; } + + /** + * This object stores details about the Stripe Balance Payment that resulted in the ReceivedDebit. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StripeBalancePayment extends StripeObject { + /** ID of the debit agreement associated with this payment. */ + @SerializedName("debit_agreement") + String debitAgreement; + + /** Statement descriptor for the Stripe Balance Payment. */ + @SerializedName("statement_descriptor") + String statementDescriptor; + } } diff --git a/src/main/java/com/stripe/param/AccountCreateParams.java b/src/main/java/com/stripe/param/AccountCreateParams.java index f7452b7faa9..9281c17fe64 100644 --- a/src/main/java/com/stripe/param/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/AccountCreateParams.java @@ -13521,11 +13521,18 @@ public Builder setTitle(String title) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedIncome { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ @SerializedName("currency") String currency; @@ -13561,13 +13568,20 @@ public AccountCreateParams.Individual.SelfReportedIncome build() { this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; @@ -13606,11 +13620,18 @@ public Builder putAllExtraParam(Map map) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedMonthlyHousingPayment { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ @SerializedName("currency") String currency; @@ -13647,13 +13668,20 @@ public AccountCreateParams.Individual.SelfReportedMonthlyHousingPayment build() this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; diff --git a/src/main/java/com/stripe/param/AccountPersonCreateParams.java b/src/main/java/com/stripe/param/AccountPersonCreateParams.java index 0409f5607b4..6fff20183b2 100644 --- a/src/main/java/com/stripe/param/AccountPersonCreateParams.java +++ b/src/main/java/com/stripe/param/AccountPersonCreateParams.java @@ -2250,11 +2250,18 @@ public Builder setTitle(String title) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedIncome { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ @SerializedName("currency") String currency; @@ -2290,13 +2297,20 @@ public AccountPersonCreateParams.SelfReportedIncome build() { this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; @@ -2334,11 +2348,18 @@ public Builder putAllExtraParam(Map map) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedMonthlyHousingPayment { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ @SerializedName("currency") String currency; @@ -2375,13 +2396,20 @@ public AccountPersonCreateParams.SelfReportedMonthlyHousingPayment build() { this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; diff --git a/src/main/java/com/stripe/param/AccountPersonUpdateParams.java b/src/main/java/com/stripe/param/AccountPersonUpdateParams.java index 4769482777d..f389ddf8492 100644 --- a/src/main/java/com/stripe/param/AccountPersonUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountPersonUpdateParams.java @@ -2541,11 +2541,18 @@ public Builder setTitle(EmptyParam title) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedIncome { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ @SerializedName("currency") Object currency; @@ -2581,19 +2588,30 @@ public AccountPersonUpdateParams.SelfReportedIncome build() { this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(EmptyParam currency) { this.currency = currency; return this; @@ -2631,11 +2649,18 @@ public Builder putAllExtraParam(Map map) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedMonthlyHousingPayment { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ @SerializedName("currency") Object currency; @@ -2672,19 +2697,30 @@ public AccountPersonUpdateParams.SelfReportedMonthlyHousingPayment build() { this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(EmptyParam currency) { this.currency = currency; return this; diff --git a/src/main/java/com/stripe/param/AccountUpdateParams.java b/src/main/java/com/stripe/param/AccountUpdateParams.java index 53bead7540a..dd3d0d37d5f 100644 --- a/src/main/java/com/stripe/param/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountUpdateParams.java @@ -13480,11 +13480,18 @@ public Builder setTitle(EmptyParam title) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedIncome { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ @SerializedName("currency") Object currency; @@ -13520,19 +13527,30 @@ public AccountUpdateParams.Individual.SelfReportedIncome build() { this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(EmptyParam currency) { this.currency = currency; return this; @@ -13571,11 +13589,18 @@ public Builder putAllExtraParam(Map map) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedMonthlyHousingPayment { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ @SerializedName("currency") Object currency; @@ -13612,19 +13637,30 @@ public AccountUpdateParams.Individual.SelfReportedMonthlyHousingPayment build() this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(EmptyParam currency) { this.currency = currency; return this; diff --git a/src/main/java/com/stripe/param/PersonCollectionCreateParams.java b/src/main/java/com/stripe/param/PersonCollectionCreateParams.java index 6b924ec4066..cd64656d514 100644 --- a/src/main/java/com/stripe/param/PersonCollectionCreateParams.java +++ b/src/main/java/com/stripe/param/PersonCollectionCreateParams.java @@ -2256,11 +2256,18 @@ public Builder setTitle(String title) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedIncome { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ @SerializedName("currency") String currency; @@ -2296,13 +2303,20 @@ public PersonCollectionCreateParams.SelfReportedIncome build() { this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; @@ -2340,11 +2354,18 @@ public Builder putAllExtraParam(Map map) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedMonthlyHousingPayment { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ @SerializedName("currency") String currency; @@ -2381,13 +2402,20 @@ public PersonCollectionCreateParams.SelfReportedMonthlyHousingPayment build() { this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; diff --git a/src/main/java/com/stripe/param/PersonUpdateParams.java b/src/main/java/com/stripe/param/PersonUpdateParams.java index f2c243e941d..3dbca0535c8 100644 --- a/src/main/java/com/stripe/param/PersonUpdateParams.java +++ b/src/main/java/com/stripe/param/PersonUpdateParams.java @@ -2531,11 +2531,18 @@ public Builder setTitle(EmptyParam title) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedIncome { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ @SerializedName("currency") Object currency; @@ -2571,19 +2578,30 @@ public PersonUpdateParams.SelfReportedIncome build() { this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(EmptyParam currency) { this.currency = currency; return this; @@ -2620,11 +2638,18 @@ public Builder putAllExtraParam(Map map) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedMonthlyHousingPayment { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ @SerializedName("currency") Object currency; @@ -2661,19 +2686,30 @@ public PersonUpdateParams.SelfReportedMonthlyHousingPayment build() { this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(EmptyParam currency) { this.currency = currency; return this; diff --git a/src/main/java/com/stripe/param/TokenCreateParams.java b/src/main/java/com/stripe/param/TokenCreateParams.java index 08e88a9cd82..2ce8bb322b9 100644 --- a/src/main/java/com/stripe/param/TokenCreateParams.java +++ b/src/main/java/com/stripe/param/TokenCreateParams.java @@ -3609,11 +3609,18 @@ public Builder setTitle(String title) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedIncome { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ @SerializedName("currency") String currency; @@ -3650,13 +3657,21 @@ public TokenCreateParams.Account.Individual.SelfReportedIncome build() { this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents + * for USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported + * currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; @@ -3695,11 +3710,18 @@ public Builder putAllExtraParam(Map map) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedMonthlyHousingPayment { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ @SerializedName("currency") String currency; @@ -3737,13 +3759,21 @@ public TokenCreateParams.Account.Individual.SelfReportedMonthlyHousingPayment bu this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents + * for USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported + * currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; @@ -7043,11 +7073,18 @@ public Builder setTitle(String title) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedIncome { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ @SerializedName("currency") String currency; @@ -7083,13 +7120,20 @@ public TokenCreateParams.Person.SelfReportedIncome build() { this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; @@ -7128,11 +7172,18 @@ public Builder putAllExtraParam(Map map) { @Getter @EqualsAndHashCode(callSuper = false) public static class SelfReportedMonthlyHousingPayment { - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ @SerializedName("amount") Long amount; - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ @SerializedName("currency") String currency; @@ -7169,13 +7220,20 @@ public TokenCreateParams.Person.SelfReportedMonthlyHousingPayment build() { this.amount, this.currency, this.extraParams); } - /** Required. */ + /** + * Required. The amount in the minor currency unit (for example, cents for + * USD). + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** Required. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; diff --git a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionCreateParams.java b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionCreateParams.java index 9f7ec568cb1..25457706eac 100644 --- a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionCreateParams.java +++ b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionCreateParams.java @@ -461,7 +461,10 @@ public static class Address { @SerializedName("postal_code") String postalCode; - /** Required. State, county, province, or region. */ + /** + * Required. State, county, province, or region (ISO 3166-2). + */ @SerializedName("state") String state; @@ -576,7 +579,10 @@ public Builder setPostalCode(String postalCode) { return this; } - /** Required. State, county, province, or region. */ + /** + * Required. State, county, province, or region (ISO 3166-2). + */ public Builder setState(String state) { this.state = state; return this; @@ -923,7 +929,10 @@ public static class Address { @SerializedName("postal_code") String postalCode; - /** Required. State, county, province, or region. */ + /** + * Required. State, county, province, or region (ISO 3166-2). + */ @SerializedName("state") String state; @@ -1040,7 +1049,10 @@ public Builder setPostalCode(String postalCode) { return this; } - /** Required. State, county, province, or region. */ + /** + * Required. State, county, province, or region (ISO 3166-2). + */ public Builder setState(String state) { this.state = state; return this; diff --git a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java index ab8ed42e08c..f0f7f451884 100644 --- a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java +++ b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java @@ -450,7 +450,10 @@ public static class Address { @SerializedName("postal_code") Object postalCode; - /** Required. State, county, province, or region. */ + /** + * Required. State, county, province, or region (ISO 3166-2). + */ @SerializedName("state") Object state; @@ -600,13 +603,19 @@ public Builder setPostalCode(EmptyParam postalCode) { return this; } - /** Required. State, county, province, or region. */ + /** + * Required. State, county, province, or region (ISO 3166-2). + */ public Builder setState(String state) { this.state = state; return this; } - /** Required. State, county, province, or region. */ + /** + * Required. State, county, province, or region (ISO 3166-2). + */ public Builder setState(EmptyParam state) { this.state = state; return this; @@ -1155,7 +1164,10 @@ public static class Address { @SerializedName("postal_code") Object postalCode; - /** Required. State, county, province, or region. */ + /** + * Required. State, county, province, or region (ISO 3166-2). + */ @SerializedName("state") Object state; @@ -1307,13 +1319,19 @@ public Builder setPostalCode(EmptyParam postalCode) { return this; } - /** Required. State, county, province, or region. */ + /** + * Required. State, county, province, or region (ISO 3166-2). + */ public Builder setState(String state) { this.state = state; return this; } - /** Required. State, county, province, or region. */ + /** + * Required. State, county, province, or region (ISO 3166-2). + */ public Builder setState(EmptyParam state) { this.state = state; return this; diff --git a/src/main/java/com/stripe/param/v2/core/EventListParams.java b/src/main/java/com/stripe/param/v2/core/EventListParams.java index c0d2274654f..86afef47882 100644 --- a/src/main/java/com/stripe/param/v2/core/EventListParams.java +++ b/src/main/java/com/stripe/param/v2/core/EventListParams.java @@ -27,6 +27,10 @@ public class EventListParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Additional fields to include in the response. */ + @SerializedName("include") + List include; + /** The page size. */ @SerializedName("limit") Long limit; @@ -42,11 +46,13 @@ public class EventListParams extends ApiRequestParams { private EventListParams( Created created, Map extraParams, + List include, Long limit, String objectId, List types) { this.created = created; this.extraParams = extraParams; + this.include = include; this.limit = limit; this.objectId = objectId; this.types = types; @@ -61,6 +67,8 @@ public static class Builder { private Map extraParams; + private List include; + private Long limit; private String objectId; @@ -70,7 +78,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public EventListParams build() { return new EventListParams( - this.created, this.extraParams, this.limit, this.objectId, this.types); + this.created, this.extraParams, this.include, this.limit, this.objectId, this.types); } /** Set of filters to query events within a range of {@code created} timestamps. */ @@ -105,6 +113,32 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * EventListParams#include} for the field documentation. + */ + public Builder addInclude(EventListParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * EventListParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + /** The page size. */ public Builder setLimit(Long limit) { this.limit = limit; @@ -252,4 +286,16 @@ public Builder setLte(Instant lte) { } } } + + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("reason.request.client") + REASON__REQUEST__CLIENT("reason.request.client"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } } diff --git a/src/main/java/com/stripe/param/v2/core/EventRetrieveParams.java b/src/main/java/com/stripe/param/v2/core/EventRetrieveParams.java new file mode 100644 index 00000000000..3959a0ff921 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/core/EventRetrieveParams.java @@ -0,0 +1,113 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.core; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class EventRetrieveParams extends ApiRequestParams { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Additional fields to include in the response. */ + @SerializedName("include") + List include; + + private EventRetrieveParams( + Map extraParams, List include) { + this.extraParams = extraParams; + this.include = include; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List include; + + /** Finalize and obtain parameter instance from this builder. */ + public EventRetrieveParams build() { + return new EventRetrieveParams(this.extraParams, this.include); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * EventRetrieveParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link EventRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * EventRetrieveParams#include} for the field documentation. + */ + public Builder addInclude(EventRetrieveParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * EventRetrieveParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + } + + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("reason.request.client") + REASON__REQUEST__CLIENT("reason.request.client"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/service/v2/core/EventService.java b/src/main/java/com/stripe/service/v2/core/EventService.java index c461aa97db6..c7eb0d38d29 100644 --- a/src/main/java/com/stripe/service/v2/core/EventService.java +++ b/src/main/java/com/stripe/service/v2/core/EventService.java @@ -13,6 +13,7 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.v2.core.EventListParams; +import com.stripe.param.v2.core.EventRetrieveParams; public final class EventService extends ApiService { public EventService(StripeResponseGetter responseGetter) { @@ -45,14 +46,28 @@ public StripeCollection list(EventListParams params, RequestOptions optio return this.request(request, new TypeToken>() {}.getType()); } /** Retrieves the details of an event. */ - public Event retrieve(String id) throws StripeException { - return retrieve(id, (RequestOptions) null); + public Event retrieve(String id, EventRetrieveParams params) throws StripeException { + return retrieve(id, params, (RequestOptions) null); } /** Retrieves the details of an event. */ public Event retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (EventRetrieveParams) null, options); + } + /** Retrieves the details of an event. */ + public Event retrieve(String id) throws StripeException { + return retrieve(id, (EventRetrieveParams) null, (RequestOptions) null); + } + /** Retrieves the details of an event. */ + public Event retrieve(String id, EventRetrieveParams params, RequestOptions options) + throws StripeException { String path = String.format("/v2/core/events/%s", ApiResource.urlEncodeId(id)); ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); return this.request(request, Event.class); } } diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index de4a2b31165..1b41ccd535f 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -3211,13 +3211,20 @@ public void testCoreEventsGetServices() throws StripeException { null, null, com.stripe.model.v2.core.Event.class, - "{\"changes\":{\"int_key\":123,\"string_key\":\"value\",\"boolean_key\":true,\"object_key\":{\"object_int_key\":123,\"object_string_key\":\"value\",\"object_boolean_key\":true},\"array_key\":[1,2,3]},\"context\":\"context\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"livemode\":true,\"object\":\"v2.core.event\",\"reason\":{\"type\":\"request\",\"request\":{\"id\":\"obj_123\",\"idempotency_key\":\"idempotency_key\"}},\"type\":\"type\"}"); + "{\"changes\":{\"int_key\":123,\"string_key\":\"value\",\"boolean_key\":true,\"object_key\":{\"object_int_key\":123,\"object_string_key\":\"value\",\"object_boolean_key\":true},\"array_key\":[1,2,3]},\"context\":\"context\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"livemode\":true,\"object\":\"v2.core.event\",\"reason\":{\"type\":\"request\",\"request\":{\"client\":{\"type\":\"api_key\",\"api_key\":{\"id\":\"obj_123\"},\"dashboard_user\":{\"email\":\"email\",\"ip_address\":\"ip_address\",\"machine_identifier\":\"machine_identifier\"},\"stripe_action\":{\"int_key\":123,\"string_key\":\"value\",\"boolean_key\":true,\"object_key\":{\"object_int_key\":123,\"object_string_key\":\"value\",\"object_boolean_key\":true},\"array_key\":[1,2,3]}},\"id\":\"obj_123\",\"idempotency_key\":\"idempotency_key\"}},\"type\":\"type\"}"); StripeClient client = new StripeClient(networkSpy); - com.stripe.model.v2.core.Event event = client.v2().core().events().retrieve("ll_123"); + com.stripe.param.v2.core.EventRetrieveParams params = + com.stripe.param.v2.core.EventRetrieveParams.builder().build(); + + com.stripe.model.v2.core.Event event = client.v2().core().events().retrieve("ll_123", params); assertNotNull(event); verifyRequest( - BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/core/events/ll_123", null, null); + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/events/ll_123", + params.toMap(), + null); } @Test @@ -27983,10 +27990,17 @@ public void testV2CoreEventGet2Services() throws StripeException { "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"livemode\":true,\"object\":\"v2.core.event\",\"type\":\"type\"}"); StripeClient client = new StripeClient(networkSpy); - com.stripe.model.v2.core.Event event = client.v2().core().events().retrieve("id_123"); + com.stripe.param.v2.core.EventRetrieveParams params = + com.stripe.param.v2.core.EventRetrieveParams.builder().build(); + + com.stripe.model.v2.core.Event event = client.v2().core().events().retrieve("id_123", params); assertNotNull(event); verifyRequest( - BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/core/events/id_123", null, null); + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/events/id_123", + params.toMap(), + null); } @Test @@ -29543,7 +29557,7 @@ public void testV2MoneyManagementReceivedCreditGetServices() throws StripeExcept new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.ReceivedCredit>>() {}.getType(), - "{\"data\":[{\"amount\":{},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_credit\",\"status\":\"returned\",\"type\":\"balance_transfer\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_credit\",\"status\":\"returned\",\"type\":\"external_credit\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.ReceivedCreditListParams params = @@ -29569,7 +29583,7 @@ public void testV2MoneyManagementReceivedCreditGet2Services() throws StripeExcep null, null, com.stripe.model.v2.moneymanagement.ReceivedCredit.class, - "{\"amount\":{},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_credit\",\"status\":\"returned\",\"type\":\"balance_transfer\",\"livemode\":true}"); + "{\"amount\":{},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_credit\",\"status\":\"returned\",\"type\":\"external_credit\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.ReceivedCredit receivedCredit = @@ -29594,7 +29608,7 @@ public void testV2MoneyManagementReceivedDebitGetServices() throws StripeExcepti new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.ReceivedDebit>>() {}.getType(), - "{\"data\":[{\"amount\":{},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_debit\",\"status\":\"canceled\",\"type\":\"bank_transfer\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_debit\",\"status\":\"canceled\",\"type\":\"external_debit\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.ReceivedDebitListParams params = @@ -29620,7 +29634,7 @@ public void testV2MoneyManagementReceivedDebitGet2Services() throws StripeExcept null, null, com.stripe.model.v2.moneymanagement.ReceivedDebit.class, - "{\"amount\":{},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_debit\",\"status\":\"canceled\",\"type\":\"bank_transfer\",\"livemode\":true}"); + "{\"amount\":{},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_debit\",\"status\":\"canceled\",\"type\":\"external_debit\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.ReceivedDebit receivedDebit =