Skip to content

Commit 98aaf7c

Browse files
feat(api): api update
1 parent 921d3c6 commit 98aaf7c

File tree

8 files changed

+177
-177
lines changed

8 files changed

+177
-177
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-947253d9be505473c1c2cb0193d2602fa6b017e221f482be3f4f374c6156b350.yml
3-
openapi_spec_hash: 1b40d1a85b4b846a1c14634fbbc65da3
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4ad3b44ca7f484243d8706b6aa7f4498fc5bf2b37fadf3da0a06d657e482c08f.yml
3+
openapi_spec_hash: 9ead1a2aae36be1086c627c3636064ea
44
config_hash: e6db17547fe854b1c240407cf4c6dc9e

lib/orb/models/plan.rb

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ class Plan < Orb::Internal::Type::BaseModel
1616
# @return [Array<Orb::Models::PlanPhaseUsageDiscountAdjustment, Orb::Models::PlanPhaseAmountDiscountAdjustment, Orb::Models::PlanPhasePercentageDiscountAdjustment, Orb::Models::PlanPhaseMinimumAdjustment, Orb::Models::PlanPhaseMaximumAdjustment>]
1717
required :adjustments, -> { Orb::Internal::Type::ArrayOf[union: Orb::Plan::Adjustment] }
1818

19+
# @!attribute base_plan
20+
#
21+
# @return [Orb::Models::Plan::BasePlan, nil]
22+
required :base_plan, -> { Orb::Plan::BasePlan }, nil?: true
23+
24+
# @!attribute base_plan_id
25+
# The parent plan id if the given plan was created by overriding one or more of
26+
# the parent's prices
27+
#
28+
# @return [String, nil]
29+
required :base_plan_id, String, nil?: true
30+
1931
# @!attribute created_at
2032
#
2133
# @return [Time]
@@ -143,19 +155,7 @@ class Plan < Orb::Internal::Type::BaseModel
143155
# @return [Integer]
144156
required :version, Integer
145157

146-
# @!attribute base_plan
147-
#
148-
# @return [Orb::Models::Plan::BasePlan, nil]
149-
optional :base_plan, -> { Orb::Plan::BasePlan }, nil?: true
150-
151-
# @!attribute base_plan_id
152-
# The parent plan id if the given plan was created by overriding one or more of
153-
# the parent's prices
154-
#
155-
# @return [String, nil]
156-
optional :base_plan_id, String, nil?: true
157-
158-
# @!method initialize(id:, adjustments:, created_at:, currency:, default_invoice_memo:, description:, discount:, external_plan_id:, invoicing_currency:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, net_terms:, plan_phases:, prices:, product:, status:, trial_config:, version:, base_plan: nil, base_plan_id: nil)
158+
# @!method initialize(id:, adjustments:, base_plan:, base_plan_id:, created_at:, currency:, default_invoice_memo:, description:, discount:, external_plan_id:, invoicing_currency:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, net_terms:, plan_phases:, prices:, product:, status:, trial_config:, version:)
159159
# Some parameter documentations has been truncated, see {Orb::Models::Plan} for
160160
# more details.
161161
#
@@ -168,6 +168,10 @@ class Plan < Orb::Internal::Type::BaseModel
168168
#
169169
# @param adjustments [Array<Orb::Models::PlanPhaseUsageDiscountAdjustment, Orb::Models::PlanPhaseAmountDiscountAdjustment, Orb::Models::PlanPhasePercentageDiscountAdjustment, Orb::Models::PlanPhaseMinimumAdjustment, Orb::Models::PlanPhaseMaximumAdjustment>] Adjustments for this plan. If the plan has phases, this includes adjustments acr
170170
#
171+
# @param base_plan [Orb::Models::Plan::BasePlan, nil]
172+
#
173+
# @param base_plan_id [String, nil] The parent plan id if the given plan was created by overriding one or more of th
174+
#
171175
# @param created_at [Time]
172176
#
173177
# @param currency [String] An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's p
@@ -207,10 +211,6 @@ class Plan < Orb::Internal::Type::BaseModel
207211
# @param trial_config [Orb::Models::Plan::TrialConfig]
208212
#
209213
# @param version [Integer]
210-
#
211-
# @param base_plan [Orb::Models::Plan::BasePlan, nil]
212-
#
213-
# @param base_plan_id [String, nil] The parent plan id if the given plan was created by overriding one or more of th
214214

215215
module Adjustment
216216
extend Orb::Internal::Type::Union
@@ -231,6 +231,37 @@ module Adjustment
231231
# @return [Array(Orb::Models::PlanPhaseUsageDiscountAdjustment, Orb::Models::PlanPhaseAmountDiscountAdjustment, Orb::Models::PlanPhasePercentageDiscountAdjustment, Orb::Models::PlanPhaseMinimumAdjustment, Orb::Models::PlanPhaseMaximumAdjustment)]
232232
end
233233

234+
# @see Orb::Models::Plan#base_plan
235+
class BasePlan < Orb::Internal::Type::BaseModel
236+
# @!attribute id
237+
#
238+
# @return [String, nil]
239+
required :id, String, nil?: true
240+
241+
# @!attribute external_plan_id
242+
# An optional user-defined ID for this plan resource, used throughout the system
243+
# as an alias for this Plan. Use this field to identify a plan by an existing
244+
# identifier in your system.
245+
#
246+
# @return [String, nil]
247+
required :external_plan_id, String, nil?: true
248+
249+
# @!attribute name
250+
#
251+
# @return [String, nil]
252+
required :name, String, nil?: true
253+
254+
# @!method initialize(id:, external_plan_id:, name:)
255+
# Some parameter documentations has been truncated, see
256+
# {Orb::Models::Plan::BasePlan} for more details.
257+
#
258+
# @param id [String, nil]
259+
#
260+
# @param external_plan_id [String, nil] An optional user-defined ID for this plan resource, used throughout the system a
261+
#
262+
# @param name [String, nil]
263+
end
264+
234265
class PlanPhase < Orb::Internal::Type::BaseModel
235266
# @!attribute id
236267
#
@@ -392,37 +423,6 @@ module TrialPeriodUnit
392423
# @return [Array<Symbol>]
393424
end
394425
end
395-
396-
# @see Orb::Models::Plan#base_plan
397-
class BasePlan < Orb::Internal::Type::BaseModel
398-
# @!attribute id
399-
#
400-
# @return [String, nil]
401-
required :id, String, nil?: true
402-
403-
# @!attribute external_plan_id
404-
# An optional user-defined ID for this plan resource, used throughout the system
405-
# as an alias for this Plan. Use this field to identify a plan by an existing
406-
# identifier in your system.
407-
#
408-
# @return [String, nil]
409-
required :external_plan_id, String, nil?: true
410-
411-
# @!attribute name
412-
#
413-
# @return [String, nil]
414-
required :name, String, nil?: true
415-
416-
# @!method initialize(id:, external_plan_id:, name:)
417-
# Some parameter documentations has been truncated, see
418-
# {Orb::Models::Plan::BasePlan} for more details.
419-
#
420-
# @param id [String, nil]
421-
#
422-
# @param external_plan_id [String, nil] An optional user-defined ID for this plan resource, used throughout the system a
423-
#
424-
# @param name [String, nil]
425-
end
426426
end
427427
end
428428
end

rbi/orb/models/plan.rbi

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ module Orb
1313
sig { returns(T::Array[Orb::Plan::Adjustment::Variants]) }
1414
attr_accessor :adjustments
1515

16+
sig { returns(T.nilable(Orb::Plan::BasePlan)) }
17+
attr_reader :base_plan
18+
19+
sig { params(base_plan: T.nilable(Orb::Plan::BasePlan::OrHash)).void }
20+
attr_writer :base_plan
21+
22+
# The parent plan id if the given plan was created by overriding one or more of
23+
# the parent's prices
24+
sig { returns(T.nilable(String)) }
25+
attr_accessor :base_plan_id
26+
1627
sig { returns(Time) }
1728
attr_accessor :created_at
1829

@@ -105,17 +116,6 @@ module Orb
105116
sig { returns(Integer) }
106117
attr_accessor :version
107118

108-
sig { returns(T.nilable(Orb::Plan::BasePlan)) }
109-
attr_reader :base_plan
110-
111-
sig { params(base_plan: T.nilable(Orb::Plan::BasePlan::OrHash)).void }
112-
attr_writer :base_plan
113-
114-
# The parent plan id if the given plan was created by overriding one or more of
115-
# the parent's prices
116-
sig { returns(T.nilable(String)) }
117-
attr_accessor :base_plan_id
118-
119119
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
120120
# subscribed to by a customer. Plans define the billing behavior of the
121121
# subscription. You can see more about how to configure prices in the
@@ -133,6 +133,8 @@ module Orb
133133
Orb::PlanPhaseMaximumAdjustment::OrHash
134134
)
135135
],
136+
base_plan: T.nilable(Orb::Plan::BasePlan::OrHash),
137+
base_plan_id: T.nilable(String),
136138
created_at: Time,
137139
currency: String,
138140
default_invoice_memo: T.nilable(String),
@@ -195,16 +197,18 @@ module Orb
195197
product: Orb::Plan::Product::OrHash,
196198
status: Orb::Plan::Status::OrSymbol,
197199
trial_config: Orb::Plan::TrialConfig::OrHash,
198-
version: Integer,
199-
base_plan: T.nilable(Orb::Plan::BasePlan::OrHash),
200-
base_plan_id: T.nilable(String)
200+
version: Integer
201201
).returns(T.attached_class)
202202
end
203203
def self.new(
204204
id:,
205205
# Adjustments for this plan. If the plan has phases, this includes adjustments
206206
# across all phases of the plan.
207207
adjustments:,
208+
base_plan:,
209+
# The parent plan id if the given plan was created by overriding one or more of
210+
# the parent's prices
211+
base_plan_id:,
208212
created_at:,
209213
# An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's
210214
# prices.
@@ -244,11 +248,7 @@ module Orb
244248
product:,
245249
status:,
246250
trial_config:,
247-
version:,
248-
base_plan: nil,
249-
# The parent plan id if the given plan was created by overriding one or more of
250-
# the parent's prices
251-
base_plan_id: nil
251+
version:
252252
)
253253
end
254254

@@ -257,6 +257,8 @@ module Orb
257257
{
258258
id: String,
259259
adjustments: T::Array[Orb::Plan::Adjustment::Variants],
260+
base_plan: T.nilable(Orb::Plan::BasePlan),
261+
base_plan_id: T.nilable(String),
260262
created_at: Time,
261263
currency: String,
262264
default_invoice_memo: T.nilable(String),
@@ -276,9 +278,7 @@ module Orb
276278
product: Orb::Plan::Product,
277279
status: Orb::Plan::Status::TaggedSymbol,
278280
trial_config: Orb::Plan::TrialConfig,
279-
version: Integer,
280-
base_plan: T.nilable(Orb::Plan::BasePlan),
281-
base_plan_id: T.nilable(String)
281+
version: Integer
282282
}
283283
)
284284
end
@@ -304,6 +304,52 @@ module Orb
304304
end
305305
end
306306

307+
class BasePlan < Orb::Internal::Type::BaseModel
308+
OrHash =
309+
T.type_alias { T.any(Orb::Plan::BasePlan, Orb::Internal::AnyHash) }
310+
311+
sig { returns(T.nilable(String)) }
312+
attr_accessor :id
313+
314+
# An optional user-defined ID for this plan resource, used throughout the system
315+
# as an alias for this Plan. Use this field to identify a plan by an existing
316+
# identifier in your system.
317+
sig { returns(T.nilable(String)) }
318+
attr_accessor :external_plan_id
319+
320+
sig { returns(T.nilable(String)) }
321+
attr_accessor :name
322+
323+
sig do
324+
params(
325+
id: T.nilable(String),
326+
external_plan_id: T.nilable(String),
327+
name: T.nilable(String)
328+
).returns(T.attached_class)
329+
end
330+
def self.new(
331+
id:,
332+
# An optional user-defined ID for this plan resource, used throughout the system
333+
# as an alias for this Plan. Use this field to identify a plan by an existing
334+
# identifier in your system.
335+
external_plan_id:,
336+
name:
337+
)
338+
end
339+
340+
sig do
341+
override.returns(
342+
{
343+
id: T.nilable(String),
344+
external_plan_id: T.nilable(String),
345+
name: T.nilable(String)
346+
}
347+
)
348+
end
349+
def to_hash
350+
end
351+
end
352+
307353
class PlanPhase < Orb::Internal::Type::BaseModel
308354
OrHash =
309355
T.type_alias { T.any(Orb::Plan::PlanPhase, Orb::Internal::AnyHash) }
@@ -539,52 +585,6 @@ module Orb
539585
end
540586
end
541587
end
542-
543-
class BasePlan < Orb::Internal::Type::BaseModel
544-
OrHash =
545-
T.type_alias { T.any(Orb::Plan::BasePlan, Orb::Internal::AnyHash) }
546-
547-
sig { returns(T.nilable(String)) }
548-
attr_accessor :id
549-
550-
# An optional user-defined ID for this plan resource, used throughout the system
551-
# as an alias for this Plan. Use this field to identify a plan by an existing
552-
# identifier in your system.
553-
sig { returns(T.nilable(String)) }
554-
attr_accessor :external_plan_id
555-
556-
sig { returns(T.nilable(String)) }
557-
attr_accessor :name
558-
559-
sig do
560-
params(
561-
id: T.nilable(String),
562-
external_plan_id: T.nilable(String),
563-
name: T.nilable(String)
564-
).returns(T.attached_class)
565-
end
566-
def self.new(
567-
id:,
568-
# An optional user-defined ID for this plan resource, used throughout the system
569-
# as an alias for this Plan. Use this field to identify a plan by an existing
570-
# identifier in your system.
571-
external_plan_id:,
572-
name:
573-
)
574-
end
575-
576-
sig do
577-
override.returns(
578-
{
579-
id: T.nilable(String),
580-
external_plan_id: T.nilable(String),
581-
name: T.nilable(String)
582-
}
583-
)
584-
end
585-
def to_hash
586-
end
587-
end
588588
end
589589
end
590590
end

0 commit comments

Comments
 (0)