From 5b1856dfdc3353452eb8ba12ace07a9e3f40168c Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 20:36:12 +0000 Subject: [PATCH 1/2] Update generated code for v2151 and --- CODEGEN_VERSION | 2 +- OPENAPI_VERSION | 2 +- .../events/V2CoreAccountClosedEvent.java | 22 +++++++ .../V2CoreAccountClosedEventNotification.java | 27 +++++++++ .../events/V2CoreAccountCreatedEvent.java | 22 +++++++ ...V2CoreAccountCreatedEventNotification.java | 27 +++++++++ ...nCustomerCapabilityStatusUpdatedEvent.java | 40 +++++++++++++ ...abilityStatusUpdatedEventNotification.java | 31 ++++++++++ ...dingConfigurationCustomerUpdatedEvent.java | 22 +++++++ ...ationCustomerUpdatedEventNotification.java | 29 ++++++++++ ...nMerchantCapabilityStatusUpdatedEvent.java | 54 ++++++++++++++++++ ...abilityStatusUpdatedEventNotification.java | 31 ++++++++++ ...dingConfigurationMerchantUpdatedEvent.java | 22 +++++++ ...ationMerchantUpdatedEventNotification.java | 29 ++++++++++ ...RecipientCapabilityStatusUpdatedEvent.java | 42 ++++++++++++++ ...abilityStatusUpdatedEventNotification.java | 31 ++++++++++ ...ingConfigurationRecipientUpdatedEvent.java | 22 +++++++ ...tionRecipientUpdatedEventNotification.java | 29 ++++++++++ ...eAccountIncludingDefaultsUpdatedEvent.java | 22 +++++++ ...udingDefaultsUpdatedEventNotification.java | 28 +++++++++ ...cludingFutureRequirementsUpdatedEvent.java | 22 +++++++ ...eRequirementsUpdatedEventNotification.java | 28 +++++++++ ...eAccountIncludingIdentityUpdatedEvent.java | 22 +++++++ ...udingIdentityUpdatedEventNotification.java | 28 +++++++++ ...ountIncludingRequirementsUpdatedEvent.java | 22 +++++++ ...gRequirementsUpdatedEventNotification.java | 28 +++++++++ .../V2CoreAccountLinkReturnedEvent.java | 33 +++++++++++ ...eAccountLinkReturnedEventNotification.java | 13 +++++ .../V2CoreAccountPersonCreatedEvent.java | 35 ++++++++++++ ...AccountPersonCreatedEventNotification.java | 27 +++++++++ .../V2CoreAccountPersonDeletedEvent.java | 35 ++++++++++++ ...AccountPersonDeletedEventNotification.java | 27 +++++++++ .../V2CoreAccountPersonUpdatedEvent.java | 35 ++++++++++++ ...AccountPersonUpdatedEventNotification.java | 27 +++++++++ .../events/V2CoreAccountUpdatedEvent.java | 22 +++++++ ...V2CoreAccountUpdatedEventNotification.java | 27 +++++++++ .../com/stripe/exception/StripeException.java | 3 + .../stripe/model/v2/EventDataClassLookup.java | 47 +++++++++++++++ .../v2/EventNotificationClassLookup.java | 57 +++++++++++++++++++ .../service/v2/core/AccountLinkService.java | 6 +- .../service/v2/core/AccountService.java | 50 +++++++++------- .../service/v2/core/AccountTokenService.java | 15 +++-- .../v2/core/accounts/PersonService.java | 40 +++++++------ .../v2/core/accounts/PersonTokenService.java | 14 +++-- .../stripe/functional/GeneratedExamples.java | 25 ++++++++ 45 files changed, 1170 insertions(+), 52 deletions(-) create mode 100644 src/main/java/com/stripe/events/V2CoreAccountClosedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountClosedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountCreatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountCreatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerUpdatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantUpdatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientUpdatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingDefaultsUpdatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingDefaultsUpdatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingFutureRequirementsUpdatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingIdentityUpdatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingIdentityUpdatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingRequirementsUpdatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountIncludingRequirementsUpdatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountLinkReturnedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountLinkReturnedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountPersonCreatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountPersonCreatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountPersonDeletedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountPersonDeletedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountPersonUpdatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountPersonUpdatedEventNotification.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountUpdatedEvent.java create mode 100644 src/main/java/com/stripe/events/V2CoreAccountUpdatedEventNotification.java diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 93be1cef53b..c63a3302e6b 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -88aa59022b32620f4d66d6196e3b42d5a0f86bbb \ No newline at end of file +61e410d24d6de541c86c48b265b7647c164457ee \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 16739433ec7..5e8e56a7f85 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2140 \ No newline at end of file +v2151 \ No newline at end of file diff --git a/src/main/java/com/stripe/events/V2CoreAccountClosedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountClosedEvent.java new file mode 100644 index 00000000000..05a2445690b --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountClosedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreAccountClosedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountClosedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountClosedEventNotification.java new file mode 100644 index 00000000000..d677d1b4539 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountClosedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreAccountClosedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountClosedEvent fetchEvent() throws StripeException { + return (V2CoreAccountClosedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountCreatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountCreatedEvent.java new file mode 100644 index 00000000000..cbfdfc4f5d3 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountCreatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreAccountCreatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountCreatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountCreatedEventNotification.java new file mode 100644 index 00000000000..e0529a8b8cc --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountCreatedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreAccountCreatedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountCreatedEvent fetchEvent() throws StripeException { + return (V2CoreAccountCreatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.java new file mode 100644 index 00000000000..e266dd315f6 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.java @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent + extends Event { + /** Data for the v2.core.account[configuration.customer].capability_status_updated event. */ + @SerializedName("data") + V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** + * Open Enum. The capability which had its status updated. + * + *

Equal to {@code automatic_indirect_tax}. + */ + @SerializedName("updated_capability") + String updatedCapability; + } + + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification.java new file mode 100644 index 00000000000..c203c68e6fe --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification.java @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final +class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification + extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent fetchEvent() + throws StripeException { + return (V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent) + super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerUpdatedEvent.java new file mode 100644 index 00000000000..eaf8240c359 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerUpdatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreAccountIncludingConfigurationCustomerUpdatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification.java new file mode 100644 index 00000000000..4cf4b375336 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification.java @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification + extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountIncludingConfigurationCustomerUpdatedEvent fetchEvent() + throws StripeException { + return (V2CoreAccountIncludingConfigurationCustomerUpdatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.java new file mode 100644 index 00000000000..b9d23142347 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.java @@ -0,0 +1,54 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent + extends Event { + /** Data for the v2.core.account[configuration.merchant].capability_status_updated event. */ + @SerializedName("data") + V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** + * Open Enum. The capability which had its status updated. + * + *

One of {@code ach_debit_payments}, {@code acss_debit_payments}, {@code affirm_payments}, + * {@code afterpay_clearpay_payments}, {@code alma_payments}, {@code amazon_pay_payments}, + * {@code au_becs_debit_payments}, {@code bacs_debit_payments}, {@code bancontact_payments}, + * {@code blik_payments}, {@code boleto_payments}, {@code card_payments}, {@code + * cartes_bancaires_payments}, {@code cashapp_payments}, {@code eps_payments}, {@code + * fpx_payments}, {@code gb_bank_transfer_payments}, {@code grabpay_payments}, {@code + * ideal_payments}, {@code jcb_payments}, {@code jp_bank_transfer_payments}, {@code + * kakao_pay_payments}, {@code klarna_payments}, {@code konbini_payments}, {@code + * kr_card_payments}, {@code link_payments}, {@code mobilepay_payments}, {@code + * multibanco_payments}, {@code mx_bank_transfer_payments}, {@code naver_pay_payments}, {@code + * oxxo_payments}, {@code p24_payments}, {@code payco_payments}, {@code paynow_payments}, {@code + * stripe_balance.payouts}, {@code pay_by_bank_payments}, {@code promptpay_payments}, {@code + * revolut_pay_payments}, {@code samsung_pay_payments}, {@code sepa_bank_transfer_payments}, + * {@code sepa_debit_payments}, {@code swish_payments}, {@code twint_payments}, {@code + * us_bank_transfer_payments}, or {@code zip_payments}. + */ + @SerializedName("updated_capability") + String updatedCapability; + } + + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification.java new file mode 100644 index 00000000000..a651119b0b6 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification.java @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final +class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification + extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent fetchEvent() + throws StripeException { + return (V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent) + super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantUpdatedEvent.java new file mode 100644 index 00000000000..5d525b9faf3 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantUpdatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreAccountIncludingConfigurationMerchantUpdatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification.java new file mode 100644 index 00000000000..c531238467b --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification.java @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification + extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountIncludingConfigurationMerchantUpdatedEvent fetchEvent() + throws StripeException { + return (V2CoreAccountIncludingConfigurationMerchantUpdatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.java new file mode 100644 index 00000000000..fda9a61e76d --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.java @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent + extends Event { + /** Data for the v2.core.account[configuration.recipient].capability_status_updated event. */ + @SerializedName("data") + V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** + * Open Enum. The capability which had its status updated. + * + *

One of {@code bank_accounts.local}, {@code bank_accounts.wire}, {@code cards}, {@code + * stripe_balance.payouts}, {@code stripe_balance.stripe_transfers}, or {@code + * stripe.transfers}. + */ + @SerializedName("updated_capability") + String updatedCapability; + } + + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification.java new file mode 100644 index 00000000000..11072827081 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification.java @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final +class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification + extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent fetchEvent() + throws StripeException { + return (V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent) + super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientUpdatedEvent.java new file mode 100644 index 00000000000..9215345d6f4 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientUpdatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreAccountIncludingConfigurationRecipientUpdatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification.java new file mode 100644 index 00000000000..bdc8b261a09 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification.java @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification + extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountIncludingConfigurationRecipientUpdatedEvent fetchEvent() + throws StripeException { + return (V2CoreAccountIncludingConfigurationRecipientUpdatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingDefaultsUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingDefaultsUpdatedEvent.java new file mode 100644 index 00000000000..468bd1b4a8a --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingDefaultsUpdatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreAccountIncludingDefaultsUpdatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingDefaultsUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingDefaultsUpdatedEventNotification.java new file mode 100644 index 00000000000..d7e23077bfd --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingDefaultsUpdatedEventNotification.java @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreAccountIncludingDefaultsUpdatedEventNotification + extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountIncludingDefaultsUpdatedEvent fetchEvent() throws StripeException { + return (V2CoreAccountIncludingDefaultsUpdatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingFutureRequirementsUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingFutureRequirementsUpdatedEvent.java new file mode 100644 index 00000000000..496147e2216 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingFutureRequirementsUpdatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreAccountIncludingFutureRequirementsUpdatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification.java new file mode 100644 index 00000000000..31c75530fa6 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification.java @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification + extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountIncludingFutureRequirementsUpdatedEvent fetchEvent() throws StripeException { + return (V2CoreAccountIncludingFutureRequirementsUpdatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingIdentityUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingIdentityUpdatedEvent.java new file mode 100644 index 00000000000..0e39b973f3e --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingIdentityUpdatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreAccountIncludingIdentityUpdatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingIdentityUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingIdentityUpdatedEventNotification.java new file mode 100644 index 00000000000..fbadf63c66c --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingIdentityUpdatedEventNotification.java @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreAccountIncludingIdentityUpdatedEventNotification + extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountIncludingIdentityUpdatedEvent fetchEvent() throws StripeException { + return (V2CoreAccountIncludingIdentityUpdatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingRequirementsUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingRequirementsUpdatedEvent.java new file mode 100644 index 00000000000..8772e2c6727 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingRequirementsUpdatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreAccountIncludingRequirementsUpdatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountIncludingRequirementsUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountIncludingRequirementsUpdatedEventNotification.java new file mode 100644 index 00000000000..5c0246387b5 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountIncludingRequirementsUpdatedEventNotification.java @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreAccountIncludingRequirementsUpdatedEventNotification + extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountIncludingRequirementsUpdatedEvent fetchEvent() throws StripeException { + return (V2CoreAccountIncludingRequirementsUpdatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountLinkReturnedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountLinkReturnedEvent.java new file mode 100644 index 00000000000..8853cb981fd --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountLinkReturnedEvent.java @@ -0,0 +1,33 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.v2.core.Event; +import java.util.List; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class V2CoreAccountLinkReturnedEvent extends Event { + /** Data for the v2.core.account_link.returned event. */ + @SerializedName("data") + V2CoreAccountLinkReturnedEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** The ID of the v2 account. */ + @SerializedName("account_id") + String accountId; + /** Configurations on the Account that was onboarded via the account link. */ + @SerializedName("configurations") + List configurations; + /** + * Open Enum. The use case type of the account link that has been completed. + * + *

One of {@code account_onboarding}, or {@code account_update}. + */ + @SerializedName("use_case") + String useCase; + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountLinkReturnedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountLinkReturnedEventNotification.java new file mode 100644 index 00000000000..447b6909d19 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountLinkReturnedEventNotification.java @@ -0,0 +1,13 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.EventNotification; + +public final class V2CoreAccountLinkReturnedEventNotification extends EventNotification { + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountLinkReturnedEvent fetchEvent() throws StripeException { + return (V2CoreAccountLinkReturnedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountPersonCreatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountPersonCreatedEvent.java new file mode 100644 index 00000000000..31eb01d754c --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountPersonCreatedEvent.java @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.AccountPerson; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class V2CoreAccountPersonCreatedEvent extends Event { + /** Data for the v2.core.account_person.created event. */ + @SerializedName("data") + V2CoreAccountPersonCreatedEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** The ID of the v2 account. */ + @SerializedName("account_id") + String accountId; + } + + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public AccountPerson fetchRelatedObject() throws StripeException { + return (AccountPerson) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountPersonCreatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountPersonCreatedEventNotification.java new file mode 100644 index 00000000000..52159283b25 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountPersonCreatedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.AccountPerson; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreAccountPersonCreatedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public AccountPerson fetchRelatedObject() throws StripeException { + return (AccountPerson) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountPersonCreatedEvent fetchEvent() throws StripeException { + return (V2CoreAccountPersonCreatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountPersonDeletedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountPersonDeletedEvent.java new file mode 100644 index 00000000000..54168d8031d --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountPersonDeletedEvent.java @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.AccountPerson; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class V2CoreAccountPersonDeletedEvent extends Event { + /** Data for the v2.core.account_person.deleted event. */ + @SerializedName("data") + V2CoreAccountPersonDeletedEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** The ID of the v2 account. */ + @SerializedName("account_id") + String accountId; + } + + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public AccountPerson fetchRelatedObject() throws StripeException { + return (AccountPerson) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountPersonDeletedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountPersonDeletedEventNotification.java new file mode 100644 index 00000000000..ccdfef19c4c --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountPersonDeletedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.AccountPerson; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreAccountPersonDeletedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public AccountPerson fetchRelatedObject() throws StripeException { + return (AccountPerson) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountPersonDeletedEvent fetchEvent() throws StripeException { + return (V2CoreAccountPersonDeletedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountPersonUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountPersonUpdatedEvent.java new file mode 100644 index 00000000000..d9f19f199c2 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountPersonUpdatedEvent.java @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.AccountPerson; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class V2CoreAccountPersonUpdatedEvent extends Event { + /** Data for the v2.core.account_person.updated event. */ + @SerializedName("data") + V2CoreAccountPersonUpdatedEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** The ID of the v2 account. */ + @SerializedName("account_id") + String accountId; + } + + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public AccountPerson fetchRelatedObject() throws StripeException { + return (AccountPerson) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountPersonUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountPersonUpdatedEventNotification.java new file mode 100644 index 00000000000..7d9c09bccd0 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountPersonUpdatedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.AccountPerson; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreAccountPersonUpdatedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public AccountPerson fetchRelatedObject() throws StripeException { + return (AccountPerson) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountPersonUpdatedEvent fetchEvent() throws StripeException { + return (V2CoreAccountPersonUpdatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreAccountUpdatedEvent.java new file mode 100644 index 00000000000..767204a5eef --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountUpdatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreAccountUpdatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountUpdatedEventNotification.java new file mode 100644 index 00000000000..6ecdb7e9f6d --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountUpdatedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.Account; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreAccountUpdatedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public Account fetchRelatedObject() throws StripeException { + return (Account) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountUpdatedEvent fetchEvent() throws StripeException { + return (V2CoreAccountUpdatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/exception/StripeException.java b/src/main/java/com/stripe/exception/StripeException.java index ba7bf85ff83..65a8ea43e97 100644 --- a/src/main/java/com/stripe/exception/StripeException.java +++ b/src/main/java/com/stripe/exception/StripeException.java @@ -110,6 +110,9 @@ public static StripeException parseV2Exception( StripeResponseGetter responseGetter) { switch (type) { // The beginning of the section generated from our OpenAPI spec + case "rate_limit": + return com.stripe.exception.RateLimitException.parse( + body, statusCode, requestId, responseGetter); case "temporary_session_expired": return com.stripe.exception.TemporarySessionExpiredException.parse( body, statusCode, requestId, responseGetter); diff --git a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java index 87f63158a96..4acab7f5e44 100644 --- a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java @@ -40,6 +40,53 @@ public final class EventDataClassLookup { com.stripe.events.V1BillingMeterErrorReportTriggeredEvent.class); eventClassLookup.put( "v1.billing.meter.no_meter_found", com.stripe.events.V1BillingMeterNoMeterFoundEvent.class); + eventClassLookup.put( + "v2.core.account.closed", com.stripe.events.V2CoreAccountClosedEvent.class); + eventClassLookup.put( + "v2.core.account.created", com.stripe.events.V2CoreAccountCreatedEvent.class); + eventClassLookup.put( + "v2.core.account.updated", com.stripe.events.V2CoreAccountUpdatedEvent.class); + eventClassLookup.put( + "v2.core.account[configuration.customer].capability_status_updated", + com.stripe.events.V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent + .class); + eventClassLookup.put( + "v2.core.account[configuration.customer].updated", + com.stripe.events.V2CoreAccountIncludingConfigurationCustomerUpdatedEvent.class); + eventClassLookup.put( + "v2.core.account[configuration.merchant].capability_status_updated", + com.stripe.events.V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent + .class); + eventClassLookup.put( + "v2.core.account[configuration.merchant].updated", + com.stripe.events.V2CoreAccountIncludingConfigurationMerchantUpdatedEvent.class); + eventClassLookup.put( + "v2.core.account[configuration.recipient].capability_status_updated", + com.stripe.events.V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent + .class); + eventClassLookup.put( + "v2.core.account[configuration.recipient].updated", + com.stripe.events.V2CoreAccountIncludingConfigurationRecipientUpdatedEvent.class); + eventClassLookup.put( + "v2.core.account[defaults].updated", + com.stripe.events.V2CoreAccountIncludingDefaultsUpdatedEvent.class); + eventClassLookup.put( + "v2.core.account[future_requirements].updated", + com.stripe.events.V2CoreAccountIncludingFutureRequirementsUpdatedEvent.class); + eventClassLookup.put( + "v2.core.account[identity].updated", + com.stripe.events.V2CoreAccountIncludingIdentityUpdatedEvent.class); + eventClassLookup.put( + "v2.core.account[requirements].updated", + com.stripe.events.V2CoreAccountIncludingRequirementsUpdatedEvent.class); + eventClassLookup.put( + "v2.core.account_link.returned", com.stripe.events.V2CoreAccountLinkReturnedEvent.class); + eventClassLookup.put( + "v2.core.account_person.created", com.stripe.events.V2CoreAccountPersonCreatedEvent.class); + eventClassLookup.put( + "v2.core.account_person.deleted", com.stripe.events.V2CoreAccountPersonDeletedEvent.class); + eventClassLookup.put( + "v2.core.account_person.updated", com.stripe.events.V2CoreAccountPersonUpdatedEvent.class); eventClassLookup.put( "v2.core.event_destination.ping", com.stripe.events.V2CoreEventDestinationPingEvent.class); } diff --git a/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java b/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java index ba7d9ac1b89..50c66ed6ae1 100644 --- a/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java +++ b/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java @@ -22,6 +22,63 @@ public final class EventNotificationClassLookup { eventClassLookup.put( "v1.billing.meter.no_meter_found", com.stripe.events.V1BillingMeterNoMeterFoundEventNotification.class); + eventClassLookup.put( + "v2.core.account.closed", com.stripe.events.V2CoreAccountClosedEventNotification.class); + eventClassLookup.put( + "v2.core.account.created", com.stripe.events.V2CoreAccountCreatedEventNotification.class); + eventClassLookup.put( + "v2.core.account.updated", com.stripe.events.V2CoreAccountUpdatedEventNotification.class); + eventClassLookup.put( + "v2.core.account[configuration.customer].capability_status_updated", + com.stripe.events + .V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification + .class); + eventClassLookup.put( + "v2.core.account[configuration.customer].updated", + com.stripe.events.V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification + .class); + eventClassLookup.put( + "v2.core.account[configuration.merchant].capability_status_updated", + com.stripe.events + .V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification + .class); + eventClassLookup.put( + "v2.core.account[configuration.merchant].updated", + com.stripe.events.V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification + .class); + eventClassLookup.put( + "v2.core.account[configuration.recipient].capability_status_updated", + com.stripe.events + .V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification + .class); + eventClassLookup.put( + "v2.core.account[configuration.recipient].updated", + com.stripe.events.V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification + .class); + eventClassLookup.put( + "v2.core.account[defaults].updated", + com.stripe.events.V2CoreAccountIncludingDefaultsUpdatedEventNotification.class); + eventClassLookup.put( + "v2.core.account[future_requirements].updated", + com.stripe.events.V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification.class); + eventClassLookup.put( + "v2.core.account[identity].updated", + com.stripe.events.V2CoreAccountIncludingIdentityUpdatedEventNotification.class); + eventClassLookup.put( + "v2.core.account[requirements].updated", + com.stripe.events.V2CoreAccountIncludingRequirementsUpdatedEventNotification.class); + eventClassLookup.put( + "v2.core.account_link.returned", + com.stripe.events.V2CoreAccountLinkReturnedEventNotification.class); + eventClassLookup.put( + "v2.core.account_person.created", + com.stripe.events.V2CoreAccountPersonCreatedEventNotification.class); + eventClassLookup.put( + "v2.core.account_person.deleted", + com.stripe.events.V2CoreAccountPersonDeletedEventNotification.class); + eventClassLookup.put( + "v2.core.account_person.updated", + com.stripe.events.V2CoreAccountPersonUpdatedEventNotification.class); eventClassLookup.put( "v2.core.event_destination.ping", com.stripe.events.V2CoreEventDestinationPingEventNotification.class); diff --git a/src/main/java/com/stripe/service/v2/core/AccountLinkService.java b/src/main/java/com/stripe/service/v2/core/AccountLinkService.java index a47c0c59b5d..7aa70806477 100644 --- a/src/main/java/com/stripe/service/v2/core/AccountLinkService.java +++ b/src/main/java/com/stripe/service/v2/core/AccountLinkService.java @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec package com.stripe.service.v2.core; +import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.core.AccountLink; import com.stripe.net.ApiRequest; @@ -21,7 +22,8 @@ public AccountLinkService(StripeResponseGetter responseGetter) { * Creates an AccountLink object that includes a single-use URL that an account can use to access * a Stripe-hosted flow for collecting or updating required information. */ - public AccountLink create(AccountLinkCreateParams params) throws StripeException { + public AccountLink create(AccountLinkCreateParams params) + throws StripeException, RateLimitException { return create(params, (RequestOptions) null); } /** @@ -29,7 +31,7 @@ public AccountLink create(AccountLinkCreateParams params) throws StripeException * a Stripe-hosted flow for collecting or updating required information. */ public AccountLink create(AccountLinkCreateParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = "/v2/core/account_links"; ApiRequest request = new ApiRequest( diff --git a/src/main/java/com/stripe/service/v2/core/AccountService.java b/src/main/java/com/stripe/service/v2/core/AccountService.java index 0ba14c9d182..2f5157cee7c 100644 --- a/src/main/java/com/stripe/service/v2/core/AccountService.java +++ b/src/main/java/com/stripe/service/v2/core/AccountService.java @@ -2,6 +2,7 @@ package com.stripe.service.v2.core; import com.google.gson.reflect.TypeToken; +import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.StripeCollection; import com.stripe.model.v2.core.Account; @@ -24,20 +25,22 @@ public AccountService(StripeResponseGetter responseGetter) { } /** Returns a list of Accounts. */ - public StripeCollection list(AccountListParams params) throws StripeException { + public StripeCollection list(AccountListParams params) + throws StripeException, RateLimitException { return list(params, (RequestOptions) null); } /** Returns a list of Accounts. */ - public StripeCollection list(RequestOptions options) throws StripeException { + public StripeCollection list(RequestOptions options) + throws StripeException, RateLimitException { return list((AccountListParams) null, options); } /** Returns a list of Accounts. */ - public StripeCollection list() throws StripeException { + public StripeCollection list() throws StripeException, RateLimitException { return list((AccountListParams) null, (RequestOptions) null); } /** Returns a list of Accounts. */ public StripeCollection list(AccountListParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = "/v2/core/accounts"; ApiRequest request = new ApiRequest( @@ -54,7 +57,7 @@ public StripeCollection list(AccountListParams params, RequestOptions o * the features an account has access to. An account can be configured as any or all of the * following configurations: Customer, Merchant and/or Recipient. */ - public Account create(AccountCreateParams params) throws StripeException { + public Account create(AccountCreateParams params) throws StripeException, RateLimitException { return create(params, (RequestOptions) null); } /** @@ -63,7 +66,7 @@ public Account create(AccountCreateParams params) throws StripeException { * the features an account has access to. An account can be configured as any or all of the * following configurations: Customer, Merchant and/or Recipient. */ - public Account create(RequestOptions options) throws StripeException { + public Account create(RequestOptions options) throws StripeException, RateLimitException { return create((AccountCreateParams) null, options); } /** @@ -72,7 +75,7 @@ public Account create(RequestOptions options) throws StripeException { * the features an account has access to. An account can be configured as any or all of the * following configurations: Customer, Merchant and/or Recipient. */ - public Account create() throws StripeException { + public Account create() throws StripeException, RateLimitException { return create((AccountCreateParams) null, (RequestOptions) null); } /** @@ -81,7 +84,8 @@ public Account create() throws StripeException { * the features an account has access to. An account can be configured as any or all of the * following configurations: Customer, Merchant and/or Recipient. */ - public Account create(AccountCreateParams params, RequestOptions options) throws StripeException { + public Account create(AccountCreateParams params, RequestOptions options) + throws StripeException, RateLimitException { String path = "/v2/core/accounts"; ApiRequest request = new ApiRequest( @@ -93,20 +97,22 @@ public Account create(AccountCreateParams params, RequestOptions options) throws return this.request(request, Account.class); } /** Retrieves the details of an Account. */ - public Account retrieve(String id, AccountRetrieveParams params) throws StripeException { + public Account retrieve(String id, AccountRetrieveParams params) + throws StripeException, RateLimitException { return retrieve(id, params, (RequestOptions) null); } /** Retrieves the details of an Account. */ - public Account retrieve(String id, RequestOptions options) throws StripeException { + public Account retrieve(String id, RequestOptions options) + throws StripeException, RateLimitException { return retrieve(id, (AccountRetrieveParams) null, options); } /** Retrieves the details of an Account. */ - public Account retrieve(String id) throws StripeException { + public Account retrieve(String id) throws StripeException, RateLimitException { return retrieve(id, (AccountRetrieveParams) null, (RequestOptions) null); } /** Retrieves the details of an Account. */ public Account retrieve(String id, AccountRetrieveParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format("/v2/core/accounts/%s", ApiResource.urlEncodeId(id)); ApiRequest request = new ApiRequest( @@ -118,20 +124,22 @@ public Account retrieve(String id, AccountRetrieveParams params, RequestOptions return this.request(request, Account.class); } /** Updates the details of an Account. */ - public Account update(String id, AccountUpdateParams params) throws StripeException { + public Account update(String id, AccountUpdateParams params) + throws StripeException, RateLimitException { return update(id, params, (RequestOptions) null); } /** Updates the details of an Account. */ - public Account update(String id, RequestOptions options) throws StripeException { + public Account update(String id, RequestOptions options) + throws StripeException, RateLimitException { return update(id, (AccountUpdateParams) null, options); } /** Updates the details of an Account. */ - public Account update(String id) throws StripeException { + public Account update(String id) throws StripeException, RateLimitException { return update(id, (AccountUpdateParams) null, (RequestOptions) null); } /** Updates the details of an Account. */ public Account update(String id, AccountUpdateParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format("/v2/core/accounts/%s", ApiResource.urlEncodeId(id)); ApiRequest request = new ApiRequest( @@ -147,7 +155,8 @@ public Account update(String id, AccountUpdateParams params, RequestOptions opti * operated on, but limited information can still be retrieved through the API in order to be able * to track their history. */ - public Account close(String id, AccountCloseParams params) throws StripeException { + public Account close(String id, AccountCloseParams params) + throws StripeException, RateLimitException { return close(id, params, (RequestOptions) null); } /** @@ -155,7 +164,8 @@ public Account close(String id, AccountCloseParams params) throws StripeExceptio * operated on, but limited information can still be retrieved through the API in order to be able * to track their history. */ - public Account close(String id, RequestOptions options) throws StripeException { + public Account close(String id, RequestOptions options) + throws StripeException, RateLimitException { return close(id, (AccountCloseParams) null, options); } /** @@ -163,7 +173,7 @@ public Account close(String id, RequestOptions options) throws StripeException { * operated on, but limited information can still be retrieved through the API in order to be able * to track their history. */ - public Account close(String id) throws StripeException { + public Account close(String id) throws StripeException, RateLimitException { return close(id, (AccountCloseParams) null, (RequestOptions) null); } /** @@ -172,7 +182,7 @@ public Account close(String id) throws StripeException { * to track their history. */ public Account close(String id, AccountCloseParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format("/v2/core/accounts/%s/close", ApiResource.urlEncodeId(id)); ApiRequest request = new ApiRequest( diff --git a/src/main/java/com/stripe/service/v2/core/AccountTokenService.java b/src/main/java/com/stripe/service/v2/core/AccountTokenService.java index cc7c754b89a..3eb34d7d350 100644 --- a/src/main/java/com/stripe/service/v2/core/AccountTokenService.java +++ b/src/main/java/com/stripe/service/v2/core/AccountTokenService.java @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec package com.stripe.service.v2.core; +import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.core.AccountToken; import com.stripe.net.ApiRequest; @@ -18,20 +19,21 @@ public AccountTokenService(StripeResponseGetter responseGetter) { } /** Creates an Account Token. */ - public AccountToken create(AccountTokenCreateParams params) throws StripeException { + public AccountToken create(AccountTokenCreateParams params) + throws StripeException, RateLimitException { return create(params, (RequestOptions) null); } /** Creates an Account Token. */ - public AccountToken create(RequestOptions options) throws StripeException { + public AccountToken create(RequestOptions options) throws StripeException, RateLimitException { return create((AccountTokenCreateParams) null, options); } /** Creates an Account Token. */ - public AccountToken create() throws StripeException { + public AccountToken create() throws StripeException, RateLimitException { return create((AccountTokenCreateParams) null, (RequestOptions) null); } /** Creates an Account Token. */ public AccountToken create(AccountTokenCreateParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = "/v2/core/account_tokens"; ApiRequest request = new ApiRequest( @@ -43,11 +45,12 @@ public AccountToken create(AccountTokenCreateParams params, RequestOptions optio return this.request(request, AccountToken.class); } /** Retrieves an Account Token. */ - public AccountToken retrieve(String id) throws StripeException { + public AccountToken retrieve(String id) throws StripeException, RateLimitException { return retrieve(id, (RequestOptions) null); } /** Retrieves an Account Token. */ - public AccountToken retrieve(String id, RequestOptions options) throws StripeException { + public AccountToken retrieve(String id, RequestOptions options) + throws StripeException, RateLimitException { String path = String.format("/v2/core/account_tokens/%s", ApiResource.urlEncodeId(id)); ApiRequest request = new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); diff --git a/src/main/java/com/stripe/service/v2/core/accounts/PersonService.java b/src/main/java/com/stripe/service/v2/core/accounts/PersonService.java index 1ba7615b0cc..4a1b2b957e4 100644 --- a/src/main/java/com/stripe/service/v2/core/accounts/PersonService.java +++ b/src/main/java/com/stripe/service/v2/core/accounts/PersonService.java @@ -2,6 +2,7 @@ package com.stripe.service.v2.core.accounts; import com.google.gson.reflect.TypeToken; +import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.DeletedObject; import com.stripe.model.v2.StripeCollection; @@ -24,21 +25,23 @@ public PersonService(StripeResponseGetter responseGetter) { /** Returns a paginated list of Persons associated with an Account. */ public StripeCollection list(String accountId, PersonListParams params) - throws StripeException { + throws StripeException, RateLimitException { return list(accountId, params, (RequestOptions) null); } /** Returns a paginated list of Persons associated with an Account. */ public StripeCollection list(String accountId, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { return list(accountId, (PersonListParams) null, options); } /** Returns a paginated list of Persons associated with an Account. */ - public StripeCollection list(String accountId) throws StripeException { + public StripeCollection list(String accountId) + throws StripeException, RateLimitException { return list(accountId, (PersonListParams) null, (RequestOptions) null); } /** Returns a paginated list of Persons associated with an Account. */ public StripeCollection list( - String accountId, PersonListParams params, RequestOptions options) throws StripeException { + String accountId, PersonListParams params, RequestOptions options) + throws StripeException, RateLimitException { String path = String.format("/v2/core/accounts/%s/persons", ApiResource.urlEncodeId(accountId)); ApiRequest request = new ApiRequest( @@ -53,21 +56,23 @@ public StripeCollection list( * Create a Person. Adds an individual to an Account's identity. You can set relationship * attributes and identity information at creation. */ - public AccountPerson create(String accountId, PersonCreateParams params) throws StripeException { + public AccountPerson create(String accountId, PersonCreateParams params) + throws StripeException, RateLimitException { return create(accountId, params, (RequestOptions) null); } /** * Create a Person. Adds an individual to an Account's identity. You can set relationship * attributes and identity information at creation. */ - public AccountPerson create(String accountId, RequestOptions options) throws StripeException { + public AccountPerson create(String accountId, RequestOptions options) + throws StripeException, RateLimitException { return create(accountId, (PersonCreateParams) null, options); } /** * Create a Person. Adds an individual to an Account's identity. You can set relationship * attributes and identity information at creation. */ - public AccountPerson create(String accountId) throws StripeException { + public AccountPerson create(String accountId) throws StripeException, RateLimitException { return create(accountId, (PersonCreateParams) null, (RequestOptions) null); } /** @@ -75,7 +80,7 @@ public AccountPerson create(String accountId) throws StripeException { * attributes and identity information at creation. */ public AccountPerson create(String accountId, PersonCreateParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format("/v2/core/accounts/%s/persons", ApiResource.urlEncodeId(accountId)); ApiRequest request = new ApiRequest( @@ -87,12 +92,13 @@ public AccountPerson create(String accountId, PersonCreateParams params, Request return this.request(request, AccountPerson.class); } /** Delete a Person associated with an Account. */ - public DeletedObject delete(String accountId, String id) throws StripeException { + public DeletedObject delete(String accountId, String id) + throws StripeException, RateLimitException { return delete(accountId, id, (RequestOptions) null); } /** Delete a Person associated with an Account. */ public DeletedObject delete(String accountId, String id, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format( "/v2/core/accounts/%s/persons/%s", @@ -102,12 +108,13 @@ public DeletedObject delete(String accountId, String id, RequestOptions options) return this.request(request, DeletedObject.class); } /** Retrieves a Person associated with an Account. */ - public AccountPerson retrieve(String accountId, String id) throws StripeException { + public AccountPerson retrieve(String accountId, String id) + throws StripeException, RateLimitException { return retrieve(accountId, id, (RequestOptions) null); } /** Retrieves a Person associated with an Account. */ public AccountPerson retrieve(String accountId, String id, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format( "/v2/core/accounts/%s/persons/%s", @@ -118,22 +125,23 @@ public AccountPerson retrieve(String accountId, String id, RequestOptions option } /** Updates a Person associated with an Account. */ public AccountPerson update(String accountId, String id, PersonUpdateParams params) - throws StripeException { + throws StripeException, RateLimitException { return update(accountId, id, params, (RequestOptions) null); } /** Updates a Person associated with an Account. */ public AccountPerson update(String accountId, String id, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { return update(accountId, id, (PersonUpdateParams) null, options); } /** Updates a Person associated with an Account. */ - public AccountPerson update(String accountId, String id) throws StripeException { + public AccountPerson update(String accountId, String id) + throws StripeException, RateLimitException { return update(accountId, id, (PersonUpdateParams) null, (RequestOptions) null); } /** Updates a Person associated with an Account. */ public AccountPerson update( String accountId, String id, PersonUpdateParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format( "/v2/core/accounts/%s/persons/%s", diff --git a/src/main/java/com/stripe/service/v2/core/accounts/PersonTokenService.java b/src/main/java/com/stripe/service/v2/core/accounts/PersonTokenService.java index 4325a3193ec..b6180a4b7d7 100644 --- a/src/main/java/com/stripe/service/v2/core/accounts/PersonTokenService.java +++ b/src/main/java/com/stripe/service/v2/core/accounts/PersonTokenService.java @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec package com.stripe.service.v2.core.accounts; +import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.core.AccountPersonToken; import com.stripe.net.ApiRequest; @@ -19,22 +20,22 @@ public PersonTokenService(StripeResponseGetter responseGetter) { /** Creates a Person Token associated with an Account. */ public AccountPersonToken create(String accountId, PersonTokenCreateParams params) - throws StripeException { + throws StripeException, RateLimitException { return create(accountId, params, (RequestOptions) null); } /** Creates a Person Token associated with an Account. */ public AccountPersonToken create(String accountId, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { return create(accountId, (PersonTokenCreateParams) null, options); } /** Creates a Person Token associated with an Account. */ - public AccountPersonToken create(String accountId) throws StripeException { + public AccountPersonToken create(String accountId) throws StripeException, RateLimitException { return create(accountId, (PersonTokenCreateParams) null, (RequestOptions) null); } /** Creates a Person Token associated with an Account. */ public AccountPersonToken create( String accountId, PersonTokenCreateParams params, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format("/v2/core/accounts/%s/person_tokens", ApiResource.urlEncodeId(accountId)); ApiRequest request = @@ -47,12 +48,13 @@ public AccountPersonToken create( return this.request(request, AccountPersonToken.class); } /** Retrieves a Person Token associated with an Account. */ - public AccountPersonToken retrieve(String accountId, String id) throws StripeException { + public AccountPersonToken retrieve(String accountId, String id) + throws StripeException, RateLimitException { return retrieve(accountId, id, (RequestOptions) null); } /** Retrieves a Person Token associated with an Account. */ public AccountPersonToken retrieve(String accountId, String id, RequestOptions options) - throws StripeException { + throws StripeException, RateLimitException { String path = String.format( "/v2/core/accounts/%s/person_tokens/%s", diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index 44f6f8fea82..3e7868791a6 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -25154,6 +25154,31 @@ public void testV2CoreEventDestinationPost5Services() throws StripeException { null); } + @Test + public void testRateLimitErrorServices() throws StripeException { + stubRequestReturnError( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/accounts", + null, + null, + "{\"error\":{\"type\":\"rate_limit\",\"code\":\"account_rate_limit_exceeded\"}}", + 400); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.AccountListParams params = + com.stripe.param.v2.core.AccountListParams.builder().build(); + + try { + client.v2().core().accounts().list(params); + } catch (RateLimitException e) { + + } + ; + verifyRequest( + BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/core/accounts", params.toMap(), null); + } + @Test public void testTemporarySessionExpiredErrorServices() throws StripeException { stubRequestReturnError( From ffcbb3609453f49094f9dcc95658517e4e04429d Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 18:37:56 +0000 Subject: [PATCH 2/2] Update generated code for v2152 and --- CODEGEN_VERSION | 2 +- OPENAPI_VERSION | 2 +- .../com/stripe/exception/StripeException.java | 3 -- .../service/v2/core/AccountLinkService.java | 6 +-- .../service/v2/core/AccountService.java | 50 ++++++++----------- .../service/v2/core/AccountTokenService.java | 15 +++--- .../v2/core/accounts/PersonService.java | 40 ++++++--------- .../v2/core/accounts/PersonTokenService.java | 14 +++--- .../stripe/functional/GeneratedExamples.java | 25 ---------- 9 files changed, 52 insertions(+), 105 deletions(-) diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index c63a3302e6b..81e38dd3bef 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -61e410d24d6de541c86c48b265b7647c164457ee \ No newline at end of file +c250368ba89214c80bc8de3e4fc5d2094c5502cc \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 5e8e56a7f85..ccb965af858 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2151 \ No newline at end of file +v2152 \ No newline at end of file diff --git a/src/main/java/com/stripe/exception/StripeException.java b/src/main/java/com/stripe/exception/StripeException.java index 65a8ea43e97..ba7bf85ff83 100644 --- a/src/main/java/com/stripe/exception/StripeException.java +++ b/src/main/java/com/stripe/exception/StripeException.java @@ -110,9 +110,6 @@ public static StripeException parseV2Exception( StripeResponseGetter responseGetter) { switch (type) { // The beginning of the section generated from our OpenAPI spec - case "rate_limit": - return com.stripe.exception.RateLimitException.parse( - body, statusCode, requestId, responseGetter); case "temporary_session_expired": return com.stripe.exception.TemporarySessionExpiredException.parse( body, statusCode, requestId, responseGetter); diff --git a/src/main/java/com/stripe/service/v2/core/AccountLinkService.java b/src/main/java/com/stripe/service/v2/core/AccountLinkService.java index 7aa70806477..a47c0c59b5d 100644 --- a/src/main/java/com/stripe/service/v2/core/AccountLinkService.java +++ b/src/main/java/com/stripe/service/v2/core/AccountLinkService.java @@ -1,7 +1,6 @@ // File generated from our OpenAPI spec package com.stripe.service.v2.core; -import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.core.AccountLink; import com.stripe.net.ApiRequest; @@ -22,8 +21,7 @@ public AccountLinkService(StripeResponseGetter responseGetter) { * Creates an AccountLink object that includes a single-use URL that an account can use to access * a Stripe-hosted flow for collecting or updating required information. */ - public AccountLink create(AccountLinkCreateParams params) - throws StripeException, RateLimitException { + public AccountLink create(AccountLinkCreateParams params) throws StripeException { return create(params, (RequestOptions) null); } /** @@ -31,7 +29,7 @@ public AccountLink create(AccountLinkCreateParams params) * a Stripe-hosted flow for collecting or updating required information. */ public AccountLink create(AccountLinkCreateParams params, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { String path = "/v2/core/account_links"; ApiRequest request = new ApiRequest( diff --git a/src/main/java/com/stripe/service/v2/core/AccountService.java b/src/main/java/com/stripe/service/v2/core/AccountService.java index 2f5157cee7c..0ba14c9d182 100644 --- a/src/main/java/com/stripe/service/v2/core/AccountService.java +++ b/src/main/java/com/stripe/service/v2/core/AccountService.java @@ -2,7 +2,6 @@ package com.stripe.service.v2.core; import com.google.gson.reflect.TypeToken; -import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.StripeCollection; import com.stripe.model.v2.core.Account; @@ -25,22 +24,20 @@ public AccountService(StripeResponseGetter responseGetter) { } /** Returns a list of Accounts. */ - public StripeCollection list(AccountListParams params) - throws StripeException, RateLimitException { + public StripeCollection list(AccountListParams params) throws StripeException { return list(params, (RequestOptions) null); } /** Returns a list of Accounts. */ - public StripeCollection list(RequestOptions options) - throws StripeException, RateLimitException { + public StripeCollection list(RequestOptions options) throws StripeException { return list((AccountListParams) null, options); } /** Returns a list of Accounts. */ - public StripeCollection list() throws StripeException, RateLimitException { + public StripeCollection list() throws StripeException { return list((AccountListParams) null, (RequestOptions) null); } /** Returns a list of Accounts. */ public StripeCollection list(AccountListParams params, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { String path = "/v2/core/accounts"; ApiRequest request = new ApiRequest( @@ -57,7 +54,7 @@ public StripeCollection list(AccountListParams params, RequestOptions o * the features an account has access to. An account can be configured as any or all of the * following configurations: Customer, Merchant and/or Recipient. */ - public Account create(AccountCreateParams params) throws StripeException, RateLimitException { + public Account create(AccountCreateParams params) throws StripeException { return create(params, (RequestOptions) null); } /** @@ -66,7 +63,7 @@ public Account create(AccountCreateParams params) throws StripeException, RateLi * the features an account has access to. An account can be configured as any or all of the * following configurations: Customer, Merchant and/or Recipient. */ - public Account create(RequestOptions options) throws StripeException, RateLimitException { + public Account create(RequestOptions options) throws StripeException { return create((AccountCreateParams) null, options); } /** @@ -75,7 +72,7 @@ public Account create(RequestOptions options) throws StripeException, RateLimitE * the features an account has access to. An account can be configured as any or all of the * following configurations: Customer, Merchant and/or Recipient. */ - public Account create() throws StripeException, RateLimitException { + public Account create() throws StripeException { return create((AccountCreateParams) null, (RequestOptions) null); } /** @@ -84,8 +81,7 @@ public Account create() throws StripeException, RateLimitException { * the features an account has access to. An account can be configured as any or all of the * following configurations: Customer, Merchant and/or Recipient. */ - public Account create(AccountCreateParams params, RequestOptions options) - throws StripeException, RateLimitException { + public Account create(AccountCreateParams params, RequestOptions options) throws StripeException { String path = "/v2/core/accounts"; ApiRequest request = new ApiRequest( @@ -97,22 +93,20 @@ public Account create(AccountCreateParams params, RequestOptions options) return this.request(request, Account.class); } /** Retrieves the details of an Account. */ - public Account retrieve(String id, AccountRetrieveParams params) - throws StripeException, RateLimitException { + public Account retrieve(String id, AccountRetrieveParams params) throws StripeException { return retrieve(id, params, (RequestOptions) null); } /** Retrieves the details of an Account. */ - public Account retrieve(String id, RequestOptions options) - throws StripeException, RateLimitException { + public Account retrieve(String id, RequestOptions options) throws StripeException { return retrieve(id, (AccountRetrieveParams) null, options); } /** Retrieves the details of an Account. */ - public Account retrieve(String id) throws StripeException, RateLimitException { + public Account retrieve(String id) throws StripeException { return retrieve(id, (AccountRetrieveParams) null, (RequestOptions) null); } /** Retrieves the details of an Account. */ public Account retrieve(String id, AccountRetrieveParams params, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { String path = String.format("/v2/core/accounts/%s", ApiResource.urlEncodeId(id)); ApiRequest request = new ApiRequest( @@ -124,22 +118,20 @@ public Account retrieve(String id, AccountRetrieveParams params, RequestOptions return this.request(request, Account.class); } /** Updates the details of an Account. */ - public Account update(String id, AccountUpdateParams params) - throws StripeException, RateLimitException { + public Account update(String id, AccountUpdateParams params) throws StripeException { return update(id, params, (RequestOptions) null); } /** Updates the details of an Account. */ - public Account update(String id, RequestOptions options) - throws StripeException, RateLimitException { + public Account update(String id, RequestOptions options) throws StripeException { return update(id, (AccountUpdateParams) null, options); } /** Updates the details of an Account. */ - public Account update(String id) throws StripeException, RateLimitException { + public Account update(String id) throws StripeException { return update(id, (AccountUpdateParams) null, (RequestOptions) null); } /** Updates the details of an Account. */ public Account update(String id, AccountUpdateParams params, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { String path = String.format("/v2/core/accounts/%s", ApiResource.urlEncodeId(id)); ApiRequest request = new ApiRequest( @@ -155,8 +147,7 @@ public Account update(String id, AccountUpdateParams params, RequestOptions opti * operated on, but limited information can still be retrieved through the API in order to be able * to track their history. */ - public Account close(String id, AccountCloseParams params) - throws StripeException, RateLimitException { + public Account close(String id, AccountCloseParams params) throws StripeException { return close(id, params, (RequestOptions) null); } /** @@ -164,8 +155,7 @@ public Account close(String id, AccountCloseParams params) * operated on, but limited information can still be retrieved through the API in order to be able * to track their history. */ - public Account close(String id, RequestOptions options) - throws StripeException, RateLimitException { + public Account close(String id, RequestOptions options) throws StripeException { return close(id, (AccountCloseParams) null, options); } /** @@ -173,7 +163,7 @@ public Account close(String id, RequestOptions options) * operated on, but limited information can still be retrieved through the API in order to be able * to track their history. */ - public Account close(String id) throws StripeException, RateLimitException { + public Account close(String id) throws StripeException { return close(id, (AccountCloseParams) null, (RequestOptions) null); } /** @@ -182,7 +172,7 @@ public Account close(String id) throws StripeException, RateLimitException { * to track their history. */ public Account close(String id, AccountCloseParams params, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { String path = String.format("/v2/core/accounts/%s/close", ApiResource.urlEncodeId(id)); ApiRequest request = new ApiRequest( diff --git a/src/main/java/com/stripe/service/v2/core/AccountTokenService.java b/src/main/java/com/stripe/service/v2/core/AccountTokenService.java index 3eb34d7d350..cc7c754b89a 100644 --- a/src/main/java/com/stripe/service/v2/core/AccountTokenService.java +++ b/src/main/java/com/stripe/service/v2/core/AccountTokenService.java @@ -1,7 +1,6 @@ // File generated from our OpenAPI spec package com.stripe.service.v2.core; -import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.core.AccountToken; import com.stripe.net.ApiRequest; @@ -19,21 +18,20 @@ public AccountTokenService(StripeResponseGetter responseGetter) { } /** Creates an Account Token. */ - public AccountToken create(AccountTokenCreateParams params) - throws StripeException, RateLimitException { + public AccountToken create(AccountTokenCreateParams params) throws StripeException { return create(params, (RequestOptions) null); } /** Creates an Account Token. */ - public AccountToken create(RequestOptions options) throws StripeException, RateLimitException { + public AccountToken create(RequestOptions options) throws StripeException { return create((AccountTokenCreateParams) null, options); } /** Creates an Account Token. */ - public AccountToken create() throws StripeException, RateLimitException { + public AccountToken create() throws StripeException { return create((AccountTokenCreateParams) null, (RequestOptions) null); } /** Creates an Account Token. */ public AccountToken create(AccountTokenCreateParams params, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { String path = "/v2/core/account_tokens"; ApiRequest request = new ApiRequest( @@ -45,12 +43,11 @@ public AccountToken create(AccountTokenCreateParams params, RequestOptions optio return this.request(request, AccountToken.class); } /** Retrieves an Account Token. */ - public AccountToken retrieve(String id) throws StripeException, RateLimitException { + public AccountToken retrieve(String id) throws StripeException { return retrieve(id, (RequestOptions) null); } /** Retrieves an Account Token. */ - public AccountToken retrieve(String id, RequestOptions options) - throws StripeException, RateLimitException { + public AccountToken retrieve(String id, RequestOptions options) throws StripeException { String path = String.format("/v2/core/account_tokens/%s", ApiResource.urlEncodeId(id)); ApiRequest request = new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); diff --git a/src/main/java/com/stripe/service/v2/core/accounts/PersonService.java b/src/main/java/com/stripe/service/v2/core/accounts/PersonService.java index 4a1b2b957e4..1ba7615b0cc 100644 --- a/src/main/java/com/stripe/service/v2/core/accounts/PersonService.java +++ b/src/main/java/com/stripe/service/v2/core/accounts/PersonService.java @@ -2,7 +2,6 @@ package com.stripe.service.v2.core.accounts; import com.google.gson.reflect.TypeToken; -import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.DeletedObject; import com.stripe.model.v2.StripeCollection; @@ -25,23 +24,21 @@ public PersonService(StripeResponseGetter responseGetter) { /** Returns a paginated list of Persons associated with an Account. */ public StripeCollection list(String accountId, PersonListParams params) - throws StripeException, RateLimitException { + throws StripeException { return list(accountId, params, (RequestOptions) null); } /** Returns a paginated list of Persons associated with an Account. */ public StripeCollection list(String accountId, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { return list(accountId, (PersonListParams) null, options); } /** Returns a paginated list of Persons associated with an Account. */ - public StripeCollection list(String accountId) - throws StripeException, RateLimitException { + public StripeCollection list(String accountId) throws StripeException { return list(accountId, (PersonListParams) null, (RequestOptions) null); } /** Returns a paginated list of Persons associated with an Account. */ public StripeCollection list( - String accountId, PersonListParams params, RequestOptions options) - throws StripeException, RateLimitException { + String accountId, PersonListParams params, RequestOptions options) throws StripeException { String path = String.format("/v2/core/accounts/%s/persons", ApiResource.urlEncodeId(accountId)); ApiRequest request = new ApiRequest( @@ -56,23 +53,21 @@ public StripeCollection list( * Create a Person. Adds an individual to an Account's identity. You can set relationship * attributes and identity information at creation. */ - public AccountPerson create(String accountId, PersonCreateParams params) - throws StripeException, RateLimitException { + public AccountPerson create(String accountId, PersonCreateParams params) throws StripeException { return create(accountId, params, (RequestOptions) null); } /** * Create a Person. Adds an individual to an Account's identity. You can set relationship * attributes and identity information at creation. */ - public AccountPerson create(String accountId, RequestOptions options) - throws StripeException, RateLimitException { + public AccountPerson create(String accountId, RequestOptions options) throws StripeException { return create(accountId, (PersonCreateParams) null, options); } /** * Create a Person. Adds an individual to an Account's identity. You can set relationship * attributes and identity information at creation. */ - public AccountPerson create(String accountId) throws StripeException, RateLimitException { + public AccountPerson create(String accountId) throws StripeException { return create(accountId, (PersonCreateParams) null, (RequestOptions) null); } /** @@ -80,7 +75,7 @@ public AccountPerson create(String accountId) throws StripeException, RateLimitE * attributes and identity information at creation. */ public AccountPerson create(String accountId, PersonCreateParams params, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { String path = String.format("/v2/core/accounts/%s/persons", ApiResource.urlEncodeId(accountId)); ApiRequest request = new ApiRequest( @@ -92,13 +87,12 @@ public AccountPerson create(String accountId, PersonCreateParams params, Request return this.request(request, AccountPerson.class); } /** Delete a Person associated with an Account. */ - public DeletedObject delete(String accountId, String id) - throws StripeException, RateLimitException { + public DeletedObject delete(String accountId, String id) throws StripeException { return delete(accountId, id, (RequestOptions) null); } /** Delete a Person associated with an Account. */ public DeletedObject delete(String accountId, String id, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { String path = String.format( "/v2/core/accounts/%s/persons/%s", @@ -108,13 +102,12 @@ public DeletedObject delete(String accountId, String id, RequestOptions options) return this.request(request, DeletedObject.class); } /** Retrieves a Person associated with an Account. */ - public AccountPerson retrieve(String accountId, String id) - throws StripeException, RateLimitException { + public AccountPerson retrieve(String accountId, String id) throws StripeException { return retrieve(accountId, id, (RequestOptions) null); } /** Retrieves a Person associated with an Account. */ public AccountPerson retrieve(String accountId, String id, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { String path = String.format( "/v2/core/accounts/%s/persons/%s", @@ -125,23 +118,22 @@ public AccountPerson retrieve(String accountId, String id, RequestOptions option } /** Updates a Person associated with an Account. */ public AccountPerson update(String accountId, String id, PersonUpdateParams params) - throws StripeException, RateLimitException { + throws StripeException { return update(accountId, id, params, (RequestOptions) null); } /** Updates a Person associated with an Account. */ public AccountPerson update(String accountId, String id, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { return update(accountId, id, (PersonUpdateParams) null, options); } /** Updates a Person associated with an Account. */ - public AccountPerson update(String accountId, String id) - throws StripeException, RateLimitException { + public AccountPerson update(String accountId, String id) throws StripeException { return update(accountId, id, (PersonUpdateParams) null, (RequestOptions) null); } /** Updates a Person associated with an Account. */ public AccountPerson update( String accountId, String id, PersonUpdateParams params, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { String path = String.format( "/v2/core/accounts/%s/persons/%s", diff --git a/src/main/java/com/stripe/service/v2/core/accounts/PersonTokenService.java b/src/main/java/com/stripe/service/v2/core/accounts/PersonTokenService.java index b6180a4b7d7..4325a3193ec 100644 --- a/src/main/java/com/stripe/service/v2/core/accounts/PersonTokenService.java +++ b/src/main/java/com/stripe/service/v2/core/accounts/PersonTokenService.java @@ -1,7 +1,6 @@ // File generated from our OpenAPI spec package com.stripe.service.v2.core.accounts; -import com.stripe.exception.RateLimitException; import com.stripe.exception.StripeException; import com.stripe.model.v2.core.AccountPersonToken; import com.stripe.net.ApiRequest; @@ -20,22 +19,22 @@ public PersonTokenService(StripeResponseGetter responseGetter) { /** Creates a Person Token associated with an Account. */ public AccountPersonToken create(String accountId, PersonTokenCreateParams params) - throws StripeException, RateLimitException { + throws StripeException { return create(accountId, params, (RequestOptions) null); } /** Creates a Person Token associated with an Account. */ public AccountPersonToken create(String accountId, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { return create(accountId, (PersonTokenCreateParams) null, options); } /** Creates a Person Token associated with an Account. */ - public AccountPersonToken create(String accountId) throws StripeException, RateLimitException { + public AccountPersonToken create(String accountId) throws StripeException { return create(accountId, (PersonTokenCreateParams) null, (RequestOptions) null); } /** Creates a Person Token associated with an Account. */ public AccountPersonToken create( String accountId, PersonTokenCreateParams params, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { String path = String.format("/v2/core/accounts/%s/person_tokens", ApiResource.urlEncodeId(accountId)); ApiRequest request = @@ -48,13 +47,12 @@ public AccountPersonToken create( return this.request(request, AccountPersonToken.class); } /** Retrieves a Person Token associated with an Account. */ - public AccountPersonToken retrieve(String accountId, String id) - throws StripeException, RateLimitException { + public AccountPersonToken retrieve(String accountId, String id) throws StripeException { return retrieve(accountId, id, (RequestOptions) null); } /** Retrieves a Person Token associated with an Account. */ public AccountPersonToken retrieve(String accountId, String id, RequestOptions options) - throws StripeException, RateLimitException { + throws StripeException { String path = String.format( "/v2/core/accounts/%s/person_tokens/%s", diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index 3e7868791a6..44f6f8fea82 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -25154,31 +25154,6 @@ public void testV2CoreEventDestinationPost5Services() throws StripeException { null); } - @Test - public void testRateLimitErrorServices() throws StripeException { - stubRequestReturnError( - BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/core/accounts", - null, - null, - "{\"error\":{\"type\":\"rate_limit\",\"code\":\"account_rate_limit_exceeded\"}}", - 400); - StripeClient client = new StripeClient(networkSpy); - - com.stripe.param.v2.core.AccountListParams params = - com.stripe.param.v2.core.AccountListParams.builder().build(); - - try { - client.v2().core().accounts().list(params); - } catch (RateLimitException e) { - - } - ; - verifyRequest( - BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/core/accounts", params.toMap(), null); - } - @Test public void testTemporarySessionExpiredErrorServices() throws StripeException { stubRequestReturnError(