Skip to content

Commit be086a4

Browse files
feat(api): api update
1 parent 4cf9594 commit be086a4

File tree

9 files changed

+113
-31
lines changed

9 files changed

+113
-31
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-36e32afb76082ffbe12a71342ed5b855b9ae83d8c5bcd225fe23915c308b39e7.yml
3-
openapi_spec_hash: 035e0bb6141d78b4aed031303585940c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0ab0946487d1ee971683d894554494d9940010403874c0be724ffc3a82d696db.yml
3+
openapi_spec_hash: 66b792328a4faee3c7659185accc3f0e
44
config_hash: e6db17547fe854b1c240407cf4c6dc9e

lib/orb/models/new_allocation_price.rb

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,23 @@ class NewAllocationPrice < Orb::Internal::Type::BaseModel
4141
# @return [Array<Orb::Models::NewAllocationPrice::Filter>, nil]
4242
optional :filters, -> { Orb::Internal::Type::ArrayOf[Orb::NewAllocationPrice::Filter] }, nil?: true
4343

44-
# @!method initialize(amount:, cadence:, currency:, custom_expiration: nil, expires_at_end_of_cadence: nil, filters: nil)
44+
# @!attribute item_id
45+
# The item ID that line items representing charges for this allocation will be
46+
# associated with. If not provided, the default allocation item for the currency
47+
# will be used (e.g. 'Included Allocation (USD)').
48+
#
49+
# @return [String, nil]
50+
optional :item_id, String, nil?: true
51+
52+
# @!attribute per_unit_cost_basis
53+
# The (per-unit) cost basis of each created block. If non-zero, a customer will be
54+
# invoiced according to the quantity and per unit cost basis specified for the
55+
# allocation each cadence.
56+
#
57+
# @return [String, nil]
58+
optional :per_unit_cost_basis, String
59+
60+
# @!method initialize(amount:, cadence:, currency:, custom_expiration: nil, expires_at_end_of_cadence: nil, filters: nil, item_id: nil, per_unit_cost_basis: nil)
4561
# Some parameter documentations has been truncated, see
4662
# {Orb::Models::NewAllocationPrice} for more details.
4763
#
@@ -56,6 +72,10 @@ class NewAllocationPrice < Orb::Internal::Type::BaseModel
5672
# @param expires_at_end_of_cadence [Boolean, nil] Whether the allocated amount should expire at the end of the cadence or roll ove
5773
#
5874
# @param filters [Array<Orb::Models::NewAllocationPrice::Filter>, nil] The filters that determine which items the allocation applies to.
75+
#
76+
# @param item_id [String, nil] The item ID that line items representing charges for this allocation will be ass
77+
#
78+
# @param per_unit_cost_basis [String] The (per-unit) cost basis of each created block. If non-zero, a customer will be
5979

6080
# The cadence at which to allocate the amount to the customer.
6181
#

lib/orb/models/subscription_price_intervals_params.rb

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ class SubscriptionPriceIntervalsParams < Orb::Internal::Type::BaseModel
2929
optional :allow_invoice_credit_or_void, Orb::Internal::Type::Boolean, nil?: true
3030

3131
# @!attribute can_defer_billing
32-
# If true, ending an in-arrears price interval mid-cycle will defer billing the
33-
# final line itemuntil the next scheduled invoice. If false, it will be billed on
34-
# its end date. If not provided, behaviorwill follow account default.
32+
# If set, the default value to use for added/edited price intervals with an
33+
# end_date set.
3534
#
3635
# @return [Boolean, nil]
3736
optional :can_defer_billing, Orb::Internal::Type::Boolean, nil?: true
@@ -59,7 +58,7 @@ class SubscriptionPriceIntervalsParams < Orb::Internal::Type::BaseModel
5958
#
6059
# @param allow_invoice_credit_or_void [Boolean, nil] If false, this request will fail if it would void an issued invoice or create a
6160
#
62-
# @param can_defer_billing [Boolean, nil] If true, ending an in-arrears price interval mid-cycle will defer billing the fi
61+
# @param can_defer_billing [Boolean, nil] If set, the default value to use for added/edited price intervals with an end_da
6362
#
6463
# @param edit [Array<Orb::Models::SubscriptionPriceIntervalsParams::Edit>] A list of price intervals to edit on the subscription.
6564
#
@@ -81,6 +80,14 @@ class Add < Orb::Internal::Type::BaseModel
8180
# @return [Orb::Models::NewAllocationPrice, nil]
8281
optional :allocation_price, -> { Orb::NewAllocationPrice }, nil?: true
8382

83+
# @!attribute can_defer_billing
84+
# If true, an in-arrears price interval ending mid-cycle will defer billing the
85+
# final line item until the next scheduled invoice. If false, it will be billed on
86+
# its end date.
87+
#
88+
# @return [Boolean, nil]
89+
optional :can_defer_billing, Orb::Internal::Type::Boolean, nil?: true
90+
8491
# @!attribute discounts
8592
# A list of discounts to initialize on the price interval.
8693
#
@@ -160,14 +167,16 @@ class Add < Orb::Internal::Type::BaseModel
160167
# @return [Array<String>, nil]
161168
optional :usage_customer_ids, Orb::Internal::Type::ArrayOf[String], nil?: true
162169

163-
# @!method initialize(start_date:, allocation_price: nil, discounts: nil, end_date: nil, external_price_id: nil, filter: nil, fixed_fee_quantity_transitions: nil, maximum_amount: nil, minimum_amount: nil, price: nil, price_id: nil, usage_customer_ids: nil)
170+
# @!method initialize(start_date:, allocation_price: nil, can_defer_billing: nil, discounts: nil, end_date: nil, external_price_id: nil, filter: nil, fixed_fee_quantity_transitions: nil, maximum_amount: nil, minimum_amount: nil, price: nil, price_id: nil, usage_customer_ids: nil)
164171
# Some parameter documentations has been truncated, see
165172
# {Orb::Models::SubscriptionPriceIntervalsParams::Add} for more details.
166173
#
167174
# @param start_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate] The start date of the price interval. This is the date that the price will start
168175
#
169176
# @param allocation_price [Orb::Models::NewAllocationPrice, nil] The definition of a new allocation price to create and add to the subscription.
170177
#
178+
# @param can_defer_billing [Boolean, nil] If true, an in-arrears price interval ending mid-cycle will defer billing the fi
179+
#
171180
# @param discounts [Array<Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::Amount, Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::Percentage, Orb::Models::SubscriptionPriceIntervalsParams::Add::Discount::Usage>, nil] A list of discounts to initialize on the price interval.
172181
#
173182
# @param end_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] The end date of the price interval. This is the date that the price will stop bi
@@ -1590,9 +1599,9 @@ class Edit < Orb::Internal::Type::BaseModel
15901599
optional :billing_cycle_day, Integer, nil?: true
15911600

15921601
# @!attribute can_defer_billing
1593-
# If true, ending an in-arrears price interval mid-cycle will defer billing the
1602+
# If true, an in-arrears price interval ending mid-cycle will defer billing the
15941603
# final line item until the next scheduled invoice. If false, it will be billed on
1595-
# its end date. If not provided, behavior will follow account default.
1604+
# its end date.
15961605
#
15971606
# @return [Boolean, nil]
15981607
optional :can_defer_billing, Orb::Internal::Type::Boolean, nil?: true
@@ -1651,7 +1660,7 @@ class Edit < Orb::Internal::Type::BaseModel
16511660
#
16521661
# @param billing_cycle_day [Integer, nil] The updated billing cycle day for this price interval. If not specified, the bil
16531662
#
1654-
# @param can_defer_billing [Boolean, nil] If true, ending an in-arrears price interval mid-cycle will defer billing the fi
1663+
# @param can_defer_billing [Boolean, nil] If true, an in-arrears price interval ending mid-cycle will defer billing the fi
16551664
#
16561665
# @param end_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] The updated end date of this price interval. If not specified, the end date will
16571666
#

lib/orb/resources/subscriptions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ def fetch_usage(subscription_id, params = {})
966966
#
967967
# @param allow_invoice_credit_or_void [Boolean, nil] If false, this request will fail if it would void an issued invoice or create a
968968
#
969-
# @param can_defer_billing [Boolean, nil] If true, ending an in-arrears price interval mid-cycle will defer billing the fi
969+
# @param can_defer_billing [Boolean, nil] If set, the default value to use for added/edited price intervals with an end_da
970970
#
971971
# @param edit [Array<Orb::Models::SubscriptionPriceIntervalsParams::Edit>] A list of price intervals to edit on the subscription.
972972
#

rbi/orb/models/new_allocation_price.rbi

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,31 @@ module Orb
3737
sig { returns(T.nilable(T::Array[Orb::NewAllocationPrice::Filter])) }
3838
attr_accessor :filters
3939

40+
# The item ID that line items representing charges for this allocation will be
41+
# associated with. If not provided, the default allocation item for the currency
42+
# will be used (e.g. 'Included Allocation (USD)').
43+
sig { returns(T.nilable(String)) }
44+
attr_accessor :item_id
45+
46+
# The (per-unit) cost basis of each created block. If non-zero, a customer will be
47+
# invoiced according to the quantity and per unit cost basis specified for the
48+
# allocation each cadence.
49+
sig { returns(T.nilable(String)) }
50+
attr_reader :per_unit_cost_basis
51+
52+
sig { params(per_unit_cost_basis: String).void }
53+
attr_writer :per_unit_cost_basis
54+
4055
sig do
4156
params(
4257
amount: String,
4358
cadence: Orb::NewAllocationPrice::Cadence::OrSymbol,
4459
currency: String,
4560
custom_expiration: T.nilable(Orb::CustomExpiration::OrHash),
4661
expires_at_end_of_cadence: T.nilable(T::Boolean),
47-
filters: T.nilable(T::Array[Orb::NewAllocationPrice::Filter::OrHash])
62+
filters: T.nilable(T::Array[Orb::NewAllocationPrice::Filter::OrHash]),
63+
item_id: T.nilable(String),
64+
per_unit_cost_basis: String
4865
).returns(T.attached_class)
4966
end
5067
def self.new(
@@ -61,7 +78,15 @@ module Orb
6178
# over to the next period. Set to null if using custom_expiration.
6279
expires_at_end_of_cadence: nil,
6380
# The filters that determine which items the allocation applies to.
64-
filters: nil
81+
filters: nil,
82+
# The item ID that line items representing charges for this allocation will be
83+
# associated with. If not provided, the default allocation item for the currency
84+
# will be used (e.g. 'Included Allocation (USD)').
85+
item_id: nil,
86+
# The (per-unit) cost basis of each created block. If non-zero, a customer will be
87+
# invoiced according to the quantity and per unit cost basis specified for the
88+
# allocation each cadence.
89+
per_unit_cost_basis: nil
6590
)
6691
end
6792

@@ -73,7 +98,9 @@ module Orb
7398
currency: String,
7499
custom_expiration: T.nilable(Orb::CustomExpiration),
75100
expires_at_end_of_cadence: T.nilable(T::Boolean),
76-
filters: T.nilable(T::Array[Orb::NewAllocationPrice::Filter])
101+
filters: T.nilable(T::Array[Orb::NewAllocationPrice::Filter]),
102+
item_id: T.nilable(String),
103+
per_unit_cost_basis: String
77104
}
78105
)
79106
end

rbi/orb/models/subscription_price_intervals_params.rbi

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ module Orb
5050
sig { returns(T.nilable(T::Boolean)) }
5151
attr_accessor :allow_invoice_credit_or_void
5252

53-
# If true, ending an in-arrears price interval mid-cycle will defer billing the
54-
# final line itemuntil the next scheduled invoice. If false, it will be billed on
55-
# its end date. If not provided, behaviorwill follow account default.
53+
# If set, the default value to use for added/edited price intervals with an
54+
# end_date set.
5655
sig { returns(T.nilable(T::Boolean)) }
5756
attr_accessor :can_defer_billing
5857

@@ -117,9 +116,8 @@ module Orb
117116
# credit note. Consider using this as a safety mechanism if you do not expect
118117
# existing invoices to be changed.
119118
allow_invoice_credit_or_void: nil,
120-
# If true, ending an in-arrears price interval mid-cycle will defer billing the
121-
# final line itemuntil the next scheduled invoice. If false, it will be billed on
122-
# its end date. If not provided, behaviorwill follow account default.
119+
# If set, the default value to use for added/edited price intervals with an
120+
# end_date set.
123121
can_defer_billing: nil,
124122
# A list of price intervals to edit on the subscription.
125123
edit: nil,
@@ -172,6 +170,12 @@ module Orb
172170
end
173171
attr_writer :allocation_price
174172

173+
# If true, an in-arrears price interval ending mid-cycle will defer billing the
174+
# final line item until the next scheduled invoice. If false, it will be billed on
175+
# its end date.
176+
sig { returns(T.nilable(T::Boolean)) }
177+
attr_accessor :can_defer_billing
178+
175179
# A list of discounts to initialize on the price interval.
176180
sig do
177181
returns(
@@ -289,6 +293,7 @@ module Orb
289293
params(
290294
start_date: T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol),
291295
allocation_price: T.nilable(Orb::NewAllocationPrice::OrHash),
296+
can_defer_billing: T.nilable(T::Boolean),
292297
discounts:
293298
T.nilable(
294299
T::Array[
@@ -357,6 +362,10 @@ module Orb
357362
start_date:,
358363
# The definition of a new allocation price to create and add to the subscription.
359364
allocation_price: nil,
365+
# If true, an in-arrears price interval ending mid-cycle will defer billing the
366+
# final line item until the next scheduled invoice. If false, it will be billed on
367+
# its end date.
368+
can_defer_billing: nil,
360369
# A list of discounts to initialize on the price interval.
361370
discounts: nil,
362371
# The end date of the price interval. This is the date that the price will stop
@@ -396,6 +405,7 @@ module Orb
396405
{
397406
start_date: T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol),
398407
allocation_price: T.nilable(Orb::NewAllocationPrice),
408+
can_defer_billing: T.nilable(T::Boolean),
399409
discounts:
400410
T.nilable(
401411
T::Array[
@@ -2798,9 +2808,9 @@ module Orb
27982808
sig { returns(T.nilable(Integer)) }
27992809
attr_accessor :billing_cycle_day
28002810

2801-
# If true, ending an in-arrears price interval mid-cycle will defer billing the
2811+
# If true, an in-arrears price interval ending mid-cycle will defer billing the
28022812
# final line item until the next scheduled invoice. If false, it will be billed on
2803-
# its end date. If not provided, behavior will follow account default.
2813+
# its end date.
28042814
sig { returns(T.nilable(T::Boolean)) }
28052815
attr_accessor :can_defer_billing
28062816

@@ -2884,9 +2894,9 @@ module Orb
28842894
# billing cycle day will not be updated. Note that overlapping price intervals
28852895
# must have the same billing cycle day.
28862896
billing_cycle_day: nil,
2887-
# If true, ending an in-arrears price interval mid-cycle will defer billing the
2897+
# If true, an in-arrears price interval ending mid-cycle will defer billing the
28882898
# final line item until the next scheduled invoice. If false, it will be billed on
2889-
# its end date. If not provided, behavior will follow account default.
2899+
# its end date.
28902900
can_defer_billing: nil,
28912901
# The updated end date of this price interval. If not specified, the end date will
28922902
# not be updated.

rbi/orb/resources/subscriptions.rbi

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,9 +1002,8 @@ module Orb
10021002
# credit note. Consider using this as a safety mechanism if you do not expect
10031003
# existing invoices to be changed.
10041004
allow_invoice_credit_or_void: nil,
1005-
# If true, ending an in-arrears price interval mid-cycle will defer billing the
1006-
# final line itemuntil the next scheduled invoice. If false, it will be billed on
1007-
# its end date. If not provided, behaviorwill follow account default.
1005+
# If set, the default value to use for added/edited price intervals with an
1006+
# end_date set.
10081007
can_defer_billing: nil,
10091008
# A list of price intervals to edit on the subscription.
10101009
edit: nil,

sig/orb/models/new_allocation_price.rbs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ module Orb
77
currency: String,
88
custom_expiration: Orb::CustomExpiration?,
99
expires_at_end_of_cadence: bool?,
10-
filters: ::Array[Orb::NewAllocationPrice::Filter]?
10+
filters: ::Array[Orb::NewAllocationPrice::Filter]?,
11+
item_id: String?,
12+
per_unit_cost_basis: String
1113
}
1214

1315
class NewAllocationPrice < Orb::Internal::Type::BaseModel
@@ -23,13 +25,21 @@ module Orb
2325

2426
attr_accessor filters: ::Array[Orb::NewAllocationPrice::Filter]?
2527

28+
attr_accessor item_id: String?
29+
30+
attr_reader per_unit_cost_basis: String?
31+
32+
def per_unit_cost_basis=: (String) -> String
33+
2634
def initialize: (
2735
amount: String,
2836
cadence: Orb::Models::NewAllocationPrice::cadence,
2937
currency: String,
3038
?custom_expiration: Orb::CustomExpiration?,
3139
?expires_at_end_of_cadence: bool?,
32-
?filters: ::Array[Orb::NewAllocationPrice::Filter]?
40+
?filters: ::Array[Orb::NewAllocationPrice::Filter]?,
41+
?item_id: String?,
42+
?per_unit_cost_basis: String
3343
) -> void
3444

3545
def to_hash: -> {
@@ -38,7 +48,9 @@ module Orb
3848
currency: String,
3949
custom_expiration: Orb::CustomExpiration?,
4050
expires_at_end_of_cadence: bool?,
41-
filters: ::Array[Orb::NewAllocationPrice::Filter]?
51+
filters: ::Array[Orb::NewAllocationPrice::Filter]?,
52+
item_id: String?,
53+
per_unit_cost_basis: String
4254
}
4355

4456
type cadence = :one_time | :monthly | :quarterly | :semi_annual | :annual

sig/orb/models/subscription_price_intervals_params.rbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ module Orb
6767
{
6868
start_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::start_date,
6969
allocation_price: Orb::NewAllocationPrice?,
70+
can_defer_billing: bool?,
7071
discounts: ::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::discount]?,
7172
end_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::end_date?,
7273
external_price_id: String?,
@@ -84,6 +85,8 @@ module Orb
8485

8586
attr_accessor allocation_price: Orb::NewAllocationPrice?
8687

88+
attr_accessor can_defer_billing: bool?
89+
8790
attr_accessor discounts: ::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::discount]?
8891

8992
attr_accessor end_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::end_date?
@@ -107,6 +110,7 @@ module Orb
107110
def initialize: (
108111
start_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::start_date,
109112
?allocation_price: Orb::NewAllocationPrice?,
113+
?can_defer_billing: bool?,
110114
?discounts: ::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::discount]?,
111115
?end_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::end_date?,
112116
?external_price_id: String?,
@@ -122,6 +126,7 @@ module Orb
122126
def to_hash: -> {
123127
start_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::start_date,
124128
allocation_price: Orb::NewAllocationPrice?,
129+
can_defer_billing: bool?,
125130
discounts: ::Array[Orb::Models::SubscriptionPriceIntervalsParams::Add::discount]?,
126131
end_date: Orb::Models::SubscriptionPriceIntervalsParams::Add::end_date?,
127132
external_price_id: String?,

0 commit comments

Comments
 (0)