Skip to content

Commit a992bec

Browse files
Update generated code for v2151 and (#1767)
Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
1 parent 24ed552 commit a992bec

35 files changed

+1041
-2
lines changed

CODEGEN_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
88aa59022b32620f4d66d6196e3b42d5a0f86bbb
1+
61e410d24d6de541c86c48b265b7647c164457ee

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2140
1+
v2151

lib/stripe/api_requestor.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,8 @@ def self.maybe_gc_connection_managers
853853
when "idempotency_error"
854854
IdempotencyError.new(error_data[:message], **opts)
855855
# switch cases: The beginning of the section generated from our OpenAPI spec
856+
when "rate_limit"
857+
RateLimitError.new(error_data[:message], **opts)
856858
when "temporary_session_expired"
857859
TemporarySessionExpiredError.new(error_data[:message], **opts)
858860
# switch cases: The end of the section generated from our OpenAPI spec

lib/stripe/errors.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ class UnsupportedResponseTypeError < OAuthError
162162
end
163163

164164
# class definitions: The beginning of the section generated from our OpenAPI spec
165+
class RateLimitError < StripeError
166+
end
167+
165168
class TemporarySessionExpiredError < StripeError
166169
end
167170
# class definitions: The end of the section generated from our OpenAPI spec

lib/stripe/event_types.rb

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,33 @@ def self.v2_event_types_to_classes
88
Events::V1BillingMeterErrorReportTriggeredEvent.lookup_type =>
99
Events::V1BillingMeterErrorReportTriggeredEvent,
1010
Events::V1BillingMeterNoMeterFoundEvent.lookup_type => Events::V1BillingMeterNoMeterFoundEvent,
11+
Events::V2CoreAccountClosedEvent.lookup_type => Events::V2CoreAccountClosedEvent,
12+
Events::V2CoreAccountCreatedEvent.lookup_type => Events::V2CoreAccountCreatedEvent,
13+
Events::V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.lookup_type =>
14+
Events::V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent,
15+
Events::V2CoreAccountIncludingConfigurationCustomerUpdatedEvent.lookup_type =>
16+
Events::V2CoreAccountIncludingConfigurationCustomerUpdatedEvent,
17+
Events::V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.lookup_type =>
18+
Events::V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent,
19+
Events::V2CoreAccountIncludingConfigurationMerchantUpdatedEvent.lookup_type =>
20+
Events::V2CoreAccountIncludingConfigurationMerchantUpdatedEvent,
21+
Events::V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.lookup_type =>
22+
Events::V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent,
23+
Events::V2CoreAccountIncludingConfigurationRecipientUpdatedEvent.lookup_type =>
24+
Events::V2CoreAccountIncludingConfigurationRecipientUpdatedEvent,
25+
Events::V2CoreAccountIncludingDefaultsUpdatedEvent.lookup_type =>
26+
Events::V2CoreAccountIncludingDefaultsUpdatedEvent,
27+
Events::V2CoreAccountIncludingFutureRequirementsUpdatedEvent.lookup_type =>
28+
Events::V2CoreAccountIncludingFutureRequirementsUpdatedEvent,
29+
Events::V2CoreAccountIncludingIdentityUpdatedEvent.lookup_type =>
30+
Events::V2CoreAccountIncludingIdentityUpdatedEvent,
31+
Events::V2CoreAccountIncludingRequirementsUpdatedEvent.lookup_type =>
32+
Events::V2CoreAccountIncludingRequirementsUpdatedEvent,
33+
Events::V2CoreAccountLinkReturnedEvent.lookup_type => Events::V2CoreAccountLinkReturnedEvent,
34+
Events::V2CoreAccountPersonCreatedEvent.lookup_type => Events::V2CoreAccountPersonCreatedEvent,
35+
Events::V2CoreAccountPersonDeletedEvent.lookup_type => Events::V2CoreAccountPersonDeletedEvent,
36+
Events::V2CoreAccountPersonUpdatedEvent.lookup_type => Events::V2CoreAccountPersonUpdatedEvent,
37+
Events::V2CoreAccountUpdatedEvent.lookup_type => Events::V2CoreAccountUpdatedEvent,
1138
Events::V2CoreEventDestinationPingEvent.lookup_type => Events::V2CoreEventDestinationPingEvent,
1239
# v2 event types: The end of the section generated from our OpenAPI spec
1340
}
@@ -20,6 +47,40 @@ def self.event_notification_types_to_classes
2047
Events::V1BillingMeterErrorReportTriggeredEventNotification,
2148
Events::V1BillingMeterNoMeterFoundEventNotification.lookup_type =>
2249
Events::V1BillingMeterNoMeterFoundEventNotification,
50+
Events::V2CoreAccountClosedEventNotification.lookup_type =>
51+
Events::V2CoreAccountClosedEventNotification,
52+
Events::V2CoreAccountCreatedEventNotification.lookup_type =>
53+
Events::V2CoreAccountCreatedEventNotification,
54+
Events::V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification.lookup_type =>
55+
Events::V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification,
56+
Events::V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification.lookup_type =>
57+
Events::V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification,
58+
Events::V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification.lookup_type =>
59+
Events::V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification,
60+
Events::V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification.lookup_type =>
61+
Events::V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification,
62+
Events::V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification.lookup_type =>
63+
Events::V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification,
64+
Events::V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification.lookup_type =>
65+
Events::V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification,
66+
Events::V2CoreAccountIncludingDefaultsUpdatedEventNotification.lookup_type =>
67+
Events::V2CoreAccountIncludingDefaultsUpdatedEventNotification,
68+
Events::V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification.lookup_type =>
69+
Events::V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification,
70+
Events::V2CoreAccountIncludingIdentityUpdatedEventNotification.lookup_type =>
71+
Events::V2CoreAccountIncludingIdentityUpdatedEventNotification,
72+
Events::V2CoreAccountIncludingRequirementsUpdatedEventNotification.lookup_type =>
73+
Events::V2CoreAccountIncludingRequirementsUpdatedEventNotification,
74+
Events::V2CoreAccountLinkReturnedEventNotification.lookup_type =>
75+
Events::V2CoreAccountLinkReturnedEventNotification,
76+
Events::V2CoreAccountPersonCreatedEventNotification.lookup_type =>
77+
Events::V2CoreAccountPersonCreatedEventNotification,
78+
Events::V2CoreAccountPersonDeletedEventNotification.lookup_type =>
79+
Events::V2CoreAccountPersonDeletedEventNotification,
80+
Events::V2CoreAccountPersonUpdatedEventNotification.lookup_type =>
81+
Events::V2CoreAccountPersonUpdatedEventNotification,
82+
Events::V2CoreAccountUpdatedEventNotification.lookup_type =>
83+
Events::V2CoreAccountUpdatedEventNotification,
2384
Events::V2CoreEventDestinationPingEventNotification.lookup_type =>
2485
Events::V2CoreEventDestinationPingEventNotification,
2586
# event notification types: The end of the section generated from our OpenAPI spec
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# File generated from our OpenAPI spec
2+
# frozen_string_literal: true
3+
4+
module Stripe
5+
module Events
6+
# This event occurs when an account is closed.
7+
class V2CoreAccountClosedEvent < Stripe::V2::Core::Event
8+
def self.lookup_type
9+
"v2.core.account.closed"
10+
end
11+
12+
# Retrieves the related object from the API. Makes an API request on every call.
13+
def fetch_related_object
14+
_request(
15+
method: :get,
16+
path: related_object.url,
17+
base_address: :api,
18+
opts: { stripe_context: context }
19+
)
20+
end
21+
attr_reader :related_object
22+
end
23+
24+
# This event occurs when an account is closed.
25+
class V2CoreAccountClosedEventNotification < Stripe::V2::Core::EventNotification
26+
def self.lookup_type
27+
"v2.core.account.closed"
28+
end
29+
30+
attr_reader :related_object
31+
32+
# Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call.
33+
def fetch_related_object
34+
resp = @client.raw_request(
35+
:get,
36+
related_object.url,
37+
opts: { stripe_context: context },
38+
usage: ["fetch_related_object"]
39+
)
40+
@client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
41+
end
42+
end
43+
end
44+
end
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# File generated from our OpenAPI spec
2+
# frozen_string_literal: true
3+
4+
module Stripe
5+
module Events
6+
# Occurs when an Account is created.
7+
class V2CoreAccountCreatedEvent < Stripe::V2::Core::Event
8+
def self.lookup_type
9+
"v2.core.account.created"
10+
end
11+
12+
# Retrieves the related object from the API. Makes an API request on every call.
13+
def fetch_related_object
14+
_request(
15+
method: :get,
16+
path: related_object.url,
17+
base_address: :api,
18+
opts: { stripe_context: context }
19+
)
20+
end
21+
attr_reader :related_object
22+
end
23+
24+
# Occurs when an Account is created.
25+
class V2CoreAccountCreatedEventNotification < Stripe::V2::Core::EventNotification
26+
def self.lookup_type
27+
"v2.core.account.created"
28+
end
29+
30+
attr_reader :related_object
31+
32+
# Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call.
33+
def fetch_related_object
34+
resp = @client.raw_request(
35+
:get,
36+
related_object.url,
37+
opts: { stripe_context: context },
38+
usage: ["fetch_related_object"]
39+
)
40+
@client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
41+
end
42+
end
43+
end
44+
end
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# File generated from our OpenAPI spec
2+
# frozen_string_literal: true
3+
4+
module Stripe
5+
module Events
6+
# Occurs when the status of an Account's customer configuration capability is updated.
7+
class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent < Stripe::V2::Core::Event
8+
def self.lookup_type
9+
"v2.core.account[configuration.customer].capability_status_updated"
10+
end
11+
12+
class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData < ::Stripe::StripeObject
13+
# Open Enum. The capability which had its status updated.
14+
attr_reader :updated_capability
15+
16+
def self.inner_class_types
17+
@inner_class_types = {}
18+
end
19+
20+
def self.field_remappings
21+
@field_remappings = {}
22+
end
23+
end
24+
25+
def self.inner_class_types
26+
@inner_class_types = {
27+
data: V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData,
28+
}
29+
end
30+
attr_reader :data, :related_object
31+
32+
# Retrieves the related object from the API. Makes an API request on every call.
33+
def fetch_related_object
34+
_request(
35+
method: :get,
36+
path: related_object.url,
37+
base_address: :api,
38+
opts: { stripe_context: context }
39+
)
40+
end
41+
end
42+
43+
# Occurs when the status of an Account's customer configuration capability is updated.
44+
class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification < Stripe::V2::Core::EventNotification
45+
def self.lookup_type
46+
"v2.core.account[configuration.customer].capability_status_updated"
47+
end
48+
49+
attr_reader :related_object
50+
51+
# Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call.
52+
def fetch_related_object
53+
resp = @client.raw_request(
54+
:get,
55+
related_object.url,
56+
opts: { stripe_context: context },
57+
usage: ["fetch_related_object"]
58+
)
59+
@client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
60+
end
61+
end
62+
end
63+
end
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# File generated from our OpenAPI spec
2+
# frozen_string_literal: true
3+
4+
module Stripe
5+
module Events
6+
# Occurs when an Account's customer configuration is updated.
7+
class V2CoreAccountIncludingConfigurationCustomerUpdatedEvent < Stripe::V2::Core::Event
8+
def self.lookup_type
9+
"v2.core.account[configuration.customer].updated"
10+
end
11+
12+
# Retrieves the related object from the API. Makes an API request on every call.
13+
def fetch_related_object
14+
_request(
15+
method: :get,
16+
path: related_object.url,
17+
base_address: :api,
18+
opts: { stripe_context: context }
19+
)
20+
end
21+
attr_reader :related_object
22+
end
23+
24+
# Occurs when an Account's customer configuration is updated.
25+
class V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification < Stripe::V2::Core::EventNotification
26+
def self.lookup_type
27+
"v2.core.account[configuration.customer].updated"
28+
end
29+
30+
attr_reader :related_object
31+
32+
# Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call.
33+
def fetch_related_object
34+
resp = @client.raw_request(
35+
:get,
36+
related_object.url,
37+
opts: { stripe_context: context },
38+
usage: ["fetch_related_object"]
39+
)
40+
@client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
41+
end
42+
end
43+
end
44+
end
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# File generated from our OpenAPI spec
2+
# frozen_string_literal: true
3+
4+
module Stripe
5+
module Events
6+
# Occurs when the status of an Account's merchant configuration capability is updated.
7+
class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent < Stripe::V2::Core::Event
8+
def self.lookup_type
9+
"v2.core.account[configuration.merchant].capability_status_updated"
10+
end
11+
12+
class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData < ::Stripe::StripeObject
13+
# Open Enum. The capability which had its status updated.
14+
attr_reader :updated_capability
15+
16+
def self.inner_class_types
17+
@inner_class_types = {}
18+
end
19+
20+
def self.field_remappings
21+
@field_remappings = {}
22+
end
23+
end
24+
25+
def self.inner_class_types
26+
@inner_class_types = {
27+
data: V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData,
28+
}
29+
end
30+
attr_reader :data, :related_object
31+
32+
# Retrieves the related object from the API. Makes an API request on every call.
33+
def fetch_related_object
34+
_request(
35+
method: :get,
36+
path: related_object.url,
37+
base_address: :api,
38+
opts: { stripe_context: context }
39+
)
40+
end
41+
end
42+
43+
# Occurs when the status of an Account's merchant configuration capability is updated.
44+
class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification < Stripe::V2::Core::EventNotification
45+
def self.lookup_type
46+
"v2.core.account[configuration.merchant].capability_status_updated"
47+
end
48+
49+
attr_reader :related_object
50+
51+
# Retrieves the Account related to this EventNotification from the Stripe API. Makes an API request on every call.
52+
def fetch_related_object
53+
resp = @client.raw_request(
54+
:get,
55+
related_object.url,
56+
opts: { stripe_context: context },
57+
usage: ["fetch_related_object"]
58+
)
59+
@client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
60+
end
61+
end
62+
end
63+
end

0 commit comments

Comments
 (0)