Skip to content

Commit 455c9c1

Browse files
feat(api): api update
1 parent 89f6a24 commit 455c9c1

16 files changed

+160
-20
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-5b9152241ebdd0d2f3fd536784f33721d24a5c4a59e75cab366a3dcb36552d3d.yml
3-
openapi_spec_hash: b40061d10bbe1ebab8998bddd1827cf8
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-f2b97a2c3e41f618dc8955ed325092320ff2170a7d7a9a26a31dc235c969b657.yml
3+
openapi_spec_hash: 64548564dc8ce80ef3ad38fc8cb56b30
44
config_hash: dd4343ce95871032ef6e0735a4ca038c

lib/orb/models/price_interval.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ class PriceInterval < Orb::Internal::Type::BaseModel
1414
# @return [Integer]
1515
required :billing_cycle_day, Integer
1616

17+
# @!attribute can_defer_billing
18+
# For in-arrears prices. If true, and the price interval ends mid-cycle, the final
19+
# line item will be deferred to the next scheduled invoice instead of being billed
20+
# mid-cycle.
21+
#
22+
# @return [Boolean]
23+
required :can_defer_billing, Orb::Internal::Type::Boolean
24+
1725
# @!attribute current_billing_period_end_date
1826
# The end of the current billing period. This is an exclusive timestamp, such that
1927
# the instant returned is exactly the end of the billing period. Set to null if
@@ -81,7 +89,7 @@ class PriceInterval < Orb::Internal::Type::BaseModel
8189
# @return [Array<String>, nil]
8290
required :usage_customer_ids, Orb::Internal::Type::ArrayOf[String], nil?: true
8391

84-
# @!method initialize(id:, billing_cycle_day:, current_billing_period_end_date:, current_billing_period_start_date:, end_date:, filter:, fixed_fee_quantity_transitions:, price:, start_date:, usage_customer_ids:)
92+
# @!method initialize(id:, billing_cycle_day:, can_defer_billing:, current_billing_period_end_date:, current_billing_period_start_date:, end_date:, filter:, fixed_fee_quantity_transitions:, price:, start_date:, usage_customer_ids:)
8593
# Some parameter documentations has been truncated, see
8694
# {Orb::Models::PriceInterval} for more details.
8795
#
@@ -93,6 +101,8 @@ class PriceInterval < Orb::Internal::Type::BaseModel
93101
#
94102
# @param billing_cycle_day [Integer] The day of the month that Orb bills for this price
95103
#
104+
# @param can_defer_billing [Boolean] For in-arrears prices. If true, and the price interval ends mid-cycle, the final
105+
#
96106
# @param current_billing_period_end_date [Time, nil] The end of the current billing period. This is an exclusive timestamp, such that
97107
#
98108
# @param current_billing_period_start_date [Time, nil] The start date of the current billing period. This is an inclusive timestamp; th

lib/orb/models/subscription_price_intervals_params.rb

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ class SubscriptionPriceIntervalsParams < Orb::Internal::Type::BaseModel
2828
# @return [Boolean, nil]
2929
optional :allow_invoice_credit_or_void, Orb::Internal::Type::Boolean, nil?: true
3030

31+
# @!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.
35+
#
36+
# @return [Boolean, nil]
37+
optional :can_defer_billing, Orb::Internal::Type::Boolean, nil?: true
38+
3139
# @!attribute edit
3240
# A list of price intervals to edit on the subscription.
3341
#
@@ -41,7 +49,7 @@ class SubscriptionPriceIntervalsParams < Orb::Internal::Type::BaseModel
4149
optional :edit_adjustments,
4250
-> { Orb::Internal::Type::ArrayOf[Orb::SubscriptionPriceIntervalsParams::EditAdjustment] }
4351

44-
# @!method initialize(add: nil, add_adjustments: nil, allow_invoice_credit_or_void: nil, edit: nil, edit_adjustments: nil, request_options: {})
52+
# @!method initialize(add: nil, add_adjustments: nil, allow_invoice_credit_or_void: nil, can_defer_billing: nil, edit: nil, edit_adjustments: nil, request_options: {})
4553
# Some parameter documentations has been truncated, see
4654
# {Orb::Models::SubscriptionPriceIntervalsParams} for more details.
4755
#
@@ -51,6 +59,8 @@ class SubscriptionPriceIntervalsParams < Orb::Internal::Type::BaseModel
5159
#
5260
# @param allow_invoice_credit_or_void [Boolean, nil] If false, this request will fail if it would void an issued invoice or create a
5361
#
62+
# @param can_defer_billing [Boolean, nil] If true, ending an in-arrears price interval mid-cycle will defer billing the fi
63+
#
5464
# @param edit [Array<Orb::Models::SubscriptionPriceIntervalsParams::Edit>] A list of price intervals to edit on the subscription.
5565
#
5666
# @param edit_adjustments [Array<Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment>] A list of adjustments to edit on the subscription.
@@ -1361,6 +1371,14 @@ class Edit < Orb::Internal::Type::BaseModel
13611371
# @return [Integer, nil]
13621372
optional :billing_cycle_day, Integer, nil?: true
13631373

1374+
# @!attribute can_defer_billing
1375+
# If true, ending an in-arrears price interval mid-cycle will defer billing the
1376+
# final line itemuntil the next scheduled invoice. If false, it will be billed on
1377+
# its end date. If not provided, behaviorwill follow account default.
1378+
#
1379+
# @return [Boolean, nil]
1380+
optional :can_defer_billing, Orb::Internal::Type::Boolean, nil?: true
1381+
13641382
# @!attribute end_date
13651383
# The updated end date of this price interval. If not specified, the end date will
13661384
# not be updated.
@@ -1407,14 +1425,16 @@ class Edit < Orb::Internal::Type::BaseModel
14071425
# @return [Array<String>, nil]
14081426
optional :usage_customer_ids, Orb::Internal::Type::ArrayOf[String], nil?: true
14091427

1410-
# @!method initialize(price_interval_id:, billing_cycle_day: nil, end_date: nil, filter: nil, fixed_fee_quantity_transitions: nil, start_date: nil, usage_customer_ids: nil)
1428+
# @!method initialize(price_interval_id:, billing_cycle_day: nil, can_defer_billing: nil, end_date: nil, filter: nil, fixed_fee_quantity_transitions: nil, start_date: nil, usage_customer_ids: nil)
14111429
# Some parameter documentations has been truncated, see
14121430
# {Orb::Models::SubscriptionPriceIntervalsParams::Edit} for more details.
14131431
#
14141432
# @param price_interval_id [String] The id of the price interval to edit.
14151433
#
14161434
# @param billing_cycle_day [Integer, nil] The updated billing cycle day for this price interval. If not specified, the bil
14171435
#
1436+
# @param can_defer_billing [Boolean, nil] If true, ending an in-arrears price interval mid-cycle will defer billing the fi
1437+
#
14181438
# @param end_date [Time, Symbol, Orb::Models::BillingCycleRelativeDate, nil] The updated end date of this price interval. If not specified, the end date will
14191439
#
14201440
# @param filter [String, nil] An additional filter to apply to usage queries. This filter must be expressed as

lib/orb/models/tiered_config.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@ class TieredConfig < Orb::Internal::Type::BaseModel
99
# @return [Array<Orb::Models::Tier>]
1010
required :tiers, -> { Orb::Internal::Type::ArrayOf[Orb::Tier] }
1111

12-
# @!method initialize(tiers:)
12+
# @!attribute prorated
13+
# If true, subtotals from this price are prorated based on the service period
14+
#
15+
# @return [Boolean, nil]
16+
optional :prorated, Orb::Internal::Type::Boolean
17+
18+
# @!method initialize(tiers:, prorated: nil)
1319
# Configuration for tiered pricing
1420
#
1521
# @param tiers [Array<Orb::Models::Tier>] Tiers for rating based on total usage quantities into the specified tier
22+
#
23+
# @param prorated [Boolean] If true, subtotals from this price are prorated based on the service period
1624
end
1725
end
1826
end

lib/orb/models/unit_config.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@ class UnitConfig < Orb::Internal::Type::BaseModel
99
# @return [String]
1010
required :unit_amount, String
1111

12-
# @!method initialize(unit_amount:)
12+
# @!attribute prorated
13+
# If true, subtotals from this price are prorated based on the service period
14+
#
15+
# @return [Boolean, nil]
16+
optional :prorated, Orb::Internal::Type::Boolean
17+
18+
# @!method initialize(unit_amount:, prorated: nil)
1319
# Configuration for unit pricing
1420
#
1521
# @param unit_amount [String] Rate per unit of usage
22+
#
23+
# @param prorated [Boolean] If true, subtotals from this price are prorated based on the service period
1624
end
1725
end
1826
end

lib/orb/resources/subscriptions.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ def fetch_usage(subscription_id, params = {})
956956
# `fixed_fee_quantity_transitions` property on a subscription’s serialized price
957957
# intervals.
958958
#
959-
# @overload price_intervals(subscription_id, add: nil, add_adjustments: nil, allow_invoice_credit_or_void: nil, edit: nil, edit_adjustments: nil, request_options: {})
959+
# @overload price_intervals(subscription_id, add: nil, add_adjustments: nil, allow_invoice_credit_or_void: nil, can_defer_billing: nil, edit: nil, edit_adjustments: nil, request_options: {})
960960
#
961961
# @param subscription_id [String]
962962
#
@@ -966,6 +966,8 @@ 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
970+
#
969971
# @param edit [Array<Orb::Models::SubscriptionPriceIntervalsParams::Edit>] A list of price intervals to edit on the subscription.
970972
#
971973
# @param edit_adjustments [Array<Orb::Models::SubscriptionPriceIntervalsParams::EditAdjustment>] A list of adjustments to edit on the subscription.

rbi/orb/models/price_interval.rbi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ module Orb
1313
sig { returns(Integer) }
1414
attr_accessor :billing_cycle_day
1515

16+
# For in-arrears prices. If true, and the price interval ends mid-cycle, the final
17+
# line item will be deferred to the next scheduled invoice instead of being billed
18+
# mid-cycle.
19+
sig { returns(T::Boolean) }
20+
attr_accessor :can_defer_billing
21+
1622
# The end of the current billing period. This is an exclusive timestamp, such that
1723
# the instant returned is exactly the end of the billing period. Set to null if
1824
# this price interval is not currently active.
@@ -69,6 +75,7 @@ module Orb
6975
params(
7076
id: String,
7177
billing_cycle_day: Integer,
78+
can_defer_billing: T::Boolean,
7279
current_billing_period_end_date: T.nilable(Time),
7380
current_billing_period_start_date: T.nilable(Time),
7481
end_date: T.nilable(Time),
@@ -116,6 +123,10 @@ module Orb
116123
id:,
117124
# The day of the month that Orb bills for this price
118125
billing_cycle_day:,
126+
# For in-arrears prices. If true, and the price interval ends mid-cycle, the final
127+
# line item will be deferred to the next scheduled invoice instead of being billed
128+
# mid-cycle.
129+
can_defer_billing:,
119130
# The end of the current billing period. This is an exclusive timestamp, such that
120131
# the instant returned is exactly the end of the billing period. Set to null if
121132
# this price interval is not currently active.
@@ -157,6 +168,7 @@ module Orb
157168
{
158169
id: String,
159170
billing_cycle_day: Integer,
171+
can_defer_billing: T::Boolean,
160172
current_billing_period_end_date: T.nilable(Time),
161173
current_billing_period_start_date: T.nilable(Time),
162174
end_date: T.nilable(Time),

rbi/orb/models/subscription_price_intervals_params.rbi

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ 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.
56+
sig { returns(T.nilable(T::Boolean)) }
57+
attr_accessor :can_defer_billing
58+
5359
# A list of price intervals to edit on the subscription.
5460
sig do
5561
returns(
@@ -93,6 +99,7 @@ module Orb
9399
Orb::SubscriptionPriceIntervalsParams::AddAdjustment::OrHash
94100
],
95101
allow_invoice_credit_or_void: T.nilable(T::Boolean),
102+
can_defer_billing: T.nilable(T::Boolean),
96103
edit: T::Array[Orb::SubscriptionPriceIntervalsParams::Edit::OrHash],
97104
edit_adjustments:
98105
T::Array[
@@ -110,6 +117,10 @@ module Orb
110117
# credit note. Consider using this as a safety mechanism if you do not expect
111118
# existing invoices to be changed.
112119
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.
123+
can_defer_billing: nil,
113124
# A list of price intervals to edit on the subscription.
114125
edit: nil,
115126
# A list of adjustments to edit on the subscription.
@@ -125,6 +136,7 @@ module Orb
125136
add_adjustments:
126137
T::Array[Orb::SubscriptionPriceIntervalsParams::AddAdjustment],
127138
allow_invoice_credit_or_void: T.nilable(T::Boolean),
139+
can_defer_billing: T.nilable(T::Boolean),
128140
edit: T::Array[Orb::SubscriptionPriceIntervalsParams::Edit],
129141
edit_adjustments:
130142
T::Array[Orb::SubscriptionPriceIntervalsParams::EditAdjustment],
@@ -2419,6 +2431,12 @@ module Orb
24192431
sig { returns(T.nilable(Integer)) }
24202432
attr_accessor :billing_cycle_day
24212433

2434+
# If true, ending an in-arrears price interval mid-cycle will defer billing the
2435+
# final line itemuntil the next scheduled invoice. If false, it will be billed on
2436+
# its end date. If not provided, behaviorwill follow account default.
2437+
sig { returns(T.nilable(T::Boolean)) }
2438+
attr_accessor :can_defer_billing
2439+
24222440
# The updated end date of this price interval. If not specified, the end date will
24232441
# not be updated.
24242442
sig do
@@ -2478,6 +2496,7 @@ module Orb
24782496
params(
24792497
price_interval_id: String,
24802498
billing_cycle_day: T.nilable(Integer),
2499+
can_defer_billing: T.nilable(T::Boolean),
24812500
end_date:
24822501
T.nilable(T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol)),
24832502
filter: T.nilable(String),
@@ -2498,6 +2517,10 @@ module Orb
24982517
# billing cycle day will not be updated. Note that overlapping price intervals
24992518
# must have the same billing cycle day.
25002519
billing_cycle_day: nil,
2520+
# If true, ending an in-arrears price interval mid-cycle will defer billing the
2521+
# final line itemuntil the next scheduled invoice. If false, it will be billed on
2522+
# its end date. If not provided, behaviorwill follow account default.
2523+
can_defer_billing: nil,
25012524
# The updated end date of this price interval. If not specified, the end date will
25022525
# not be updated.
25032526
end_date: nil,
@@ -2528,6 +2551,7 @@ module Orb
25282551
{
25292552
price_interval_id: String,
25302553
billing_cycle_day: T.nilable(Integer),
2554+
can_defer_billing: T.nilable(T::Boolean),
25312555
end_date:
25322556
T.nilable(T.any(Time, Orb::BillingCycleRelativeDate::OrSymbol)),
25332557
filter: T.nilable(String),

rbi/orb/models/tiered_config.rbi

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,31 @@ module Orb
99
sig { returns(T::Array[Orb::Tier]) }
1010
attr_accessor :tiers
1111

12+
# If true, subtotals from this price are prorated based on the service period
13+
sig { returns(T.nilable(T::Boolean)) }
14+
attr_reader :prorated
15+
16+
sig { params(prorated: T::Boolean).void }
17+
attr_writer :prorated
18+
1219
# Configuration for tiered pricing
1320
sig do
14-
params(tiers: T::Array[Orb::Tier::OrHash]).returns(T.attached_class)
21+
params(
22+
tiers: T::Array[Orb::Tier::OrHash],
23+
prorated: T::Boolean
24+
).returns(T.attached_class)
1525
end
1626
def self.new(
1727
# Tiers for rating based on total usage quantities into the specified tier
18-
tiers:
28+
tiers:,
29+
# If true, subtotals from this price are prorated based on the service period
30+
prorated: nil
1931
)
2032
end
2133

22-
sig { override.returns({ tiers: T::Array[Orb::Tier] }) }
34+
sig do
35+
override.returns({ tiers: T::Array[Orb::Tier], prorated: T::Boolean })
36+
end
2337
def to_hash
2438
end
2539
end

rbi/orb/models/unit_config.rbi

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,28 @@ module Orb
99
sig { returns(String) }
1010
attr_accessor :unit_amount
1111

12+
# If true, subtotals from this price are prorated based on the service period
13+
sig { returns(T.nilable(T::Boolean)) }
14+
attr_reader :prorated
15+
16+
sig { params(prorated: T::Boolean).void }
17+
attr_writer :prorated
18+
1219
# Configuration for unit pricing
13-
sig { params(unit_amount: String).returns(T.attached_class) }
20+
sig do
21+
params(unit_amount: String, prorated: T::Boolean).returns(
22+
T.attached_class
23+
)
24+
end
1425
def self.new(
1526
# Rate per unit of usage
16-
unit_amount:
27+
unit_amount:,
28+
# If true, subtotals from this price are prorated based on the service period
29+
prorated: nil
1730
)
1831
end
1932

20-
sig { override.returns({ unit_amount: String }) }
33+
sig { override.returns({ unit_amount: String, prorated: T::Boolean }) }
2134
def to_hash
2235
end
2336
end

0 commit comments

Comments
 (0)