Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
88aa59022b32620f4d66d6196e3b42d5a0f86bbb
61e410d24d6de541c86c48b265b7647c164457ee
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2140
v2151
2 changes: 2 additions & 0 deletions lib/stripe/api_requestor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/stripe/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
61 changes: 61 additions & 0 deletions lib/stripe/event_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down
44 changes: 44 additions & 0 deletions lib/stripe/events/v2_core_account_closed_event.rb
Original file line number Diff line number Diff line change
@@ -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
44 changes: 44 additions & 0 deletions lib/stripe/events/v2_core_account_created_event.rb
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Loading