Skip to content

Commit cb1cc2c

Browse files
feat(api): api update
1 parent 0b5d352 commit cb1cc2c

File tree

218 files changed

+294842
-14893
lines changed

Some content is hidden

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

218 files changed

+294842
-14893
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: 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: f6da12790e8f46d93592def474d41c69
1+
configured_endpoints: 113
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c697450a215fdbd1a854d26381ce137b222726c3e6669a93afb1c0c5669906ca.yml
3+
openapi_spec_hash: b8b5388292baa73b5f2c686d4904ae45
4+
config_hash: 0e33d6c596feab76cb4df5d64f28350b

lib/orb.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
require_relative "orb/models/invoice_update_params"
157157
require_relative "orb/models/invoice_void_params"
158158
require_relative "orb/models/item"
159+
require_relative "orb/models/item_archive_params"
159160
require_relative "orb/models/item_create_params"
160161
require_relative "orb/models/item_fetch_params"
161162
require_relative "orb/models/item_list_params"
@@ -170,8 +171,18 @@
170171
require_relative "orb/models/plan_create_params"
171172
require_relative "orb/models/plan_fetch_params"
172173
require_relative "orb/models/plan_list_params"
174+
require_relative "orb/models/plans/external_plan_id/version_create_params"
175+
require_relative "orb/models/plans/external_plan_id/version_create_response"
176+
require_relative "orb/models/plans/external_plan_id/version_retrieve_params"
177+
require_relative "orb/models/plans/external_plan_id/version_retrieve_response"
173178
require_relative "orb/models/plans/external_plan_id_fetch_params"
179+
require_relative "orb/models/plans/external_plan_id_set_default_version_params"
174180
require_relative "orb/models/plans/external_plan_id_update_params"
181+
require_relative "orb/models/plans/version_create_params"
182+
require_relative "orb/models/plans/version_create_response"
183+
require_relative "orb/models/plans/version_retrieve_params"
184+
require_relative "orb/models/plans/version_retrieve_response"
185+
require_relative "orb/models/plan_set_default_version_params"
175186
require_relative "orb/models/plan_update_params"
176187
require_relative "orb/models/price"
177188
require_relative "orb/models/price_create_params"
@@ -245,6 +256,8 @@
245256
require_relative "orb/resources/metrics"
246257
require_relative "orb/resources/plans"
247258
require_relative "orb/resources/plans/external_plan_id"
259+
require_relative "orb/resources/plans/external_plan_id/versions"
260+
require_relative "orb/resources/plans/versions"
248261
require_relative "orb/resources/prices"
249262
require_relative "orb/resources/prices/external_price_id"
250263
require_relative "orb/resources/subscription_changes"

lib/orb/internal/type/base_model.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ def deep_to_h = self.class.recursively_to_h(@data, convert: false)
398398
# # `amount_discount` is a `Orb::AmountDiscount`
399399
# amount_discount => {
400400
# amount_discount: amount_discount,
401-
# applies_to_price_ids: applies_to_price_ids,
402-
# discount_type: discount_type
401+
# discount_type: discount_type,
402+
# applies_to_price_ids: applies_to_price_ids
403403
# }
404404
def deconstruct_keys(keys)
405405
(keys || self.class.known_fields.keys)

lib/orb/internal/type/union.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ module Type
99
# # `discount` is a `Orb::Discount`
1010
# case discount
1111
# when Orb::PercentageDiscount
12-
# puts(discount.applies_to_price_ids)
13-
# when Orb::TrialDiscount
1412
# puts(discount.discount_type)
13+
# when Orb::TrialDiscount
14+
# puts(discount.applies_to_price_ids)
1515
# when Orb::UsageDiscount
1616
# puts(discount.usage_discount)
1717
# else
@@ -22,22 +22,22 @@ module Type
2222
# case discount
2323
# in {
2424
# discount_type: :percentage,
25-
# applies_to_price_ids: applies_to_price_ids,
2625
# percentage_discount: percentage_discount,
26+
# applies_to_price_ids: applies_to_price_ids,
2727
# reason: reason
2828
# }
29-
# puts(applies_to_price_ids)
29+
# puts(percentage_discount)
3030
# in {
3131
# discount_type: :trial,
3232
# applies_to_price_ids: applies_to_price_ids,
3333
# reason: reason,
3434
# trial_amount_discount: trial_amount_discount
3535
# }
36-
# puts(reason)
36+
# puts(applies_to_price_ids)
3737
# in {
3838
# discount_type: :usage,
39-
# applies_to_price_ids: applies_to_price_ids,
4039
# usage_discount: usage_discount,
40+
# applies_to_price_ids: applies_to_price_ids,
4141
# reason: reason
4242
# }
4343
# puts(usage_discount)

lib/orb/models.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ module Orb
158158

159159
Item = Orb::Models::Item
160160

161+
ItemArchiveParams = Orb::Models::ItemArchiveParams
162+
161163
ItemCreateParams = Orb::Models::ItemCreateParams
162164

163165
ItemFetchParams = Orb::Models::ItemFetchParams
@@ -188,6 +190,8 @@ module Orb
188190

189191
Plans = Orb::Models::Plans
190192

193+
PlanSetDefaultVersionParams = Orb::Models::PlanSetDefaultVersionParams
194+
191195
PlanUpdateParams = Orb::Models::PlanUpdateParams
192196

193197
Price = Orb::Models::Price

lib/orb/models/alert.rb

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,16 @@ class Alert < Orb::Internal::Type::BaseModel
6565
# @return [Symbol, Orb::Models::Alert::Type]
6666
required :type, enum: -> { Orb::Alert::Type }
6767

68-
# @!method initialize(id:, created_at:, currency:, customer:, enabled:, metric:, plan:, subscription:, thresholds:, type:)
68+
# @!attribute balance_alert_status
69+
# The current status of the alert. This field is only present for credit balance
70+
# alerts.
71+
#
72+
# @return [Array<Orb::Models::Alert::BalanceAlertStatus>, nil]
73+
optional :balance_alert_status,
74+
-> { Orb::Internal::Type::ArrayOf[Orb::Alert::BalanceAlertStatus] },
75+
nil?: true
76+
77+
# @!method initialize(id:, created_at:, currency:, customer:, enabled:, metric:, plan:, subscription:, thresholds:, type:, balance_alert_status: nil)
6978
# Some parameter documentations has been truncated, see {Orb::Models::Alert} for
7079
# more details.
7180
#
@@ -94,6 +103,8 @@ class Alert < Orb::Internal::Type::BaseModel
94103
# @param thresholds [Array<Orb::Models::Alert::Threshold>, nil] The thresholds that define the conditions under which the alert will be triggere
95104
#
96105
# @param type [Symbol, Orb::Models::Alert::Type] The type of alert. This must be a valid alert type.
106+
#
107+
# @param balance_alert_status [Array<Orb::Models::Alert::BalanceAlertStatus>, nil] The current status of the alert. This field is only present for credit balance a
97108

98109
# @see Orb::Models::Alert#customer
99110
class Customer < Orb::Internal::Type::BaseModel
@@ -214,6 +225,27 @@ module Type
214225
# @!method self.values
215226
# @return [Array<Symbol>]
216227
end
228+
229+
class BalanceAlertStatus < Orb::Internal::Type::BaseModel
230+
# @!attribute in_alert
231+
# Whether the alert is currently in-alert or not.
232+
#
233+
# @return [Boolean]
234+
required :in_alert, Orb::Internal::Type::Boolean
235+
236+
# @!attribute threshold_value
237+
# The value of the threshold that defines the alert status.
238+
#
239+
# @return [Float]
240+
required :threshold_value, Float
241+
242+
# @!method initialize(in_alert:, threshold_value:)
243+
# Alert status is used to determine if an alert is currently in-alert or not.
244+
#
245+
# @param in_alert [Boolean] Whether the alert is currently in-alert or not.
246+
#
247+
# @param threshold_value [Float] The value of the threshold that defines the alert status.
248+
end
217249
end
218250
end
219251
end

lib/orb/models/amount_discount.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,33 @@ class AmountDiscount < Orb::Internal::Type::BaseModel
99
# @return [String]
1010
required :amount_discount, String
1111

12-
# @!attribute applies_to_price_ids
13-
# List of price_ids that this discount applies to. For plan/plan phase discounts,
14-
# this can be a subset of prices.
15-
#
16-
# @return [Array<String>]
17-
required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
18-
1912
# @!attribute discount_type
2013
#
2114
# @return [Symbol, Orb::Models::AmountDiscount::DiscountType]
2215
required :discount_type, enum: -> { Orb::AmountDiscount::DiscountType }
2316

17+
# @!attribute applies_to_price_ids
18+
# List of price_ids that this discount applies to. For plan/plan phase discounts,
19+
# this can be a subset of prices.
20+
#
21+
# @return [Array<String>, nil]
22+
optional :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String], nil?: true
23+
2424
# @!attribute reason
2525
#
2626
# @return [String, nil]
2727
optional :reason, String, nil?: true
2828

29-
# @!method initialize(amount_discount:, applies_to_price_ids:, discount_type:, reason: nil)
29+
# @!method initialize(amount_discount:, discount_type:, applies_to_price_ids: nil, reason: nil)
3030
# Some parameter documentations has been truncated, see
3131
# {Orb::Models::AmountDiscount} for more details.
3232
#
3333
# @param amount_discount [String] Only available if discount_type is `amount`.
3434
#
35-
# @param applies_to_price_ids [Array<String>] List of price_ids that this discount applies to. For plan/plan phase discounts,
36-
#
3735
# @param discount_type [Symbol, Orb::Models::AmountDiscount::DiscountType]
3836
#
37+
# @param applies_to_price_ids [Array<String>, nil] List of price_ids that this discount applies to. For plan/plan phase discounts,
38+
#
3939
# @param reason [String, nil]
4040

4141
# @see Orb::Models::AmountDiscount#discount_type

lib/orb/models/credit_note_create_params.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@ class CreditNoteCreateParams < Orb::Internal::Type::BaseModel
1212
# @return [Array<Orb::Models::CreditNoteCreateParams::LineItem>]
1313
required :line_items, -> { Orb::Internal::Type::ArrayOf[Orb::CreditNoteCreateParams::LineItem] }
1414

15+
# @!attribute reason
16+
# An optional reason for the credit note.
17+
#
18+
# @return [Symbol, Orb::Models::CreditNoteCreateParams::Reason]
19+
required :reason, enum: -> { Orb::CreditNoteCreateParams::Reason }
20+
1521
# @!attribute memo
1622
# An optional memo to attach to the credit note.
1723
#
1824
# @return [String, nil]
1925
optional :memo, String, nil?: true
2026

21-
# @!attribute reason
22-
# An optional reason for the credit note.
23-
#
24-
# @return [Symbol, Orb::Models::CreditNoteCreateParams::Reason, nil]
25-
optional :reason, enum: -> { Orb::CreditNoteCreateParams::Reason }, nil?: true
26-
27-
# @!method initialize(line_items:, memo: nil, reason: nil, request_options: {})
27+
# @!method initialize(line_items:, reason:, memo: nil, request_options: {})
2828
# @param line_items [Array<Orb::Models::CreditNoteCreateParams::LineItem>]
2929
#
30-
# @param memo [String, nil] An optional memo to attach to the credit note.
30+
# @param reason [Symbol, Orb::Models::CreditNoteCreateParams::Reason] An optional reason for the credit note.
3131
#
32-
# @param reason [Symbol, Orb::Models::CreditNoteCreateParams::Reason, nil] An optional reason for the credit note.
32+
# @param memo [String, nil] An optional memo to attach to the credit note.
3333
#
3434
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
3535

lib/orb/models/customer_create_params.rb

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class CustomerCreateParams < Orb::Internal::Type::BaseModel
109109

110110
# @!attribute tax_configuration
111111
#
112-
# @return [Orb::Models::CustomerCreateParams::TaxConfiguration::Avalara, Orb::Models::CustomerCreateParams::TaxConfiguration::Taxjar, nil]
112+
# @return [Orb::Models::CustomerCreateParams::TaxConfiguration::Avalara, Orb::Models::CustomerCreateParams::TaxConfiguration::Taxjar, Orb::Models::CustomerCreateParams::TaxConfiguration::Sphere, nil]
113113
optional :tax_configuration, union: -> { Orb::CustomerCreateParams::TaxConfiguration }, nil?: true
114114

115115
# @!attribute tax_id
@@ -264,7 +264,7 @@ class CustomerCreateParams < Orb::Internal::Type::BaseModel
264264
#
265265
# @param shipping_address [Orb::Models::CustomerCreateParams::ShippingAddress, nil]
266266
#
267-
# @param tax_configuration [Orb::Models::CustomerCreateParams::TaxConfiguration::Avalara, Orb::Models::CustomerCreateParams::TaxConfiguration::Taxjar, nil]
267+
# @param tax_configuration [Orb::Models::CustomerCreateParams::TaxConfiguration::Avalara, Orb::Models::CustomerCreateParams::TaxConfiguration::Taxjar, Orb::Models::CustomerCreateParams::TaxConfiguration::Sphere, nil]
268268
#
269269
# @param tax_id [Orb::Models::CustomerCreateParams::TaxID, nil] Tax IDs are commonly required to be displayed on customer invoices, which are ad
270270
#
@@ -449,6 +449,8 @@ module TaxConfiguration
449449

450450
variant :taxjar, -> { Orb::CustomerCreateParams::TaxConfiguration::Taxjar }
451451

452+
variant :sphere, -> { Orb::CustomerCreateParams::TaxConfiguration::Sphere }
453+
452454
class Avalara < Orb::Internal::Type::BaseModel
453455
# @!attribute tax_exempt
454456
#
@@ -487,8 +489,24 @@ class Taxjar < Orb::Internal::Type::BaseModel
487489
# @param tax_provider [Symbol, :taxjar]
488490
end
489491

492+
class Sphere < Orb::Internal::Type::BaseModel
493+
# @!attribute tax_exempt
494+
#
495+
# @return [Boolean]
496+
required :tax_exempt, Orb::Internal::Type::Boolean
497+
498+
# @!attribute tax_provider
499+
#
500+
# @return [Symbol, :sphere]
501+
required :tax_provider, const: :sphere
502+
503+
# @!method initialize(tax_exempt:, tax_provider: :sphere)
504+
# @param tax_exempt [Boolean]
505+
# @param tax_provider [Symbol, :sphere]
506+
end
507+
490508
# @!method self.variants
491-
# @return [Array(Orb::Models::CustomerCreateParams::TaxConfiguration::Avalara, Orb::Models::CustomerCreateParams::TaxConfiguration::Taxjar)]
509+
# @return [Array(Orb::Models::CustomerCreateParams::TaxConfiguration::Avalara, Orb::Models::CustomerCreateParams::TaxConfiguration::Taxjar, Orb::Models::CustomerCreateParams::TaxConfiguration::Sphere)]
492510
end
493511

494512
class TaxID < Orb::Internal::Type::BaseModel

lib/orb/models/customer_update_by_external_id_params.rb

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class CustomerUpdateByExternalIDParams < Orb::Internal::Type::BaseModel
114114

115115
# @!attribute tax_configuration
116116
#
117-
# @return [Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Avalara, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Taxjar, nil]
117+
# @return [Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Avalara, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Taxjar, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Sphere, nil]
118118
optional :tax_configuration,
119119
union: -> { Orb::CustomerUpdateByExternalIDParams::TaxConfiguration },
120120
nil?: true
@@ -263,7 +263,7 @@ class CustomerUpdateByExternalIDParams < Orb::Internal::Type::BaseModel
263263
#
264264
# @param shipping_address [Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress, nil]
265265
#
266-
# @param tax_configuration [Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Avalara, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Taxjar, nil]
266+
# @param tax_configuration [Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Avalara, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Taxjar, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Sphere, nil]
267267
#
268268
# @param tax_id [Orb::Models::CustomerUpdateByExternalIDParams::TaxID, nil] Tax IDs are commonly required to be displayed on customer invoices, which are ad
269269
#
@@ -450,6 +450,8 @@ module TaxConfiguration
450450

451451
variant :taxjar, -> { Orb::CustomerUpdateByExternalIDParams::TaxConfiguration::Taxjar }
452452

453+
variant :sphere, -> { Orb::CustomerUpdateByExternalIDParams::TaxConfiguration::Sphere }
454+
453455
class Avalara < Orb::Internal::Type::BaseModel
454456
# @!attribute tax_exempt
455457
#
@@ -488,8 +490,24 @@ class Taxjar < Orb::Internal::Type::BaseModel
488490
# @param tax_provider [Symbol, :taxjar]
489491
end
490492

493+
class Sphere < Orb::Internal::Type::BaseModel
494+
# @!attribute tax_exempt
495+
#
496+
# @return [Boolean]
497+
required :tax_exempt, Orb::Internal::Type::Boolean
498+
499+
# @!attribute tax_provider
500+
#
501+
# @return [Symbol, :sphere]
502+
required :tax_provider, const: :sphere
503+
504+
# @!method initialize(tax_exempt:, tax_provider: :sphere)
505+
# @param tax_exempt [Boolean]
506+
# @param tax_provider [Symbol, :sphere]
507+
end
508+
491509
# @!method self.variants
492-
# @return [Array(Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Avalara, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Taxjar)]
510+
# @return [Array(Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Avalara, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Taxjar, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Sphere)]
493511
end
494512

495513
class TaxID < Orb::Internal::Type::BaseModel

0 commit comments

Comments
 (0)