diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 93be1cef5..c63a3302e 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 16739433e..5e8e56a7f 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/lib/stripe/api_requestor.rb b/lib/stripe/api_requestor.rb index 11b77ebfb..9ea81bdb6 100644 --- a/lib/stripe/api_requestor.rb +++ b/lib/stripe/api_requestor.rb @@ -853,6 +853,8 @@ def self.maybe_gc_connection_managers when "idempotency_error" IdempotencyError.new(error_data[:message], **opts) # switch cases: The beginning of the section generated from our OpenAPI spec + when "rate_limit" + RateLimitError.new(error_data[:message], **opts) when "temporary_session_expired" TemporarySessionExpiredError.new(error_data[:message], **opts) # switch cases: The end of the section generated from our OpenAPI spec diff --git a/lib/stripe/errors.rb b/lib/stripe/errors.rb index 98c79898e..f23b1e700 100644 --- a/lib/stripe/errors.rb +++ b/lib/stripe/errors.rb @@ -162,6 +162,9 @@ class UnsupportedResponseTypeError < OAuthError end # class definitions: The beginning of the section generated from our OpenAPI spec + class RateLimitError < StripeError + end + class TemporarySessionExpiredError < StripeError end # class definitions: The end of the section generated from our OpenAPI spec diff --git a/lib/stripe/event_types.rb b/lib/stripe/event_types.rb index f1acb3d3b..6fb3dd86d 100644 --- a/lib/stripe/event_types.rb +++ b/lib/stripe/event_types.rb @@ -8,6 +8,33 @@ def self.v2_event_types_to_classes Events::V1BillingMeterErrorReportTriggeredEvent.lookup_type => Events::V1BillingMeterErrorReportTriggeredEvent, Events::V1BillingMeterNoMeterFoundEvent.lookup_type => Events::V1BillingMeterNoMeterFoundEvent, + Events::V2CoreAccountClosedEvent.lookup_type => Events::V2CoreAccountClosedEvent, + Events::V2CoreAccountCreatedEvent.lookup_type => Events::V2CoreAccountCreatedEvent, + Events::V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.lookup_type => + Events::V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent, + Events::V2CoreAccountIncludingConfigurationCustomerUpdatedEvent.lookup_type => + Events::V2CoreAccountIncludingConfigurationCustomerUpdatedEvent, + Events::V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.lookup_type => + Events::V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent, + Events::V2CoreAccountIncludingConfigurationMerchantUpdatedEvent.lookup_type => + Events::V2CoreAccountIncludingConfigurationMerchantUpdatedEvent, + Events::V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.lookup_type => + Events::V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent, + Events::V2CoreAccountIncludingConfigurationRecipientUpdatedEvent.lookup_type => + Events::V2CoreAccountIncludingConfigurationRecipientUpdatedEvent, + Events::V2CoreAccountIncludingDefaultsUpdatedEvent.lookup_type => + Events::V2CoreAccountIncludingDefaultsUpdatedEvent, + Events::V2CoreAccountIncludingFutureRequirementsUpdatedEvent.lookup_type => + Events::V2CoreAccountIncludingFutureRequirementsUpdatedEvent, + Events::V2CoreAccountIncludingIdentityUpdatedEvent.lookup_type => + Events::V2CoreAccountIncludingIdentityUpdatedEvent, + Events::V2CoreAccountIncludingRequirementsUpdatedEvent.lookup_type => + Events::V2CoreAccountIncludingRequirementsUpdatedEvent, + Events::V2CoreAccountLinkReturnedEvent.lookup_type => Events::V2CoreAccountLinkReturnedEvent, + Events::V2CoreAccountPersonCreatedEvent.lookup_type => Events::V2CoreAccountPersonCreatedEvent, + Events::V2CoreAccountPersonDeletedEvent.lookup_type => Events::V2CoreAccountPersonDeletedEvent, + Events::V2CoreAccountPersonUpdatedEvent.lookup_type => Events::V2CoreAccountPersonUpdatedEvent, + Events::V2CoreAccountUpdatedEvent.lookup_type => Events::V2CoreAccountUpdatedEvent, Events::V2CoreEventDestinationPingEvent.lookup_type => Events::V2CoreEventDestinationPingEvent, # v2 event types: The end of the section generated from our OpenAPI spec } @@ -20,6 +47,40 @@ def self.event_notification_types_to_classes Events::V1BillingMeterErrorReportTriggeredEventNotification, Events::V1BillingMeterNoMeterFoundEventNotification.lookup_type => Events::V1BillingMeterNoMeterFoundEventNotification, + Events::V2CoreAccountClosedEventNotification.lookup_type => + Events::V2CoreAccountClosedEventNotification, + Events::V2CoreAccountCreatedEventNotification.lookup_type => + Events::V2CoreAccountCreatedEventNotification, + Events::V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification.lookup_type => + Events::V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification, + Events::V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification.lookup_type => + Events::V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification, + Events::V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification.lookup_type => + Events::V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification, + Events::V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification.lookup_type => + Events::V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification, + Events::V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification.lookup_type => + Events::V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification, + Events::V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification.lookup_type => + Events::V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification, + Events::V2CoreAccountIncludingDefaultsUpdatedEventNotification.lookup_type => + Events::V2CoreAccountIncludingDefaultsUpdatedEventNotification, + Events::V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification.lookup_type => + Events::V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification, + Events::V2CoreAccountIncludingIdentityUpdatedEventNotification.lookup_type => + Events::V2CoreAccountIncludingIdentityUpdatedEventNotification, + Events::V2CoreAccountIncludingRequirementsUpdatedEventNotification.lookup_type => + Events::V2CoreAccountIncludingRequirementsUpdatedEventNotification, + Events::V2CoreAccountLinkReturnedEventNotification.lookup_type => + Events::V2CoreAccountLinkReturnedEventNotification, + Events::V2CoreAccountPersonCreatedEventNotification.lookup_type => + Events::V2CoreAccountPersonCreatedEventNotification, + Events::V2CoreAccountPersonDeletedEventNotification.lookup_type => + Events::V2CoreAccountPersonDeletedEventNotification, + Events::V2CoreAccountPersonUpdatedEventNotification.lookup_type => + Events::V2CoreAccountPersonUpdatedEventNotification, + Events::V2CoreAccountUpdatedEventNotification.lookup_type => + Events::V2CoreAccountUpdatedEventNotification, Events::V2CoreEventDestinationPingEventNotification.lookup_type => Events::V2CoreEventDestinationPingEventNotification, # event notification types: The end of the section generated from our OpenAPI spec diff --git a/lib/stripe/events/v2_core_account_closed_event.rb b/lib/stripe/events/v2_core_account_closed_event.rb new file mode 100644 index 000000000..40abb6dc3 --- /dev/null +++ b/lib/stripe/events/v2_core_account_closed_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # This event occurs when an account is closed. + class V2CoreAccountClosedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account.closed" + end + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + attr_reader :related_object + end + + # This event occurs when an account is closed. + class V2CoreAccountClosedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account.closed" + end + + attr_reader :related_object + + # Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_created_event.rb b/lib/stripe/events/v2_core_account_created_event.rb new file mode 100644 index 000000000..d4475592e --- /dev/null +++ b/lib/stripe/events/v2_core_account_created_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when an Account is created. + class V2CoreAccountCreatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account.created" + end + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + attr_reader :related_object + end + + # Occurs when an Account is created. + class V2CoreAccountCreatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account.created" + end + + attr_reader :related_object + + # Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb b/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb new file mode 100644 index 000000000..250c5ef33 --- /dev/null +++ b/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb @@ -0,0 +1,63 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when the status of an Account's customer configuration capability is updated. + class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account[configuration.customer].capability_status_updated" + end + + class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData < ::Stripe::StripeObject + # Open Enum. The capability which had its status updated. + attr_reader :updated_capability + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + + def self.inner_class_types + @inner_class_types = { + data: V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData, + } + end + attr_reader :data, :related_object + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + end + + # Occurs when the status of an Account's customer configuration capability is updated. + class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account[configuration.customer].capability_status_updated" + end + + attr_reader :related_object + + # Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb b/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb new file mode 100644 index 000000000..8fab2d2a1 --- /dev/null +++ b/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when an Account's customer configuration is updated. + class V2CoreAccountIncludingConfigurationCustomerUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account[configuration.customer].updated" + end + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + attr_reader :related_object + end + + # Occurs when an Account's customer configuration is updated. + class V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account[configuration.customer].updated" + end + + attr_reader :related_object + + # Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb b/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb new file mode 100644 index 000000000..9c735ded5 --- /dev/null +++ b/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb @@ -0,0 +1,63 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when the status of an Account's merchant configuration capability is updated. + class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account[configuration.merchant].capability_status_updated" + end + + class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData < ::Stripe::StripeObject + # Open Enum. The capability which had its status updated. + attr_reader :updated_capability + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + + def self.inner_class_types + @inner_class_types = { + data: V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData, + } + end + attr_reader :data, :related_object + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + end + + # Occurs when the status of an Account's merchant configuration capability is updated. + class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account[configuration.merchant].capability_status_updated" + end + + attr_reader :related_object + + # Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb b/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb new file mode 100644 index 000000000..2655b36c2 --- /dev/null +++ b/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when an Account's merchant configuration is updated. + class V2CoreAccountIncludingConfigurationMerchantUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account[configuration.merchant].updated" + end + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + attr_reader :related_object + end + + # Occurs when an Account's merchant configuration is updated. + class V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account[configuration.merchant].updated" + end + + attr_reader :related_object + + # Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb b/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb new file mode 100644 index 000000000..ec8cc0b42 --- /dev/null +++ b/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb @@ -0,0 +1,63 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when the status of an Account's recipient configuration capability is updated. + class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account[configuration.recipient].capability_status_updated" + end + + class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventData < ::Stripe::StripeObject + # Open Enum. The capability which had its status updated. + attr_reader :updated_capability + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + + def self.inner_class_types + @inner_class_types = { + data: V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventData, + } + end + attr_reader :data, :related_object + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + end + + # Occurs when the status of an Account's recipient configuration capability is updated. + class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account[configuration.recipient].capability_status_updated" + end + + attr_reader :related_object + + # Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb b/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb new file mode 100644 index 000000000..da6a2b4a0 --- /dev/null +++ b/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when a Recipient's configuration is updated. + class V2CoreAccountIncludingConfigurationRecipientUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account[configuration.recipient].updated" + end + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + attr_reader :related_object + end + + # Occurs when a Recipient's configuration is updated. + class V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account[configuration.recipient].updated" + end + + attr_reader :related_object + + # Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb b/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb new file mode 100644 index 000000000..7dba4e753 --- /dev/null +++ b/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # This event occurs when account defaults are created or updated. + class V2CoreAccountIncludingDefaultsUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account[defaults].updated" + end + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + attr_reader :related_object + end + + # This event occurs when account defaults are created or updated. + class V2CoreAccountIncludingDefaultsUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account[defaults].updated" + end + + attr_reader :related_object + + # Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_including_future_requirements_updated_event.rb b/lib/stripe/events/v2_core_account_including_future_requirements_updated_event.rb new file mode 100644 index 000000000..7001528f2 --- /dev/null +++ b/lib/stripe/events/v2_core_account_including_future_requirements_updated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when an Account's future requirements are updated. + class V2CoreAccountIncludingFutureRequirementsUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account[future_requirements].updated" + end + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + attr_reader :related_object + end + + # Occurs when an Account's future requirements are updated. + class V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account[future_requirements].updated" + end + + attr_reader :related_object + + # Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_including_identity_updated_event.rb b/lib/stripe/events/v2_core_account_including_identity_updated_event.rb new file mode 100644 index 000000000..f9cdda9e4 --- /dev/null +++ b/lib/stripe/events/v2_core_account_including_identity_updated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when an Identity is updated. + class V2CoreAccountIncludingIdentityUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account[identity].updated" + end + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + attr_reader :related_object + end + + # Occurs when an Identity is updated. + class V2CoreAccountIncludingIdentityUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account[identity].updated" + end + + attr_reader :related_object + + # Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb b/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb new file mode 100644 index 000000000..15d7f2936 --- /dev/null +++ b/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when an Account's requirements are updated. + class V2CoreAccountIncludingRequirementsUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account[requirements].updated" + end + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + attr_reader :related_object + end + + # Occurs when an Account's requirements are updated. + class V2CoreAccountIncludingRequirementsUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account[requirements].updated" + end + + attr_reader :related_object + + # Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_link_returned_event.rb b/lib/stripe/events/v2_core_account_link_returned_event.rb new file mode 100644 index 000000000..01678b443 --- /dev/null +++ b/lib/stripe/events/v2_core_account_link_returned_event.rb @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when the generated AccountLink is completed. + class V2CoreAccountLinkReturnedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account_link.returned" + end + + class V2CoreAccountLinkReturnedEventData < ::Stripe::StripeObject + # Open Enum. The use case type of the account link that has been completed. + attr_reader :use_case + # The ID of the v2 account. + attr_reader :account_id + # Configurations on the Account that was onboarded via the account link. + attr_reader :configurations + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + + def self.inner_class_types + @inner_class_types = { data: V2CoreAccountLinkReturnedEventData } + end + attr_reader :data + end + + # Occurs when the generated AccountLink is completed. + class V2CoreAccountLinkReturnedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account_link.returned" + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_person_created_event.rb b/lib/stripe/events/v2_core_account_person_created_event.rb new file mode 100644 index 000000000..ff7bc4f89 --- /dev/null +++ b/lib/stripe/events/v2_core_account_person_created_event.rb @@ -0,0 +1,61 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when a Person is created. + class V2CoreAccountPersonCreatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account_person.created" + end + + class V2CoreAccountPersonCreatedEventData < ::Stripe::StripeObject + # The ID of the v2 account. + attr_reader :account_id + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + + def self.inner_class_types + @inner_class_types = { data: V2CoreAccountPersonCreatedEventData } + end + attr_reader :data, :related_object + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + end + + # Occurs when a Person is created. + class V2CoreAccountPersonCreatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account_person.created" + end + + attr_reader :related_object + + # Retrieves the AccountPerson related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_person_deleted_event.rb b/lib/stripe/events/v2_core_account_person_deleted_event.rb new file mode 100644 index 000000000..8b429c72c --- /dev/null +++ b/lib/stripe/events/v2_core_account_person_deleted_event.rb @@ -0,0 +1,61 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when a Person is deleted. + class V2CoreAccountPersonDeletedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account_person.deleted" + end + + class V2CoreAccountPersonDeletedEventData < ::Stripe::StripeObject + # The ID of the v2 account. + attr_reader :account_id + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + + def self.inner_class_types + @inner_class_types = { data: V2CoreAccountPersonDeletedEventData } + end + attr_reader :data, :related_object + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + end + + # Occurs when a Person is deleted. + class V2CoreAccountPersonDeletedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account_person.deleted" + end + + attr_reader :related_object + + # Retrieves the AccountPerson related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_person_updated_event.rb b/lib/stripe/events/v2_core_account_person_updated_event.rb new file mode 100644 index 000000000..6996dbdb1 --- /dev/null +++ b/lib/stripe/events/v2_core_account_person_updated_event.rb @@ -0,0 +1,61 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when a Person is updated. + class V2CoreAccountPersonUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account_person.updated" + end + + class V2CoreAccountPersonUpdatedEventData < ::Stripe::StripeObject + # The ID of the v2 account. + attr_reader :account_id + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + + def self.inner_class_types + @inner_class_types = { data: V2CoreAccountPersonUpdatedEventData } + end + attr_reader :data, :related_object + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + end + + # Occurs when a Person is updated. + class V2CoreAccountPersonUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account_person.updated" + end + + attr_reader :related_object + + # Retrieves the AccountPerson related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_account_updated_event.rb b/lib/stripe/events/v2_core_account_updated_event.rb new file mode 100644 index 000000000..a575bcf73 --- /dev/null +++ b/lib/stripe/events/v2_core_account_updated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when an Account is updated. + class V2CoreAccountUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v2.core.account.updated" + end + + # Retrieves the related object from the API. Makes an API request on every call. + def fetch_related_object + _request( + method: :get, + path: related_object.url, + base_address: :api, + opts: { stripe_context: context } + ) + end + attr_reader :related_object + end + + # Occurs when an Account is updated. + class V2CoreAccountUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v2.core.account.updated" + end + + attr_reader :related_object + + # Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call. + def fetch_related_object + resp = @client.raw_request( + :get, + related_object.url, + opts: { stripe_context: context }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/resources.rb b/lib/stripe/resources.rb index 76d8024ed..8996d7da5 100644 --- a/lib/stripe/resources.rb +++ b/lib/stripe/resources.rb @@ -157,4 +157,21 @@ require "stripe/resources/webhook_endpoint" require "stripe/events/v1_billing_meter_error_report_triggered_event" require "stripe/events/v1_billing_meter_no_meter_found_event" +require "stripe/events/v2_core_account_closed_event" +require "stripe/events/v2_core_account_created_event" +require "stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event" +require "stripe/events/v2_core_account_including_configuration_customer_updated_event" +require "stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event" +require "stripe/events/v2_core_account_including_configuration_merchant_updated_event" +require "stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event" +require "stripe/events/v2_core_account_including_configuration_recipient_updated_event" +require "stripe/events/v2_core_account_including_defaults_updated_event" +require "stripe/events/v2_core_account_including_future_requirements_updated_event" +require "stripe/events/v2_core_account_including_identity_updated_event" +require "stripe/events/v2_core_account_including_requirements_updated_event" +require "stripe/events/v2_core_account_link_returned_event" +require "stripe/events/v2_core_account_person_created_event" +require "stripe/events/v2_core_account_person_deleted_event" +require "stripe/events/v2_core_account_person_updated_event" +require "stripe/events/v2_core_account_updated_event" require "stripe/events/v2_core_event_destination_ping_event" diff --git a/lib/stripe/services/v2/core/account_link_service.rb b/lib/stripe/services/v2/core/account_link_service.rb index 1e1a14c37..3637a2025 100644 --- a/lib/stripe/services/v2/core/account_link_service.rb +++ b/lib/stripe/services/v2/core/account_link_service.rb @@ -6,6 +6,8 @@ module V2 module Core class AccountLinkService < StripeService # 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. + # + # ** raises RateLimitError def create(params = {}, opts = {}) request( method: :post, diff --git a/lib/stripe/services/v2/core/account_service.rb b/lib/stripe/services/v2/core/account_service.rb index 8a4b96527..f4a8e8b69 100644 --- a/lib/stripe/services/v2/core/account_service.rb +++ b/lib/stripe/services/v2/core/account_service.rb @@ -14,6 +14,8 @@ def initialize(requestor) end # Removes access to the Account and its associated resources. Closed Accounts can no longer be operated on, but limited information can still be retrieved through the API in order to be able to track their history. + # + # ** raises RateLimitError def close(id, params = {}, opts = {}) request( method: :post, @@ -25,6 +27,8 @@ def close(id, params = {}, opts = {}) end # An Account is a representation of a company, individual or other entity that a user interacts with. Accounts contain identifying information about the entity, and configurations that store 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. + # + # ** raises RateLimitError def create(params = {}, opts = {}) request( method: :post, @@ -36,6 +40,8 @@ def create(params = {}, opts = {}) end # Returns a list of Accounts. + # + # ** raises RateLimitError def list(params = {}, opts = {}) request( method: :get, @@ -47,6 +53,8 @@ def list(params = {}, opts = {}) end # Retrieves the details of an Account. + # + # ** raises RateLimitError def retrieve(id, params = {}, opts = {}) request( method: :get, @@ -58,6 +66,8 @@ def retrieve(id, params = {}, opts = {}) end # Updates the details of an Account. + # + # ** raises RateLimitError def update(id, params = {}, opts = {}) request( method: :post, diff --git a/lib/stripe/services/v2/core/account_token_service.rb b/lib/stripe/services/v2/core/account_token_service.rb index c31471f7c..ddb047147 100644 --- a/lib/stripe/services/v2/core/account_token_service.rb +++ b/lib/stripe/services/v2/core/account_token_service.rb @@ -6,6 +6,8 @@ module V2 module Core class AccountTokenService < StripeService # Creates an Account Token. + # + # ** raises RateLimitError def create(params = {}, opts = {}) request( method: :post, @@ -17,6 +19,8 @@ def create(params = {}, opts = {}) end # Retrieves an Account Token. + # + # ** raises RateLimitError def retrieve(id, params = {}, opts = {}) request( method: :get, diff --git a/lib/stripe/services/v2/core/accounts/person_service.rb b/lib/stripe/services/v2/core/accounts/person_service.rb index 51e8c6794..4001c7d10 100644 --- a/lib/stripe/services/v2/core/accounts/person_service.rb +++ b/lib/stripe/services/v2/core/accounts/person_service.rb @@ -7,6 +7,8 @@ module Core module Accounts class PersonService < StripeService # Create a Person. Adds an individual to an Account's identity. You can set relationship attributes and identity information at creation. + # + # ** raises RateLimitError def create(account_id, params = {}, opts = {}) request( method: :post, @@ -18,6 +20,8 @@ def create(account_id, params = {}, opts = {}) end # Delete a Person associated with an Account. + # + # ** raises RateLimitError def delete(account_id, id, params = {}, opts = {}) request( method: :delete, @@ -29,6 +33,8 @@ def delete(account_id, id, params = {}, opts = {}) end # Returns a paginated list of Persons associated with an Account. + # + # ** raises RateLimitError def list(account_id, params = {}, opts = {}) request( method: :get, @@ -40,6 +46,8 @@ def list(account_id, params = {}, opts = {}) end # Retrieves a Person associated with an Account. + # + # ** raises RateLimitError def retrieve(account_id, id, params = {}, opts = {}) request( method: :get, @@ -51,6 +59,8 @@ def retrieve(account_id, id, params = {}, opts = {}) end # Updates a Person associated with an Account. + # + # ** raises RateLimitError def update(account_id, id, params = {}, opts = {}) request( method: :post, diff --git a/lib/stripe/services/v2/core/accounts/person_token_service.rb b/lib/stripe/services/v2/core/accounts/person_token_service.rb index 89ab7ba49..943997407 100644 --- a/lib/stripe/services/v2/core/accounts/person_token_service.rb +++ b/lib/stripe/services/v2/core/accounts/person_token_service.rb @@ -7,6 +7,8 @@ module Core module Accounts class PersonTokenService < StripeService # Creates a Person Token associated with an Account. + # + # ** raises RateLimitError def create(account_id, params = {}, opts = {}) request( method: :post, @@ -18,6 +20,8 @@ def create(account_id, params = {}, opts = {}) end # Retrieves a Person Token associated with an Account. + # + # ** raises RateLimitError def retrieve(account_id, id, params = {}, opts = {}) request( method: :get, diff --git a/rbi/stripe.rbi b/rbi/stripe.rbi index 26e126328..257d3d3b4 100644 --- a/rbi/stripe.rbi +++ b/rbi/stripe.rbi @@ -57387,30 +57387,40 @@ module Stripe attr_reader :persons attr_reader :person_tokens # Removes access to the Account and its associated resources. Closed Accounts can no longer be operated on, but limited information can still be retrieved through the API in order to be able to track their history. + # + # ** raises RateLimitError sig { params(id: String, params: T.any(::Stripe::V2::Core::AccountCloseParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::Account) } def close(id, params = {}, opts = {}); end # An Account is a representation of a company, individual or other entity that a user interacts with. Accounts contain identifying information about the entity, and configurations that store 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. + # + # ** raises RateLimitError sig { params(params: T.any(::Stripe::V2::Core::AccountCreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::Account) } def create(params = {}, opts = {}); end # Returns a list of Accounts. + # + # ** raises RateLimitError sig { params(params: T.any(::Stripe::V2::Core::AccountListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::ListObject) } def list(params = {}, opts = {}); end # Retrieves the details of an Account. + # + # ** raises RateLimitError sig { params(id: String, params: T.any(::Stripe::V2::Core::AccountRetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::Account) } def retrieve(id, params = {}, opts = {}); end # Updates the details of an Account. + # + # ** raises RateLimitError sig { params(id: String, params: T.any(::Stripe::V2::Core::AccountUpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::Account) } @@ -57426,30 +57436,40 @@ module Stripe module Accounts class PersonService < StripeService # Create a Person. Adds an individual to an Account's identity. You can set relationship attributes and identity information at creation. + # + # ** raises RateLimitError sig { params(account_id: String, params: T.any(::Stripe::V2::Core::Accounts::PersonCreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountPerson) } def create(account_id, params = {}, opts = {}); end # Delete a Person associated with an Account. + # + # ** raises RateLimitError sig { params(account_id: String, id: String, params: T.any(::Stripe::V2::Core::Accounts::PersonDeleteParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::DeletedObject) } def delete(account_id, id, params = {}, opts = {}); end # Returns a paginated list of Persons associated with an Account. + # + # ** raises RateLimitError sig { params(account_id: String, params: T.any(::Stripe::V2::Core::Accounts::PersonListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::ListObject) } def list(account_id, params = {}, opts = {}); end # Retrieves a Person associated with an Account. + # + # ** raises RateLimitError sig { params(account_id: String, id: String, params: T.any(::Stripe::V2::Core::Accounts::PersonRetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountPerson) } def retrieve(account_id, id, params = {}, opts = {}); end # Updates a Person associated with an Account. + # + # ** raises RateLimitError sig { params(account_id: String, id: String, params: T.any(::Stripe::V2::Core::Accounts::PersonUpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountPerson) } @@ -57466,12 +57486,16 @@ module Stripe module Accounts class PersonTokenService < StripeService # Creates a Person Token associated with an Account. + # + # ** raises RateLimitError sig { params(account_id: String, params: T.any(::Stripe::V2::Core::Accounts::PersonTokenCreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountPersonToken) } def create(account_id, params = {}, opts = {}); end # Retrieves a Person Token associated with an Account. + # + # ** raises RateLimitError sig { params(account_id: String, id: String, params: T.any(::Stripe::V2::Core::Accounts::PersonTokenRetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountPersonToken) } @@ -57487,6 +57511,8 @@ module Stripe module Core class AccountLinkService < StripeService # 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. + # + # ** raises RateLimitError sig { params(params: T.any(::Stripe::V2::Core::AccountLinkCreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountLink) } @@ -57501,12 +57527,16 @@ module Stripe module Core class AccountTokenService < StripeService # Creates an Account Token. + # + # ** raises RateLimitError sig { params(params: T.any(::Stripe::V2::Core::AccountTokenCreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountToken) } def create(params = {}, opts = {}); end # Retrieves an Account Token. + # + # ** raises RateLimitError sig { params(id: String, params: T.any(::Stripe::V2::Core::AccountTokenRetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountToken) } diff --git a/rbi/stripe/services/v2/core/account_link_service.rbi b/rbi/stripe/services/v2/core/account_link_service.rbi index c6038b4d3..92e0b4342 100644 --- a/rbi/stripe/services/v2/core/account_link_service.rbi +++ b/rbi/stripe/services/v2/core/account_link_service.rbi @@ -7,6 +7,8 @@ module Stripe module Core class AccountLinkService < StripeService # 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. + # + # ** raises RateLimitError sig { params(params: T.any(::Stripe::V2::Core::AccountLinkCreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountLink) } diff --git a/rbi/stripe/services/v2/core/account_service.rbi b/rbi/stripe/services/v2/core/account_service.rbi index 07bbe1049..1c79e29b5 100644 --- a/rbi/stripe/services/v2/core/account_service.rbi +++ b/rbi/stripe/services/v2/core/account_service.rbi @@ -9,30 +9,40 @@ module Stripe attr_reader :persons attr_reader :person_tokens # Removes access to the Account and its associated resources. Closed Accounts can no longer be operated on, but limited information can still be retrieved through the API in order to be able to track their history. + # + # ** raises RateLimitError sig { params(id: String, params: T.any(::Stripe::V2::Core::AccountCloseParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::Account) } def close(id, params = {}, opts = {}); end # An Account is a representation of a company, individual or other entity that a user interacts with. Accounts contain identifying information about the entity, and configurations that store 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. + # + # ** raises RateLimitError sig { params(params: T.any(::Stripe::V2::Core::AccountCreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::Account) } def create(params = {}, opts = {}); end # Returns a list of Accounts. + # + # ** raises RateLimitError sig { params(params: T.any(::Stripe::V2::Core::AccountListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::ListObject) } def list(params = {}, opts = {}); end # Retrieves the details of an Account. + # + # ** raises RateLimitError sig { params(id: String, params: T.any(::Stripe::V2::Core::AccountRetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::Account) } def retrieve(id, params = {}, opts = {}); end # Updates the details of an Account. + # + # ** raises RateLimitError sig { params(id: String, params: T.any(::Stripe::V2::Core::AccountUpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::Account) } diff --git a/rbi/stripe/services/v2/core/account_token_service.rbi b/rbi/stripe/services/v2/core/account_token_service.rbi index b8e484959..4dcf81be1 100644 --- a/rbi/stripe/services/v2/core/account_token_service.rbi +++ b/rbi/stripe/services/v2/core/account_token_service.rbi @@ -7,12 +7,16 @@ module Stripe module Core class AccountTokenService < StripeService # Creates an Account Token. + # + # ** raises RateLimitError sig { params(params: T.any(::Stripe::V2::Core::AccountTokenCreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountToken) } def create(params = {}, opts = {}); end # Retrieves an Account Token. + # + # ** raises RateLimitError sig { params(id: String, params: T.any(::Stripe::V2::Core::AccountTokenRetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountToken) } diff --git a/rbi/stripe/services/v2/core/accounts/person_service.rbi b/rbi/stripe/services/v2/core/accounts/person_service.rbi index 7bc206873..c7f6d64fb 100644 --- a/rbi/stripe/services/v2/core/accounts/person_service.rbi +++ b/rbi/stripe/services/v2/core/accounts/person_service.rbi @@ -8,30 +8,40 @@ module Stripe module Accounts class PersonService < StripeService # Create a Person. Adds an individual to an Account's identity. You can set relationship attributes and identity information at creation. + # + # ** raises RateLimitError sig { params(account_id: String, params: T.any(::Stripe::V2::Core::Accounts::PersonCreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountPerson) } def create(account_id, params = {}, opts = {}); end # Delete a Person associated with an Account. + # + # ** raises RateLimitError sig { params(account_id: String, id: String, params: T.any(::Stripe::V2::Core::Accounts::PersonDeleteParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::DeletedObject) } def delete(account_id, id, params = {}, opts = {}); end # Returns a paginated list of Persons associated with an Account. + # + # ** raises RateLimitError sig { params(account_id: String, params: T.any(::Stripe::V2::Core::Accounts::PersonListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::ListObject) } def list(account_id, params = {}, opts = {}); end # Retrieves a Person associated with an Account. + # + # ** raises RateLimitError sig { params(account_id: String, id: String, params: T.any(::Stripe::V2::Core::Accounts::PersonRetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountPerson) } def retrieve(account_id, id, params = {}, opts = {}); end # Updates a Person associated with an Account. + # + # ** raises RateLimitError sig { params(account_id: String, id: String, params: T.any(::Stripe::V2::Core::Accounts::PersonUpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountPerson) } diff --git a/rbi/stripe/services/v2/core/accounts/person_token_service.rbi b/rbi/stripe/services/v2/core/accounts/person_token_service.rbi index 401dd9eef..072d94c8b 100644 --- a/rbi/stripe/services/v2/core/accounts/person_token_service.rbi +++ b/rbi/stripe/services/v2/core/accounts/person_token_service.rbi @@ -8,12 +8,16 @@ module Stripe module Accounts class PersonTokenService < StripeService # Creates a Person Token associated with an Account. + # + # ** raises RateLimitError sig { params(account_id: String, params: T.any(::Stripe::V2::Core::Accounts::PersonTokenCreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountPersonToken) } def create(account_id, params = {}, opts = {}); end # Retrieves a Person Token associated with an Account. + # + # ** raises RateLimitError sig { params(account_id: String, id: String, params: T.any(::Stripe::V2::Core::Accounts::PersonTokenRetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Core::AccountPersonToken) } diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 7eb5ddc6f..63b1a5990 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -7882,6 +7882,18 @@ class CodegennedExampleTest < Test::Unit::TestCase event = client.v2.core.event_destinations.ping("id_123") assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v2/core/event_destinations/id_123/ping" end + should "Test rate limit error (service)" do + stub_request(:get, "#{Stripe::DEFAULT_API_BASE}/v2/core/accounts").to_return( + body: '{"error":{"type":"rate_limit","code":"account_rate_limit_exceeded"}}', + status: 400 + ) + client = Stripe::StripeClient.new("sk_test_123") + + assert_raises Stripe::RateLimitError do + accounts = client.v2.core.accounts.list + end + assert_requested :get, "#{Stripe::DEFAULT_API_BASE}/v2/core/accounts" + end should "Test temporary session expired error (service)" do stub_request( :post,