Skip to content

Commit e5b51c7

Browse files
Merge pull request #1792 from stripe/latest-codegen-private-preview
Update generated code for private-preview
2 parents 56676e9 + 6ca7f90 commit e5b51c7

17 files changed

+985
-70
lines changed

CODEGEN_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
afce9794b52053b2efda64fd3af04dcf9225eafa
1+
e5a785b8374103d84e609caec05bef6deec02a76

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2169
1+
v2176

lib/stripe/params/billing/alert_create_params.rb

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,84 @@ def initialize(filters: nil, lte: nil)
115115
end
116116
end
117117

118+
class SpendThreshold < ::Stripe::RequestParams
119+
class Filters < ::Stripe::RequestParams
120+
# Filter by billable item IDs. Maximum of 20 billable items.
121+
attr_accessor :billable_items
122+
# Filter by billing cadence ID.
123+
attr_accessor :billing_cadence
124+
# Filter by pricing plan ID.
125+
attr_accessor :pricing_plan
126+
# Filter by pricing plan subscription ID.
127+
attr_accessor :pricing_plan_subscription
128+
129+
def initialize(
130+
billable_items: nil,
131+
billing_cadence: nil,
132+
pricing_plan: nil,
133+
pricing_plan_subscription: nil
134+
)
135+
@billable_items = billable_items
136+
@billing_cadence = billing_cadence
137+
@pricing_plan = pricing_plan
138+
@pricing_plan_subscription = pricing_plan_subscription
139+
end
140+
end
141+
142+
class Gte < ::Stripe::RequestParams
143+
class Amount < ::Stripe::RequestParams
144+
# Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `value` parameter.
145+
attr_accessor :currency
146+
# An integer representing the amount of the threshold.
147+
attr_accessor :value
148+
149+
def initialize(currency: nil, value: nil)
150+
@currency = currency
151+
@value = value
152+
end
153+
end
154+
155+
class CustomPricingUnit < ::Stripe::RequestParams
156+
# The ID of the custom pricing unit.
157+
attr_accessor :id
158+
# A positive decimal string representing the amount of the custom pricing unit threshold.
159+
attr_accessor :value
160+
161+
def initialize(id: nil, value: nil)
162+
@id = id
163+
@value = value
164+
end
165+
end
166+
# The monetary amount. Required when type is `amount`.
167+
attr_accessor :amount
168+
# The custom pricing unit amount. Required when type is `custom_pricing_unit`.
169+
attr_accessor :custom_pricing_unit
170+
# The type of the threshold amount.
171+
attr_accessor :type
172+
173+
def initialize(amount: nil, custom_pricing_unit: nil, type: nil)
174+
@amount = amount
175+
@custom_pricing_unit = custom_pricing_unit
176+
@type = type
177+
end
178+
end
179+
# Defines the period over which spend is aggregated.
180+
attr_accessor :aggregation_period
181+
# Filters to scope the spend calculation.
182+
attr_accessor :filters
183+
# Defines the granularity of spend aggregation. Defaults to `pricing_plan_subscription`.
184+
attr_accessor :group_by
185+
# Defines at which value the alert will fire.
186+
attr_accessor :gte
187+
188+
def initialize(aggregation_period: nil, filters: nil, group_by: nil, gte: nil)
189+
@aggregation_period = aggregation_period
190+
@filters = filters
191+
@group_by = group_by
192+
@gte = gte
193+
end
194+
end
195+
118196
class UsageThreshold < ::Stripe::RequestParams
119197
class Filter < ::Stripe::RequestParams
120198
# Limit the scope to this usage alert only to this customer.
@@ -153,19 +231,23 @@ def initialize(filters: nil, gte: nil, meter: nil, recurrence: nil)
153231
attr_accessor :title
154232
# The configuration of the usage threshold.
155233
attr_accessor :usage_threshold
234+
# The configuration of the spend threshold.
235+
attr_accessor :spend_threshold
156236

157237
def initialize(
158238
alert_type: nil,
159239
credit_balance_threshold: nil,
160240
expand: nil,
161241
title: nil,
162-
usage_threshold: nil
242+
usage_threshold: nil,
243+
spend_threshold: nil
163244
)
164245
@alert_type = alert_type
165246
@credit_balance_threshold = credit_balance_threshold
166247
@expand = expand
167248
@title = title
168249
@usage_threshold = usage_threshold
250+
@spend_threshold = spend_threshold
169251
end
170252
end
171253
end

lib/stripe/params/payment_method_update_params.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ def initialize(exp_month: nil, exp_year: nil, networks: nil)
7777
end
7878
end
7979

80+
class Custom < ::Stripe::RequestParams
81+
# A reference to an external payment method, such as a PayPal Billing Agreement ID.
82+
attr_accessor :payment_method_reference
83+
# Indicates whether the payment method supports off-session payments.
84+
attr_accessor :usage
85+
86+
def initialize(payment_method_reference: nil, usage: nil)
87+
@payment_method_reference = payment_method_reference
88+
@usage = usage
89+
end
90+
end
91+
8092
class Payto < ::Stripe::RequestParams
8193
# The account number for the bank account.
8294
attr_accessor :account_number
@@ -117,6 +129,8 @@ def initialize(account_holder_type: nil, account_type: nil)
117129
attr_accessor :payto
118130
# If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
119131
attr_accessor :us_bank_account
132+
# If this is a `custom` PaymentMethod, this hash contains details about the Custom payment method.
133+
attr_accessor :custom
120134

121135
def initialize(
122136
allow_redisplay: nil,
@@ -125,7 +139,8 @@ def initialize(
125139
expand: nil,
126140
metadata: nil,
127141
payto: nil,
128-
us_bank_account: nil
142+
us_bank_account: nil,
143+
custom: nil
129144
)
130145
@allow_redisplay = allow_redisplay
131146
@billing_details = billing_details
@@ -134,6 +149,7 @@ def initialize(
134149
@metadata = metadata
135150
@payto = payto
136151
@us_bank_account = us_bank_account
152+
@custom = custom
137153
end
138154
end
139155
end

lib/stripe/params/subscription_pause_params.rb

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,31 @@
44
module Stripe
55
class SubscriptionPauseParams < ::Stripe::RequestParams
66
class BillFor < ::Stripe::RequestParams
7-
# Controls whether to debit for accrued metered usage in the current billing period. The default is `true`.
8-
attr_accessor :outstanding_usage
9-
# Controls whether to credit for licensed items in the current billing period. The default is `true`.
10-
attr_accessor :unused_time
7+
class OutstandingUsageThrough < ::Stripe::RequestParams
8+
# When to bill metered usage in the current period.
9+
attr_accessor :type
1110

12-
def initialize(outstanding_usage: nil, unused_time: nil)
13-
@outstanding_usage = outstanding_usage
14-
@unused_time = unused_time
11+
def initialize(type: nil)
12+
@type = type
13+
end
14+
end
15+
16+
class UnusedTimeFrom < ::Stripe::RequestParams
17+
# When to credit for unused time.
18+
attr_accessor :type
19+
20+
def initialize(type: nil)
21+
@type = type
22+
end
23+
end
24+
# Controls when to bill for metered usage in the current period. Defaults to `{ type: "now" }`.
25+
attr_accessor :outstanding_usage_through
26+
# Controls when to credit for unused time on licensed items. Defaults to `{ type: "now" }`.
27+
attr_accessor :unused_time_from
28+
29+
def initialize(outstanding_usage_through: nil, unused_time_from: nil)
30+
@outstanding_usage_through = outstanding_usage_through
31+
@unused_time_from = unused_time_from
1532
end
1633
end
1734
# Controls what to bill for when pausing the subscription.

lib/stripe/params/subscription_resume_params.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,17 @@ class SubscriptionResumeParams < ::Stripe::RequestParams
1111
attr_accessor :proration_behavior
1212
# If set, prorations will be calculated as though the subscription was resumed at the given time. This can be used to apply exactly the same prorations that were previewed with the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint.
1313
attr_accessor :proration_date
14-
# Controls when the subscription transitions from `paused` to `active`. Determines how payment on the invoice affects the resumption process.The default is `pending_if_incomplete`.
15-
attr_accessor :payment_behavior
1614

1715
def initialize(
1816
billing_cycle_anchor: nil,
1917
expand: nil,
2018
proration_behavior: nil,
21-
proration_date: nil,
22-
payment_behavior: nil
19+
proration_date: nil
2320
)
2421
@billing_cycle_anchor = billing_cycle_anchor
2522
@expand = expand
2623
@proration_behavior = proration_behavior
2724
@proration_date = proration_date
28-
@payment_behavior = payment_behavior
2925
end
3026
end
3127
end

lib/stripe/resources/billing/alert.rb

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,113 @@ def self.field_remappings
144144
@field_remappings = {}
145145
end
146146
end
147+
148+
class SpendThreshold < ::Stripe::StripeObject
149+
class Filters < ::Stripe::StripeObject
150+
# Filter by billable item IDs.
151+
attr_reader :billable_items
152+
# Filter by billing cadence ID.
153+
attr_reader :billing_cadence
154+
# Filter by pricing plan ID.
155+
attr_reader :pricing_plan
156+
# Filter by pricing plan subscription ID.
157+
attr_reader :pricing_plan_subscription
158+
159+
def self.inner_class_types
160+
@inner_class_types = {}
161+
end
162+
163+
def self.field_remappings
164+
@field_remappings = {}
165+
end
166+
end
167+
168+
class Gte < ::Stripe::StripeObject
169+
class Amount < ::Stripe::StripeObject
170+
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
171+
attr_reader :currency
172+
# A positive integer representing the amount.
173+
attr_reader :value
174+
175+
def self.inner_class_types
176+
@inner_class_types = {}
177+
end
178+
179+
def self.field_remappings
180+
@field_remappings = {}
181+
end
182+
end
183+
184+
class CustomPricingUnit < ::Stripe::StripeObject
185+
class CustomPricingUnitDetails < ::Stripe::StripeObject
186+
# Time at which the object was created. Measured in seconds since the Unix epoch.
187+
attr_reader :created
188+
# The name of the custom pricing unit.
189+
attr_reader :display_name
190+
# Unique identifier for the object.
191+
attr_reader :id
192+
# A lookup key for the custom pricing unit.
193+
attr_reader :lookup_key
194+
# Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
195+
attr_reader :metadata
196+
# The status of the custom pricing unit.
197+
attr_reader :status
198+
199+
def self.inner_class_types
200+
@inner_class_types = {}
201+
end
202+
203+
def self.field_remappings
204+
@field_remappings = {}
205+
end
206+
end
207+
# The custom pricing unit object.
208+
attr_reader :custom_pricing_unit_details
209+
# Unique identifier for the object.
210+
attr_reader :id
211+
# A positive decimal string representing the amount.
212+
attr_reader :value
213+
214+
def self.inner_class_types
215+
@inner_class_types = { custom_pricing_unit_details: CustomPricingUnitDetails }
216+
end
217+
218+
def self.field_remappings
219+
@field_remappings = {}
220+
end
221+
end
222+
# The monetary amount. Present when type is `amount`.
223+
attr_reader :amount
224+
# The custom pricing unit amount. Present when type is `custom_pricing_unit`.
225+
attr_reader :custom_pricing_unit
226+
# The type of the threshold amount.
227+
attr_reader :type
228+
229+
def self.inner_class_types
230+
@inner_class_types = { amount: Amount, custom_pricing_unit: CustomPricingUnit }
231+
end
232+
233+
def self.field_remappings
234+
@field_remappings = {}
235+
end
236+
end
237+
# Defines the period over which spend is aggregated.
238+
attr_reader :aggregation_period
239+
# Filters to scope the spend calculation.
240+
attr_reader :filters
241+
# Defines the granularity of spend aggregation.
242+
attr_reader :group_by
243+
# The threshold value configuration for a spend threshold alert.
244+
attr_reader :gte
245+
246+
def self.inner_class_types
247+
@inner_class_types = { filters: Filters, gte: Gte }
248+
end
249+
250+
def self.field_remappings
251+
@field_remappings = {}
252+
end
253+
end
147254
# Defines the type of the alert.
148255
attr_reader :alert_type
149256
# Encapsulates configuration of the alert to monitor billing credit balance.
@@ -160,6 +267,8 @@ def self.field_remappings
160267
attr_reader :title
161268
# Encapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://docs.stripe.com/api/billing/meter).
162269
attr_reader :usage_threshold
270+
# Encapsulates the alert's configuration to monitor spend on pricing plan subscriptions.
271+
attr_reader :spend_threshold
163272

164273
# Reactivates this alert, allowing it to trigger again.
165274
def activate(params = {}, opts = {})
@@ -235,6 +344,7 @@ def self.inner_class_types
235344
@inner_class_types = {
236345
credit_balance_threshold: CreditBalanceThreshold,
237346
usage_threshold: UsageThreshold,
347+
spend_threshold: SpendThreshold,
238348
}
239349
end
240350

0 commit comments

Comments
 (0)