orb-billing 1.56.0 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/README.md +1 -1
- data/lib/orb/client.rb +0 -8
- data/lib/orb/models/migration_create_params.rb +10 -1
- data/lib/orb/models/plan.rb +9 -1
- data/lib/orb/models/{beta_create_plan_version_params.rb → plan_create_plan_version_params.rb} +430 -430
- data/lib/orb/models/{beta_fetch_plan_version_params.rb → plan_fetch_plan_version_params.rb} +2 -2
- data/lib/orb/models/{beta_set_default_plan_version_params.rb → plan_set_default_plan_version_params.rb} +2 -2
- data/lib/orb/models/plan_version.rb +1 -1
- data/lib/orb/models/plans/draft_discard_params.rb +22 -0
- data/lib/orb/models/plans/draft_fetch_params.rb +22 -0
- data/lib/orb/models/plans/draft_publish_params.rb +31 -0
- data/lib/orb/models/plans/draft_save_params.rb +7522 -0
- data/lib/orb/models/plans/external_plan_id/draft_discard_params.rb +24 -0
- data/lib/orb/models/plans/external_plan_id/draft_fetch_params.rb +24 -0
- data/lib/orb/models/plans/external_plan_id/draft_publish_params.rb +33 -0
- data/lib/orb/models/plans/external_plan_id/draft_save_params.rb +7595 -0
- data/lib/orb/models/{beta → plans}/external_plan_id_create_plan_version_params.rb +430 -430
- data/lib/orb/models/{beta → plans}/external_plan_id_fetch_plan_version_params.rb +2 -2
- data/lib/orb/models/{beta → plans}/external_plan_id_set_default_plan_version_params.rb +2 -2
- data/lib/orb/models/plans/plan_version_draft.rb +279 -0
- data/lib/orb/models.rb +6 -8
- data/lib/orb/resources/migrations.rb +3 -1
- data/lib/orb/resources/plans/draft.rb +124 -0
- data/lib/orb/resources/plans/external_plan_id/draft.rb +126 -0
- data/lib/orb/resources/plans/external_plan_id.rb +96 -0
- data/lib/orb/resources/plans.rb +96 -0
- data/lib/orb/version.rb +1 -1
- data/lib/orb.rb +17 -8
- data/rbi/orb/client.rbi +0 -7
- data/rbi/orb/models/migration_create_params.rbi +13 -0
- data/rbi/orb/models/plan.rbi +8 -0
- data/rbi/orb/models/{beta_create_plan_version_params.rbi → plan_create_plan_version_params.rbi} +744 -744
- data/rbi/orb/models/{beta_fetch_plan_version_params.rbi → plan_fetch_plan_version_params.rbi} +2 -2
- data/rbi/orb/models/{beta_set_default_plan_version_params.rbi → plan_set_default_plan_version_params.rbi} +2 -2
- data/rbi/orb/models/plans/draft_discard_params.rbi +37 -0
- data/rbi/orb/models/plans/draft_fetch_params.rbi +37 -0
- data/rbi/orb/models/plans/draft_publish_params.rbi +54 -0
- data/rbi/orb/models/plans/draft_save_params.rbi +13143 -0
- data/rbi/orb/models/plans/external_plan_id/draft_discard_params.rbi +42 -0
- data/rbi/orb/models/plans/external_plan_id/draft_fetch_params.rbi +42 -0
- data/rbi/orb/models/plans/external_plan_id/draft_publish_params.rbi +59 -0
- data/rbi/orb/models/plans/external_plan_id/draft_save_params.rbi +13256 -0
- data/rbi/orb/models/{beta → plans}/external_plan_id_create_plan_version_params.rbi +744 -744
- data/rbi/orb/models/{beta → plans}/external_plan_id_fetch_plan_version_params.rbi +2 -2
- data/rbi/orb/models/{beta → plans}/external_plan_id_set_default_plan_version_params.rbi +2 -2
- data/rbi/orb/models/plans/plan_version_draft.rbi +502 -0
- data/rbi/orb/models.rbi +6 -8
- data/rbi/orb/resources/migrations.rbi +4 -0
- data/rbi/orb/resources/{beta/external_plan_id.rbi → plans/draft.rbi} +58 -59
- data/rbi/orb/resources/plans/external_plan_id/draft.rbi +126 -0
- data/rbi/orb/resources/plans/external_plan_id.rbi +102 -0
- data/rbi/orb/resources/plans.rbi +94 -0
- data/sig/orb/client.rbs +0 -2
- data/sig/orb/models/migration_create_params.rbs +7 -0
- data/sig/orb/models/plan.rbs +5 -0
- data/sig/orb/models/{beta_create_plan_version_params.rbs → plan_create_plan_version_params.rbs} +448 -448
- data/sig/orb/models/{beta_fetch_plan_version_params.rbs → plan_fetch_plan_version_params.rbs} +2 -2
- data/sig/orb/models/{beta_set_default_plan_version_params.rbs → plan_set_default_plan_version_params.rbs} +2 -2
- data/sig/orb/models/plans/draft_discard_params.rbs +25 -0
- data/sig/orb/models/plans/draft_fetch_params.rbs +25 -0
- data/sig/orb/models/plans/draft_publish_params.rbs +32 -0
- data/sig/orb/models/plans/draft_save_params.rbs +5210 -0
- data/sig/orb/models/plans/external_plan_id/draft_discard_params.rbs +27 -0
- data/sig/orb/models/plans/external_plan_id/draft_fetch_params.rbs +27 -0
- data/sig/orb/models/plans/external_plan_id/draft_publish_params.rbs +34 -0
- data/sig/orb/models/plans/external_plan_id/draft_save_params.rbs +5215 -0
- data/sig/orb/models/{beta → plans}/external_plan_id_create_plan_version_params.rbs +447 -447
- data/sig/orb/models/{beta → plans}/external_plan_id_fetch_plan_version_params.rbs +1 -1
- data/sig/orb/models/{beta → plans}/external_plan_id_set_default_plan_version_params.rbs +1 -1
- data/sig/orb/models/plans/plan_version_draft.rbs +205 -0
- data/sig/orb/models.rbs +6 -8
- data/sig/orb/resources/migrations.rbs +1 -0
- data/sig/orb/resources/plans/draft.rbs +37 -0
- data/sig/orb/resources/plans/external_plan_id/draft.rbs +39 -0
- data/sig/orb/resources/plans/external_plan_id.rbs +27 -0
- data/sig/orb/resources/plans.rbs +27 -0
- metadata +2038 -2005
- data/lib/orb/resources/beta/external_plan_id.rb +0 -108
- data/lib/orb/resources/beta.rb +0 -114
- data/rbi/orb/resources/beta.rbi +0 -110
- data/sig/orb/resources/beta/external_plan_id.rbs +0 -34
- data/sig/orb/resources/beta.rbs +0 -34
|
@@ -8,6 +8,13 @@ module Orb
|
|
|
8
8
|
# subscription. You can see more about how to configure prices in the
|
|
9
9
|
# [Price resource](/reference/price).
|
|
10
10
|
class ExternalPlanID
|
|
11
|
+
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
|
|
12
|
+
# subscribed to by a customer. Plans define the billing behavior of the
|
|
13
|
+
# subscription. You can see more about how to configure prices in the
|
|
14
|
+
# [Price resource](/reference/price).
|
|
15
|
+
# @return [Orb::Resources::Plans::ExternalPlanID::Draft]
|
|
16
|
+
attr_reader :draft
|
|
17
|
+
|
|
11
18
|
# Some parameter documentations has been truncated, see
|
|
12
19
|
# {Orb::Models::Plans::ExternalPlanIDUpdateParams} for more details.
|
|
13
20
|
#
|
|
@@ -45,6 +52,44 @@ module Orb
|
|
|
45
52
|
)
|
|
46
53
|
end
|
|
47
54
|
|
|
55
|
+
# This endpoint allows the creation of a new plan version for an existing plan.
|
|
56
|
+
#
|
|
57
|
+
# @overload create_plan_version(external_plan_id, version:, add_adjustments: nil, add_prices: nil, remove_adjustments: nil, remove_prices: nil, replace_adjustments: nil, replace_prices: nil, set_as_default: nil, request_options: {})
|
|
58
|
+
#
|
|
59
|
+
# @param external_plan_id [String]
|
|
60
|
+
#
|
|
61
|
+
# @param version [Integer] New version number.
|
|
62
|
+
#
|
|
63
|
+
# @param add_adjustments [Array<Orb::Models::Plans::ExternalPlanIDCreatePlanVersionParams::AddAdjustment>, nil] Additional adjustments to be added to the plan.
|
|
64
|
+
#
|
|
65
|
+
# @param add_prices [Array<Orb::Models::Plans::ExternalPlanIDCreatePlanVersionParams::AddPrice>, nil] Additional prices to be added to the plan.
|
|
66
|
+
#
|
|
67
|
+
# @param remove_adjustments [Array<Orb::Models::Plans::ExternalPlanIDCreatePlanVersionParams::RemoveAdjustment>, nil] Adjustments to be removed from the plan.
|
|
68
|
+
#
|
|
69
|
+
# @param remove_prices [Array<Orb::Models::Plans::ExternalPlanIDCreatePlanVersionParams::RemovePrice>, nil] Prices to be removed from the plan.
|
|
70
|
+
#
|
|
71
|
+
# @param replace_adjustments [Array<Orb::Models::Plans::ExternalPlanIDCreatePlanVersionParams::ReplaceAdjustment>, nil] Adjustments to be replaced with additional adjustments on the plan.
|
|
72
|
+
#
|
|
73
|
+
# @param replace_prices [Array<Orb::Models::Plans::ExternalPlanIDCreatePlanVersionParams::ReplacePrice>, nil] Prices to be replaced with additional prices on the plan.
|
|
74
|
+
#
|
|
75
|
+
# @param set_as_default [Boolean, nil] Set this new plan version as the default
|
|
76
|
+
#
|
|
77
|
+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
78
|
+
#
|
|
79
|
+
# @return [Orb::Models::PlanVersion]
|
|
80
|
+
#
|
|
81
|
+
# @see Orb::Models::Plans::ExternalPlanIDCreatePlanVersionParams
|
|
82
|
+
def create_plan_version(external_plan_id, params)
|
|
83
|
+
parsed, options = Orb::Plans::ExternalPlanIDCreatePlanVersionParams.dump_request(params)
|
|
84
|
+
@client.request(
|
|
85
|
+
method: :post,
|
|
86
|
+
path: ["plans/external_plan_id/%1$s/versions", external_plan_id],
|
|
87
|
+
body: parsed,
|
|
88
|
+
model: Orb::PlanVersion,
|
|
89
|
+
options: options
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
|
|
48
93
|
# This endpoint is used to fetch [plan](/core-concepts##plan-and-price) details
|
|
49
94
|
# given an external_plan_id identifier. It returns information about the prices
|
|
50
95
|
# included in the plan and their configuration, as well as the product that the
|
|
@@ -79,11 +124,62 @@ module Orb
|
|
|
79
124
|
)
|
|
80
125
|
end
|
|
81
126
|
|
|
127
|
+
# This endpoint is used to fetch a plan version. It returns the phases, prices,
|
|
128
|
+
# and adjustments present on this version of the plan.
|
|
129
|
+
#
|
|
130
|
+
# @overload fetch_plan_version(version, external_plan_id:, request_options: {})
|
|
131
|
+
#
|
|
132
|
+
# @param version [String]
|
|
133
|
+
# @param external_plan_id [String]
|
|
134
|
+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
135
|
+
#
|
|
136
|
+
# @return [Orb::Models::PlanVersion]
|
|
137
|
+
#
|
|
138
|
+
# @see Orb::Models::Plans::ExternalPlanIDFetchPlanVersionParams
|
|
139
|
+
def fetch_plan_version(version, params)
|
|
140
|
+
parsed, options = Orb::Plans::ExternalPlanIDFetchPlanVersionParams.dump_request(params)
|
|
141
|
+
external_plan_id =
|
|
142
|
+
parsed.delete(:external_plan_id) do
|
|
143
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
144
|
+
end
|
|
145
|
+
@client.request(
|
|
146
|
+
method: :get,
|
|
147
|
+
path: ["plans/external_plan_id/%1$s/versions/%2$s", external_plan_id, version],
|
|
148
|
+
model: Orb::PlanVersion,
|
|
149
|
+
options: options
|
|
150
|
+
)
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# This endpoint allows setting the default version of a plan.
|
|
154
|
+
#
|
|
155
|
+
# @overload set_default_plan_version(external_plan_id, version:, request_options: {})
|
|
156
|
+
#
|
|
157
|
+
# @param external_plan_id [String]
|
|
158
|
+
#
|
|
159
|
+
# @param version [Integer] Plan version to set as the default.
|
|
160
|
+
#
|
|
161
|
+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
162
|
+
#
|
|
163
|
+
# @return [Orb::Models::Plan]
|
|
164
|
+
#
|
|
165
|
+
# @see Orb::Models::Plans::ExternalPlanIDSetDefaultPlanVersionParams
|
|
166
|
+
def set_default_plan_version(external_plan_id, params)
|
|
167
|
+
parsed, options = Orb::Plans::ExternalPlanIDSetDefaultPlanVersionParams.dump_request(params)
|
|
168
|
+
@client.request(
|
|
169
|
+
method: :post,
|
|
170
|
+
path: ["plans/external_plan_id/%1$s/set_default_version", external_plan_id],
|
|
171
|
+
body: parsed,
|
|
172
|
+
model: Orb::Plan,
|
|
173
|
+
options: options
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
|
|
82
177
|
# @api private
|
|
83
178
|
#
|
|
84
179
|
# @param client [Orb::Client]
|
|
85
180
|
def initialize(client:)
|
|
86
181
|
@client = client
|
|
182
|
+
@draft = Orb::Resources::Plans::ExternalPlanID::Draft.new(client: client)
|
|
87
183
|
end
|
|
88
184
|
end
|
|
89
185
|
end
|
data/lib/orb/resources/plans.rb
CHANGED
|
@@ -14,6 +14,13 @@ module Orb
|
|
|
14
14
|
# @return [Orb::Resources::Plans::ExternalPlanID]
|
|
15
15
|
attr_reader :external_plan_id
|
|
16
16
|
|
|
17
|
+
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
|
|
18
|
+
# subscribed to by a customer. Plans define the billing behavior of the
|
|
19
|
+
# subscription. You can see more about how to configure prices in the
|
|
20
|
+
# [Price resource](/reference/price).
|
|
21
|
+
# @return [Orb::Resources::Plans::Draft]
|
|
22
|
+
attr_reader :draft
|
|
23
|
+
|
|
17
24
|
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
|
|
18
25
|
# subscribed to by a customer. Plans define the billing behavior of the
|
|
19
26
|
# subscription. You can see more about how to configure prices in the
|
|
@@ -145,6 +152,44 @@ module Orb
|
|
|
145
152
|
)
|
|
146
153
|
end
|
|
147
154
|
|
|
155
|
+
# This endpoint allows the creation of a new plan version for an existing plan.
|
|
156
|
+
#
|
|
157
|
+
# @overload create_plan_version(plan_id, version:, add_adjustments: nil, add_prices: nil, remove_adjustments: nil, remove_prices: nil, replace_adjustments: nil, replace_prices: nil, set_as_default: nil, request_options: {})
|
|
158
|
+
#
|
|
159
|
+
# @param plan_id [String]
|
|
160
|
+
#
|
|
161
|
+
# @param version [Integer] New version number.
|
|
162
|
+
#
|
|
163
|
+
# @param add_adjustments [Array<Orb::Models::PlanCreatePlanVersionParams::AddAdjustment>, nil] Additional adjustments to be added to the plan.
|
|
164
|
+
#
|
|
165
|
+
# @param add_prices [Array<Orb::Models::PlanCreatePlanVersionParams::AddPrice>, nil] Additional prices to be added to the plan.
|
|
166
|
+
#
|
|
167
|
+
# @param remove_adjustments [Array<Orb::Models::PlanCreatePlanVersionParams::RemoveAdjustment>, nil] Adjustments to be removed from the plan.
|
|
168
|
+
#
|
|
169
|
+
# @param remove_prices [Array<Orb::Models::PlanCreatePlanVersionParams::RemovePrice>, nil] Prices to be removed from the plan.
|
|
170
|
+
#
|
|
171
|
+
# @param replace_adjustments [Array<Orb::Models::PlanCreatePlanVersionParams::ReplaceAdjustment>, nil] Adjustments to be replaced with additional adjustments on the plan.
|
|
172
|
+
#
|
|
173
|
+
# @param replace_prices [Array<Orb::Models::PlanCreatePlanVersionParams::ReplacePrice>, nil] Prices to be replaced with additional prices on the plan.
|
|
174
|
+
#
|
|
175
|
+
# @param set_as_default [Boolean, nil] Set this new plan version as the default
|
|
176
|
+
#
|
|
177
|
+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
178
|
+
#
|
|
179
|
+
# @return [Orb::Models::PlanVersion]
|
|
180
|
+
#
|
|
181
|
+
# @see Orb::Models::PlanCreatePlanVersionParams
|
|
182
|
+
def create_plan_version(plan_id, params)
|
|
183
|
+
parsed, options = Orb::PlanCreatePlanVersionParams.dump_request(params)
|
|
184
|
+
@client.request(
|
|
185
|
+
method: :post,
|
|
186
|
+
path: ["plans/%1$s/versions", plan_id],
|
|
187
|
+
body: parsed,
|
|
188
|
+
model: Orb::PlanVersion,
|
|
189
|
+
options: options
|
|
190
|
+
)
|
|
191
|
+
end
|
|
192
|
+
|
|
148
193
|
# This endpoint is used to fetch [plan](/core-concepts#plan-and-price) details
|
|
149
194
|
# given a plan identifier. It returns information about the prices included in the
|
|
150
195
|
# plan and their configuration, as well as the product that the plan is attached
|
|
@@ -180,12 +225,63 @@ module Orb
|
|
|
180
225
|
)
|
|
181
226
|
end
|
|
182
227
|
|
|
228
|
+
# This endpoint is used to fetch a plan version. It returns the phases, prices,
|
|
229
|
+
# and adjustments present on this version of the plan.
|
|
230
|
+
#
|
|
231
|
+
# @overload fetch_plan_version(version, plan_id:, request_options: {})
|
|
232
|
+
#
|
|
233
|
+
# @param version [String]
|
|
234
|
+
# @param plan_id [String]
|
|
235
|
+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
236
|
+
#
|
|
237
|
+
# @return [Orb::Models::PlanVersion]
|
|
238
|
+
#
|
|
239
|
+
# @see Orb::Models::PlanFetchPlanVersionParams
|
|
240
|
+
def fetch_plan_version(version, params)
|
|
241
|
+
parsed, options = Orb::PlanFetchPlanVersionParams.dump_request(params)
|
|
242
|
+
plan_id =
|
|
243
|
+
parsed.delete(:plan_id) do
|
|
244
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
245
|
+
end
|
|
246
|
+
@client.request(
|
|
247
|
+
method: :get,
|
|
248
|
+
path: ["plans/%1$s/versions/%2$s", plan_id, version],
|
|
249
|
+
model: Orb::PlanVersion,
|
|
250
|
+
options: options
|
|
251
|
+
)
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# This endpoint allows setting the default version of a plan.
|
|
255
|
+
#
|
|
256
|
+
# @overload set_default_plan_version(plan_id, version:, request_options: {})
|
|
257
|
+
#
|
|
258
|
+
# @param plan_id [String]
|
|
259
|
+
#
|
|
260
|
+
# @param version [Integer] Plan version to set as the default.
|
|
261
|
+
#
|
|
262
|
+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
263
|
+
#
|
|
264
|
+
# @return [Orb::Models::Plan]
|
|
265
|
+
#
|
|
266
|
+
# @see Orb::Models::PlanSetDefaultPlanVersionParams
|
|
267
|
+
def set_default_plan_version(plan_id, params)
|
|
268
|
+
parsed, options = Orb::PlanSetDefaultPlanVersionParams.dump_request(params)
|
|
269
|
+
@client.request(
|
|
270
|
+
method: :post,
|
|
271
|
+
path: ["plans/%1$s/set_default_version", plan_id],
|
|
272
|
+
body: parsed,
|
|
273
|
+
model: Orb::Plan,
|
|
274
|
+
options: options
|
|
275
|
+
)
|
|
276
|
+
end
|
|
277
|
+
|
|
183
278
|
# @api private
|
|
184
279
|
#
|
|
185
280
|
# @param client [Orb::Client]
|
|
186
281
|
def initialize(client:)
|
|
187
282
|
@client = client
|
|
188
283
|
@external_plan_id = Orb::Resources::Plans::ExternalPlanID.new(client: client)
|
|
284
|
+
@draft = Orb::Resources::Plans::Draft.new(client: client)
|
|
189
285
|
@migrations = Orb::Resources::Plans::Migrations.new(client: client)
|
|
190
286
|
end
|
|
191
287
|
end
|
data/lib/orb/version.rb
CHANGED
data/lib/orb.rb
CHANGED
|
@@ -74,12 +74,6 @@ require_relative "orb/models/amount_discount"
|
|
|
74
74
|
require_relative "orb/models/amount_discount_interval"
|
|
75
75
|
require_relative "orb/models/backfill_reflected_webhook_event"
|
|
76
76
|
require_relative "orb/models/backfill_reverted_webhook_event"
|
|
77
|
-
require_relative "orb/models/beta/external_plan_id_create_plan_version_params"
|
|
78
|
-
require_relative "orb/models/beta/external_plan_id_fetch_plan_version_params"
|
|
79
|
-
require_relative "orb/models/beta/external_plan_id_set_default_plan_version_params"
|
|
80
|
-
require_relative "orb/models/beta_create_plan_version_params"
|
|
81
|
-
require_relative "orb/models/beta_fetch_plan_version_params"
|
|
82
|
-
require_relative "orb/models/beta_set_default_plan_version_params"
|
|
83
77
|
require_relative "orb/models/billable_metric"
|
|
84
78
|
require_relative "orb/models/billable_metric_edited_webhook_event"
|
|
85
79
|
require_relative "orb/models/billable_metric_tiny"
|
|
@@ -436,16 +430,29 @@ require_relative "orb/models/per_price_cost"
|
|
|
436
430
|
require_relative "orb/models/plan"
|
|
437
431
|
require_relative "orb/models/plan_created_webhook_event"
|
|
438
432
|
require_relative "orb/models/plan_create_params"
|
|
433
|
+
require_relative "orb/models/plan_create_plan_version_params"
|
|
439
434
|
require_relative "orb/models/plan_default_version_set_webhook_event"
|
|
440
435
|
require_relative "orb/models/plan_edited_webhook_event"
|
|
441
436
|
require_relative "orb/models/plan_fetch_params"
|
|
437
|
+
require_relative "orb/models/plan_fetch_plan_version_params"
|
|
442
438
|
require_relative "orb/models/plan_list_params"
|
|
443
439
|
require_relative "orb/models/plan_phase_amount_discount_adjustment"
|
|
444
440
|
require_relative "orb/models/plan_phase_maximum_adjustment"
|
|
445
441
|
require_relative "orb/models/plan_phase_minimum_adjustment"
|
|
446
442
|
require_relative "orb/models/plan_phase_percentage_discount_adjustment"
|
|
447
443
|
require_relative "orb/models/plan_phase_usage_discount_adjustment"
|
|
444
|
+
require_relative "orb/models/plans/draft_discard_params"
|
|
445
|
+
require_relative "orb/models/plans/draft_fetch_params"
|
|
446
|
+
require_relative "orb/models/plans/draft_publish_params"
|
|
447
|
+
require_relative "orb/models/plans/draft_save_params"
|
|
448
|
+
require_relative "orb/models/plans/external_plan_id/draft_discard_params"
|
|
449
|
+
require_relative "orb/models/plans/external_plan_id/draft_fetch_params"
|
|
450
|
+
require_relative "orb/models/plans/external_plan_id/draft_publish_params"
|
|
451
|
+
require_relative "orb/models/plans/external_plan_id/draft_save_params"
|
|
452
|
+
require_relative "orb/models/plans/external_plan_id_create_plan_version_params"
|
|
448
453
|
require_relative "orb/models/plans/external_plan_id_fetch_params"
|
|
454
|
+
require_relative "orb/models/plans/external_plan_id_fetch_plan_version_params"
|
|
455
|
+
require_relative "orb/models/plans/external_plan_id_set_default_plan_version_params"
|
|
449
456
|
require_relative "orb/models/plans/external_plan_id_update_params"
|
|
450
457
|
require_relative "orb/models/plans/migration_cancel_params"
|
|
451
458
|
require_relative "orb/models/plans/migration_cancel_response"
|
|
@@ -453,6 +460,8 @@ require_relative "orb/models/plans/migration_list_params"
|
|
|
453
460
|
require_relative "orb/models/plans/migration_list_response"
|
|
454
461
|
require_relative "orb/models/plans/migration_retrieve_params"
|
|
455
462
|
require_relative "orb/models/plans/migration_retrieve_response"
|
|
463
|
+
require_relative "orb/models/plans/plan_version_draft"
|
|
464
|
+
require_relative "orb/models/plan_set_default_plan_version_params"
|
|
456
465
|
require_relative "orb/models/plan_update_params"
|
|
457
466
|
require_relative "orb/models/plan_version"
|
|
458
467
|
require_relative "orb/models/plan_version_created_webhook_event"
|
|
@@ -645,8 +654,6 @@ require_relative "orb/models/webhooks/unwrap_standard_webhook_event"
|
|
|
645
654
|
require_relative "orb/models/webhook_unwrap_params"
|
|
646
655
|
require_relative "orb/models"
|
|
647
656
|
require_relative "orb/resources/alerts"
|
|
648
|
-
require_relative "orb/resources/beta"
|
|
649
|
-
require_relative "orb/resources/beta/external_plan_id"
|
|
650
657
|
require_relative "orb/resources/coupons"
|
|
651
658
|
require_relative "orb/resources/coupons/subscriptions"
|
|
652
659
|
require_relative "orb/resources/credit_blocks"
|
|
@@ -674,7 +681,9 @@ require_relative "orb/resources/metrics"
|
|
|
674
681
|
require_relative "orb/resources/migrations"
|
|
675
682
|
require_relative "orb/resources/migrations/subscriptions"
|
|
676
683
|
require_relative "orb/resources/plans"
|
|
684
|
+
require_relative "orb/resources/plans/draft"
|
|
677
685
|
require_relative "orb/resources/plans/external_plan_id"
|
|
686
|
+
require_relative "orb/resources/plans/external_plan_id/draft"
|
|
678
687
|
require_relative "orb/resources/plans/migrations"
|
|
679
688
|
require_relative "orb/resources/prices"
|
|
680
689
|
require_relative "orb/resources/prices/external_price_id"
|
data/rbi/orb/client.rbi
CHANGED
|
@@ -22,13 +22,6 @@ module Orb
|
|
|
22
22
|
sig { returns(Orb::Resources::TopLevel) }
|
|
23
23
|
attr_reader :top_level
|
|
24
24
|
|
|
25
|
-
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
|
|
26
|
-
# subscribed to by a customer. Plans define the billing behavior of the
|
|
27
|
-
# subscription. You can see more about how to configure prices in the
|
|
28
|
-
# [Price resource](/reference/price).
|
|
29
|
-
sig { returns(Orb::Resources::Beta) }
|
|
30
|
-
attr_reader :beta
|
|
31
|
-
|
|
32
25
|
# A coupon represents a reusable discount configuration that can be applied either
|
|
33
26
|
# as a fixed or percentage amount to an invoice or subscription. Coupons are
|
|
34
27
|
# activated using a redemption code, which applies the discount to a subscription
|
|
@@ -74,6 +74,14 @@ module Orb
|
|
|
74
74
|
sig { returns(T.nilable(String)) }
|
|
75
75
|
attr_accessor :reason
|
|
76
76
|
|
|
77
|
+
# A new migration waits 5 minutes before it changes any subscriptions, so it can
|
|
78
|
+
# be canceled. When true, it starts right away instead.
|
|
79
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
80
|
+
attr_reader :skip_grace_period
|
|
81
|
+
|
|
82
|
+
sig { params(skip_grace_period: T::Boolean).void }
|
|
83
|
+
attr_writer :skip_grace_period
|
|
84
|
+
|
|
77
85
|
# Migrate subscriptions with these statuses. Defaults to active subscriptions.
|
|
78
86
|
sig do
|
|
79
87
|
returns(
|
|
@@ -103,6 +111,7 @@ module Orb
|
|
|
103
111
|
plan_id: T.nilable(String),
|
|
104
112
|
plan_version_numbers: T.nilable(T::Array[Integer]),
|
|
105
113
|
reason: T.nilable(String),
|
|
114
|
+
skip_grace_period: T::Boolean,
|
|
106
115
|
statuses: T::Array[Orb::MigrationCreateParams::Status::OrSymbol],
|
|
107
116
|
request_options: Orb::RequestOptions::OrHash
|
|
108
117
|
).returns(T.attached_class)
|
|
@@ -141,6 +150,9 @@ module Orb
|
|
|
141
150
|
plan_version_numbers: nil,
|
|
142
151
|
# Why the migration was created.
|
|
143
152
|
reason: nil,
|
|
153
|
+
# A new migration waits 5 minutes before it changes any subscriptions, so it can
|
|
154
|
+
# be canceled. When true, it starts right away instead.
|
|
155
|
+
skip_grace_period: nil,
|
|
144
156
|
# Migrate subscriptions with these statuses. Defaults to active subscriptions.
|
|
145
157
|
statuses: nil,
|
|
146
158
|
request_options: {}
|
|
@@ -162,6 +174,7 @@ module Orb
|
|
|
162
174
|
plan_id: T.nilable(String),
|
|
163
175
|
plan_version_numbers: T.nilable(T::Array[Integer]),
|
|
164
176
|
reason: T.nilable(String),
|
|
177
|
+
skip_grace_period: T::Boolean,
|
|
165
178
|
statuses: T::Array[Orb::MigrationCreateParams::Status::OrSymbol],
|
|
166
179
|
request_options: Orb::RequestOptions
|
|
167
180
|
}
|
data/rbi/orb/models/plan.rbi
CHANGED
|
@@ -51,6 +51,10 @@ module Orb
|
|
|
51
51
|
sig { returns(T.nilable(String)) }
|
|
52
52
|
attr_accessor :external_plan_id
|
|
53
53
|
|
|
54
|
+
# Whether the plan has an unpublished draft version.
|
|
55
|
+
sig { returns(T::Boolean) }
|
|
56
|
+
attr_accessor :has_draft
|
|
57
|
+
|
|
54
58
|
# An ISO 4217 currency string for which this plan is billed in. Matches `currency`
|
|
55
59
|
# unless `currency` is a custom pricing unit.
|
|
56
60
|
sig { returns(String) }
|
|
@@ -153,6 +157,7 @@ module Orb
|
|
|
153
157
|
)
|
|
154
158
|
),
|
|
155
159
|
external_plan_id: T.nilable(String),
|
|
160
|
+
has_draft: T::Boolean,
|
|
156
161
|
invoicing_currency: String,
|
|
157
162
|
maximum: T.nilable(Orb::Maximum::OrHash),
|
|
158
163
|
maximum_amount: T.nilable(String),
|
|
@@ -234,6 +239,8 @@ module Orb
|
|
|
234
239
|
# as an alias for this Plan. Use this field to identify a plan by an existing
|
|
235
240
|
# identifier in your system.
|
|
236
241
|
external_plan_id:,
|
|
242
|
+
# Whether the plan has an unpublished draft version.
|
|
243
|
+
has_draft:,
|
|
237
244
|
# An ISO 4217 currency string for which this plan is billed in. Matches `currency`
|
|
238
245
|
# unless `currency` is a custom pricing unit.
|
|
239
246
|
invoicing_currency:,
|
|
@@ -277,6 +284,7 @@ module Orb
|
|
|
277
284
|
description: String,
|
|
278
285
|
discount: T.nilable(Orb::Discount::Variants),
|
|
279
286
|
external_plan_id: T.nilable(String),
|
|
287
|
+
has_draft: T::Boolean,
|
|
280
288
|
invoicing_currency: String,
|
|
281
289
|
maximum: T.nilable(Orb::Maximum),
|
|
282
290
|
maximum_amount: T.nilable(String),
|