Skip to content

Commit 0bb6400

Browse files
feat(api): api update (#237)
1 parent 8cf1bc4 commit 0bb6400

File tree

77 files changed

+14097
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+14097
-133
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 103
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-95a3d7780935a38e0cf076d4ad2d68bd1a5641bced8398d972db2e92751d364a.yml
3-
openapi_spec_hash: 9ebe818c4ad4f2d9c4e473b5192d7544
4-
config_hash: 54edf41f0377bc235f622fdaa7405f22
1+
configured_endpoints: 106
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-e8dad7eee5621fe2ba948dfd00dabf170d9d92ce615a9f04b0f546f4d8bf39ba.yml
3+
openapi_spec_hash: 3f6a98e3a1b3a47acebd67a960090ebf
4+
config_hash: 7e523cf79552b8936bd772f2e1025e5f

lib/orb.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@
188188
require_relative "orb/models/subscription"
189189
require_relative "orb/models/subscription_cancel_params"
190190
require_relative "orb/models/subscription_cancel_response"
191+
require_relative "orb/models/subscription_change_apply_params"
192+
require_relative "orb/models/subscription_change_apply_response"
193+
require_relative "orb/models/subscription_change_cancel_params"
194+
require_relative "orb/models/subscription_change_cancel_response"
195+
require_relative "orb/models/subscription_change_retrieve_params"
196+
require_relative "orb/models/subscription_change_retrieve_response"
191197
require_relative "orb/models/subscription_create_params"
192198
require_relative "orb/models/subscription_create_response"
193199
require_relative "orb/models/subscription_fetch_costs_params"
@@ -243,5 +249,6 @@
243249
require_relative "orb/resources/plans/external_plan_id"
244250
require_relative "orb/resources/prices"
245251
require_relative "orb/resources/prices/external_price_id"
252+
require_relative "orb/resources/subscription_changes"
246253
require_relative "orb/resources/subscriptions"
247254
require_relative "orb/resources/top_level"

lib/orb/client.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ class Client < Orb::Internal::Transport::BaseClient
6060
# @return [Orb::Resources::DimensionalPriceGroups]
6161
attr_reader :dimensional_price_groups
6262

63+
# @return [Orb::Resources::SubscriptionChanges]
64+
attr_reader :subscription_changes
65+
6366
# @api private
6467
#
6568
# @return [Hash{String=>String}]
@@ -124,6 +127,7 @@ def initialize(
124127
@subscriptions = Orb::Resources::Subscriptions.new(client: self)
125128
@alerts = Orb::Resources::Alerts.new(client: self)
126129
@dimensional_price_groups = Orb::Resources::DimensionalPriceGroups.new(client: self)
130+
@subscription_changes = Orb::Resources::SubscriptionChanges.new(client: self)
127131
end
128132
end
129133
end

lib/orb/models/invoice_create_params.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ class InvoiceCreateParams < Orb::Internal::Type::BaseModel
7171
optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true
7272

7373
# @!attribute [r] will_auto_issue
74-
# When true, this invoice will automatically be issued upon creation. When false,
75-
# the resulting invoice will require manual review to issue. Defaulted to false.
74+
# When true, this invoice will be submitted for issuance upon creation. When
75+
# false, the resulting invoice will require manual review to issue. Defaulted to
76+
# false.
7677
#
7778
# @return [Boolean, nil]
7879
optional :will_auto_issue, Orb::Internal::Type::Boolean

lib/orb/models/plan_create_params.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ class TieredConfig < Orb::Internal::Type::BaseModel
11761176

11771177
class Tier < Orb::Internal::Type::BaseModel
11781178
# @!attribute first_unit
1179-
# Inclusive tier starting value
1179+
# Exclusive tier starting value
11801180
#
11811181
# @return [Float]
11821182
required :first_unit, Float
@@ -1188,7 +1188,7 @@ class Tier < Orb::Internal::Type::BaseModel
11881188
required :unit_amount, String
11891189

11901190
# @!attribute last_unit
1191-
# Exclusive tier ending value. If null, this is treated as the last tier
1191+
# Inclusive tier ending value. If null, this is treated as the last tier
11921192
#
11931193
# @return [Float, nil]
11941194
optional :last_unit, Float, nil?: true
@@ -1478,13 +1478,13 @@ class Tier < Orb::Internal::Type::BaseModel
14781478
required :bps, Float
14791479

14801480
# @!attribute minimum_amount
1481-
# Inclusive tier starting value
1481+
# Exclusive tier starting value
14821482
#
14831483
# @return [String]
14841484
required :minimum_amount, String
14851485

14861486
# @!attribute maximum_amount
1487-
# Exclusive tier ending value
1487+
# Inclusive tier ending value
14881488
#
14891489
# @return [String, nil]
14901490
optional :maximum_amount, String, nil?: true

lib/orb/models/price.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ class TieredConfig < Orb::Internal::Type::BaseModel
18381838

18391839
class Tier < Orb::Internal::Type::BaseModel
18401840
# @!attribute first_unit
1841-
# Inclusive tier starting value
1841+
# Exclusive tier starting value
18421842
#
18431843
# @return [Float]
18441844
required :first_unit, Float
@@ -1850,7 +1850,7 @@ class Tier < Orb::Internal::Type::BaseModel
18501850
required :unit_amount, String
18511851

18521852
# @!attribute last_unit
1853-
# Exclusive tier ending value. If null, this is treated as the last tier
1853+
# Inclusive tier ending value. If null, this is treated as the last tier
18541854
#
18551855
# @return [Float, nil]
18561856
optional :last_unit, Float, nil?: true
@@ -2310,13 +2310,13 @@ class Tier < Orb::Internal::Type::BaseModel
23102310
required :bps, Float
23112311

23122312
# @!attribute minimum_amount
2313-
# Inclusive tier starting value
2313+
# Exclusive tier starting value
23142314
#
23152315
# @return [String]
23162316
required :minimum_amount, String
23172317

23182318
# @!attribute maximum_amount
2319-
# Exclusive tier ending value
2319+
# Inclusive tier ending value
23202320
#
23212321
# @return [String, nil]
23222322
optional :maximum_amount, String, nil?: true

lib/orb/models/price_create_params.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ class TieredConfig < Orb::Internal::Type::BaseModel
624624

625625
class Tier < Orb::Internal::Type::BaseModel
626626
# @!attribute first_unit
627-
# Inclusive tier starting value
627+
# Exclusive tier starting value
628628
#
629629
# @return [Float]
630630
required :first_unit, Float
@@ -636,7 +636,7 @@ class Tier < Orb::Internal::Type::BaseModel
636636
required :unit_amount, String
637637

638638
# @!attribute last_unit
639-
# Exclusive tier ending value. If null, this is treated as the last tier
639+
# Inclusive tier ending value. If null, this is treated as the last tier
640640
#
641641
# @return [Float, nil]
642642
optional :last_unit, Float, nil?: true
@@ -676,13 +676,13 @@ class Tier < Orb::Internal::Type::BaseModel
676676
required :bps, Float
677677

678678
# @!attribute minimum_amount
679-
# Inclusive tier starting value
679+
# Exclusive tier starting value
680680
#
681681
# @return [String]
682682
required :minimum_amount, String
683683

684684
# @!attribute maximum_amount
685-
# Exclusive tier ending value
685+
# Inclusive tier ending value
686686
#
687687
# @return [String, nil]
688688
optional :maximum_amount, String, nil?: true

lib/orb/models/subscription.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@ class Subscription < Orb::Internal::Type::BaseModel
154154
# @return [Integer]
155155
required :net_terms, Integer
156156

157+
# @!attribute pending_subscription_change
158+
# A pending subscription change if one exists on this subscription.
159+
#
160+
# @return [Orb::Models::Subscription::PendingSubscriptionChange, nil]
161+
required :pending_subscription_change,
162+
-> { Orb::Models::Subscription::PendingSubscriptionChange },
163+
nil?: true
164+
157165
# @!attribute plan
158166
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
159167
# subscribed to by a customer. Plans define the billing behavior of the
@@ -230,6 +238,7 @@ class Subscription < Orb::Internal::Type::BaseModel
230238
# # @param metadata [Hash{Symbol=>String}]
231239
# # @param minimum_intervals [Array<Orb::Models::Subscription::MinimumInterval>]
232240
# # @param net_terms [Integer]
241+
# # @param pending_subscription_change [Orb::Models::Subscription::PendingSubscriptionChange, nil]
233242
# # @param plan [Orb::Models::Plan]
234243
# # @param price_intervals [Array<Orb::Models::Subscription::PriceInterval>]
235244
# # @param redeemed_coupon [Orb::Models::Subscription::RedeemedCoupon, nil]
@@ -257,6 +266,7 @@ class Subscription < Orb::Internal::Type::BaseModel
257266
# metadata:,
258267
# minimum_intervals:,
259268
# net_terms:,
269+
# pending_subscription_change:,
260270
# plan:,
261271
# price_intervals:,
262272
# redeemed_coupon:,
@@ -1036,6 +1046,23 @@ class MinimumInterval < Orb::Internal::Type::BaseModel
10361046
# def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
10371047
end
10381048

1049+
# @see Orb::Models::Subscription#pending_subscription_change
1050+
class PendingSubscriptionChange < Orb::Internal::Type::BaseModel
1051+
# @!attribute id
1052+
#
1053+
# @return [String]
1054+
required :id, String
1055+
1056+
# @!parse
1057+
# # A pending subscription change if one exists on this subscription.
1058+
# #
1059+
# # @param id [String]
1060+
# #
1061+
# def initialize(id:, **) = super
1062+
1063+
# def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
1064+
end
1065+
10391066
class PriceInterval < Orb::Internal::Type::BaseModel
10401067
# @!attribute id
10411068
#

lib/orb/models/subscription_cancel_response.rb

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@ class SubscriptionCancelResponse < Orb::Internal::Type::BaseModel
154154
# @return [Integer]
155155
required :net_terms, Integer
156156

157+
# @!attribute pending_subscription_change
158+
# A pending subscription change if one exists on this subscription.
159+
#
160+
# @return [Orb::Models::SubscriptionCancelResponse::PendingSubscriptionChange, nil]
161+
required :pending_subscription_change,
162+
-> { Orb::Models::SubscriptionCancelResponse::PendingSubscriptionChange },
163+
nil?: true
164+
157165
# @!attribute plan
158166
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
159167
# subscribed to by a customer. Plans define the billing behavior of the
@@ -191,6 +199,14 @@ class SubscriptionCancelResponse < Orb::Internal::Type::BaseModel
191199
# @return [Orb::Models::SubscriptionCancelResponse::TrialInfo]
192200
required :trial_info, -> { Orb::Models::SubscriptionCancelResponse::TrialInfo }
193201

202+
# @!attribute changed_resources
203+
# The resources that were changed as part of this operation. Only present when
204+
# fetched through the subscription changes API or if the
205+
# `include_changed_resources` parameter was passed in the request.
206+
#
207+
# @return [Orb::Models::SubscriptionCancelResponse::ChangedResources, nil]
208+
optional :changed_resources, -> { Orb::Models::SubscriptionCancelResponse::ChangedResources }, nil?: true
209+
194210
# @!parse
195211
# # @param id [String]
196212
# # @param active_plan_phase_order [Integer, nil]
@@ -211,12 +227,14 @@ class SubscriptionCancelResponse < Orb::Internal::Type::BaseModel
211227
# # @param metadata [Hash{Symbol=>String}]
212228
# # @param minimum_intervals [Array<Orb::Models::SubscriptionCancelResponse::MinimumInterval>]
213229
# # @param net_terms [Integer]
230+
# # @param pending_subscription_change [Orb::Models::SubscriptionCancelResponse::PendingSubscriptionChange, nil]
214231
# # @param plan [Orb::Models::Plan]
215232
# # @param price_intervals [Array<Orb::Models::SubscriptionCancelResponse::PriceInterval>]
216233
# # @param redeemed_coupon [Orb::Models::SubscriptionCancelResponse::RedeemedCoupon, nil]
217234
# # @param start_date [Time]
218235
# # @param status [Symbol, Orb::Models::SubscriptionCancelResponse::Status]
219236
# # @param trial_info [Orb::Models::SubscriptionCancelResponse::TrialInfo]
237+
# # @param changed_resources [Orb::Models::SubscriptionCancelResponse::ChangedResources, nil]
220238
# #
221239
# def initialize(
222240
# id:,
@@ -238,12 +256,14 @@ class SubscriptionCancelResponse < Orb::Internal::Type::BaseModel
238256
# metadata:,
239257
# minimum_intervals:,
240258
# net_terms:,
259+
# pending_subscription_change:,
241260
# plan:,
242261
# price_intervals:,
243262
# redeemed_coupon:,
244263
# start_date:,
245264
# status:,
246265
# trial_info:,
266+
# changed_resources: nil,
247267
# **
248268
# )
249269
# super
@@ -1019,6 +1039,23 @@ class MinimumInterval < Orb::Internal::Type::BaseModel
10191039
# def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
10201040
end
10211041

1042+
# @see Orb::Models::SubscriptionCancelResponse#pending_subscription_change
1043+
class PendingSubscriptionChange < Orb::Internal::Type::BaseModel
1044+
# @!attribute id
1045+
#
1046+
# @return [String]
1047+
required :id, String
1048+
1049+
# @!parse
1050+
# # A pending subscription change if one exists on this subscription.
1051+
# #
1052+
# # @param id [String]
1053+
# #
1054+
# def initialize(id:, **) = super
1055+
1056+
# def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
1057+
end
1058+
10221059
class PriceInterval < Orb::Internal::Type::BaseModel
10231060
# @!attribute id
10241061
#
@@ -1215,6 +1252,47 @@ class TrialInfo < Orb::Internal::Type::BaseModel
12151252

12161253
# def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
12171254
end
1255+
1256+
# @see Orb::Models::SubscriptionCancelResponse#changed_resources
1257+
class ChangedResources < Orb::Internal::Type::BaseModel
1258+
# @!attribute created_credit_notes
1259+
# The credit notes that were created as part of this operation.
1260+
#
1261+
# @return [Array<Orb::Models::CreditNote>]
1262+
required :created_credit_notes, -> { Orb::Internal::Type::ArrayOf[Orb::Models::CreditNote] }
1263+
1264+
# @!attribute created_invoices
1265+
# The invoices that were created as part of this operation.
1266+
#
1267+
# @return [Array<Orb::Models::Invoice>]
1268+
required :created_invoices, -> { Orb::Internal::Type::ArrayOf[Orb::Models::Invoice] }
1269+
1270+
# @!attribute voided_credit_notes
1271+
# The credit notes that were voided as part of this operation.
1272+
#
1273+
# @return [Array<Orb::Models::CreditNote>]
1274+
required :voided_credit_notes, -> { Orb::Internal::Type::ArrayOf[Orb::Models::CreditNote] }
1275+
1276+
# @!attribute voided_invoices
1277+
# The invoices that were voided as part of this operation.
1278+
#
1279+
# @return [Array<Orb::Models::Invoice>]
1280+
required :voided_invoices, -> { Orb::Internal::Type::ArrayOf[Orb::Models::Invoice] }
1281+
1282+
# @!parse
1283+
# # The resources that were changed as part of this operation. Only present when
1284+
# # fetched through the subscription changes API or if the
1285+
# # `include_changed_resources` parameter was passed in the request.
1286+
# #
1287+
# # @param created_credit_notes [Array<Orb::Models::CreditNote>]
1288+
# # @param created_invoices [Array<Orb::Models::Invoice>]
1289+
# # @param voided_credit_notes [Array<Orb::Models::CreditNote>]
1290+
# # @param voided_invoices [Array<Orb::Models::Invoice>]
1291+
# #
1292+
# def initialize(created_credit_notes:, created_invoices:, voided_credit_notes:, voided_invoices:, **) = super
1293+
1294+
# def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
1295+
end
12181296
end
12191297
end
12201298
end
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# frozen_string_literal: true
2+
3+
module Orb
4+
module Models
5+
# @see Orb::Resources::SubscriptionChanges#apply
6+
class SubscriptionChangeApplyParams < Orb::Internal::Type::BaseModel
7+
# @!parse
8+
# extend Orb::Internal::Type::RequestParameters::Converter
9+
include Orb::Internal::Type::RequestParameters
10+
11+
# @!attribute description
12+
# Description to apply to the balance transaction representing this credit.
13+
#
14+
# @return [String, nil]
15+
optional :description, String, nil?: true
16+
17+
# @!attribute previously_collected_amount
18+
# Amount already collected to apply to the customer's balance.
19+
#
20+
# @return [String, nil]
21+
optional :previously_collected_amount, String, nil?: true
22+
23+
# @!parse
24+
# # @param description [String, nil]
25+
# # @param previously_collected_amount [String, nil]
26+
# # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
27+
# #
28+
# def initialize(description: nil, previously_collected_amount: nil, request_options: {}, **) = super
29+
30+
# def initialize: (Hash | Orb::Internal::Type::BaseModel) -> void
31+
end
32+
end
33+
end

0 commit comments

Comments
 (0)