orb-billing 1.57.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 +8 -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/{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/{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/{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
|
@@ -2,65 +2,94 @@
|
|
|
2
2
|
|
|
3
3
|
module Orb
|
|
4
4
|
module Resources
|
|
5
|
-
class
|
|
5
|
+
class Plans
|
|
6
6
|
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
|
|
7
7
|
# subscribed to by a customer. Plans define the billing behavior of the
|
|
8
8
|
# subscription. You can see more about how to configure prices in the
|
|
9
9
|
# [Price resource](/reference/price).
|
|
10
|
-
class
|
|
11
|
-
# This endpoint
|
|
10
|
+
class Draft
|
|
11
|
+
# This endpoint discards the plan's draft version. Prices and adjustments the
|
|
12
|
+
# draft created stay in the Pricebook.
|
|
12
13
|
sig do
|
|
13
14
|
params(
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
plan_id: String,
|
|
16
|
+
request_options: Orb::RequestOptions::OrHash
|
|
17
|
+
).void
|
|
18
|
+
end
|
|
19
|
+
def discard(plan_id, request_options: {})
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# This endpoint returns the plan's unpublished draft version, with its changes
|
|
23
|
+
# applied on top of the latest published version. It returns a 404 if the plan has
|
|
24
|
+
# no draft.
|
|
25
|
+
sig do
|
|
26
|
+
params(
|
|
27
|
+
plan_id: String,
|
|
28
|
+
request_options: Orb::RequestOptions::OrHash
|
|
29
|
+
).returns(Orb::Plans::PlanVersionDraft)
|
|
30
|
+
end
|
|
31
|
+
def fetch(plan_id, request_options: {})
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# This endpoint publishes the plan's draft as the next numbered version. A draft
|
|
35
|
+
# that fails plan version validation is a 400 and is left as it was.
|
|
36
|
+
sig do
|
|
37
|
+
params(
|
|
38
|
+
plan_id: String,
|
|
39
|
+
set_as_default: T::Boolean,
|
|
40
|
+
request_options: Orb::RequestOptions::OrHash
|
|
41
|
+
).returns(Orb::PlanVersion)
|
|
42
|
+
end
|
|
43
|
+
def publish(
|
|
44
|
+
plan_id,
|
|
45
|
+
# Also make the new version the plan's default.
|
|
46
|
+
set_as_default: nil,
|
|
47
|
+
request_options: {}
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# This endpoint creates the plan's draft version or fully replaces its changes.
|
|
52
|
+
# The changes are always relative to the latest published version. A save replaces
|
|
53
|
+
# the draft; last write wins.
|
|
54
|
+
sig do
|
|
55
|
+
params(
|
|
56
|
+
plan_id: String,
|
|
16
57
|
add_adjustments:
|
|
17
58
|
T.nilable(
|
|
18
|
-
T::Array[
|
|
19
|
-
Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddAdjustment::OrHash
|
|
20
|
-
]
|
|
59
|
+
T::Array[Orb::Plans::DraftSaveParams::AddAdjustment::OrHash]
|
|
21
60
|
),
|
|
22
61
|
add_prices:
|
|
23
62
|
T.nilable(
|
|
24
|
-
T::Array[
|
|
25
|
-
Orb::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice::OrHash
|
|
26
|
-
]
|
|
63
|
+
T::Array[Orb::Plans::DraftSaveParams::AddPrice::OrHash]
|
|
27
64
|
),
|
|
65
|
+
description: T.nilable(String),
|
|
28
66
|
remove_adjustments:
|
|
29
67
|
T.nilable(
|
|
30
|
-
T::Array[
|
|
31
|
-
Orb::Beta::ExternalPlanIDCreatePlanVersionParams::RemoveAdjustment::OrHash
|
|
32
|
-
]
|
|
68
|
+
T::Array[Orb::Plans::DraftSaveParams::RemoveAdjustment::OrHash]
|
|
33
69
|
),
|
|
34
70
|
remove_prices:
|
|
35
71
|
T.nilable(
|
|
36
|
-
T::Array[
|
|
37
|
-
Orb::Beta::ExternalPlanIDCreatePlanVersionParams::RemovePrice::OrHash
|
|
38
|
-
]
|
|
72
|
+
T::Array[Orb::Plans::DraftSaveParams::RemovePrice::OrHash]
|
|
39
73
|
),
|
|
40
74
|
replace_adjustments:
|
|
41
75
|
T.nilable(
|
|
42
|
-
T::Array[
|
|
43
|
-
Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplaceAdjustment::OrHash
|
|
44
|
-
]
|
|
76
|
+
T::Array[Orb::Plans::DraftSaveParams::ReplaceAdjustment::OrHash]
|
|
45
77
|
),
|
|
46
78
|
replace_prices:
|
|
47
79
|
T.nilable(
|
|
48
|
-
T::Array[
|
|
49
|
-
Orb::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::OrHash
|
|
50
|
-
]
|
|
80
|
+
T::Array[Orb::Plans::DraftSaveParams::ReplacePrice::OrHash]
|
|
51
81
|
),
|
|
52
|
-
set_as_default: T.nilable(T::Boolean),
|
|
53
82
|
request_options: Orb::RequestOptions::OrHash
|
|
54
|
-
).returns(Orb::
|
|
83
|
+
).returns(Orb::Plans::PlanVersionDraft)
|
|
55
84
|
end
|
|
56
|
-
def
|
|
57
|
-
|
|
58
|
-
# New version number.
|
|
59
|
-
version:,
|
|
85
|
+
def save(
|
|
86
|
+
plan_id,
|
|
60
87
|
# Additional adjustments to be added to the plan.
|
|
61
88
|
add_adjustments: nil,
|
|
62
89
|
# Additional prices to be added to the plan.
|
|
63
90
|
add_prices: nil,
|
|
91
|
+
# Optional description of what changes in this draft
|
|
92
|
+
description: nil,
|
|
64
93
|
# Adjustments to be removed from the plan.
|
|
65
94
|
remove_adjustments: nil,
|
|
66
95
|
# Prices to be removed from the plan.
|
|
@@ -69,36 +98,6 @@ module Orb
|
|
|
69
98
|
replace_adjustments: nil,
|
|
70
99
|
# Prices to be replaced with additional prices on the plan.
|
|
71
100
|
replace_prices: nil,
|
|
72
|
-
# Set this new plan version as the default
|
|
73
|
-
set_as_default: nil,
|
|
74
|
-
request_options: {}
|
|
75
|
-
)
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
# This endpoint is used to fetch a plan version. It returns the phases, prices,
|
|
79
|
-
# and adjustments present on this version of the plan.
|
|
80
|
-
sig do
|
|
81
|
-
params(
|
|
82
|
-
version: String,
|
|
83
|
-
external_plan_id: String,
|
|
84
|
-
request_options: Orb::RequestOptions::OrHash
|
|
85
|
-
).returns(Orb::PlanVersion)
|
|
86
|
-
end
|
|
87
|
-
def fetch_plan_version(version, external_plan_id:, request_options: {})
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
# This endpoint allows setting the default version of a plan.
|
|
91
|
-
sig do
|
|
92
|
-
params(
|
|
93
|
-
external_plan_id: String,
|
|
94
|
-
version: Integer,
|
|
95
|
-
request_options: Orb::RequestOptions::OrHash
|
|
96
|
-
).returns(Orb::Plan)
|
|
97
|
-
end
|
|
98
|
-
def set_default_plan_version(
|
|
99
|
-
external_plan_id,
|
|
100
|
-
# Plan version to set as the default.
|
|
101
|
-
version:,
|
|
102
101
|
request_options: {}
|
|
103
102
|
)
|
|
104
103
|
end
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Orb
|
|
4
|
+
module Resources
|
|
5
|
+
class Plans
|
|
6
|
+
class ExternalPlanID
|
|
7
|
+
# The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
|
|
8
|
+
# subscribed to by a customer. Plans define the billing behavior of the
|
|
9
|
+
# subscription. You can see more about how to configure prices in the
|
|
10
|
+
# [Price resource](/reference/price).
|
|
11
|
+
class Draft
|
|
12
|
+
# This endpoint discards the plan's draft version. Prices and adjustments the
|
|
13
|
+
# draft created stay in the Pricebook.
|
|
14
|
+
sig do
|
|
15
|
+
params(
|
|
16
|
+
external_plan_id: String,
|
|
17
|
+
request_options: Orb::RequestOptions::OrHash
|
|
18
|
+
).void
|
|
19
|
+
end
|
|
20
|
+
def discard(external_plan_id, request_options: {})
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# This endpoint returns the plan's unpublished draft version, with its changes
|
|
24
|
+
# applied on top of the latest published version. It returns a 404 if the plan has
|
|
25
|
+
# no draft.
|
|
26
|
+
sig do
|
|
27
|
+
params(
|
|
28
|
+
external_plan_id: String,
|
|
29
|
+
request_options: Orb::RequestOptions::OrHash
|
|
30
|
+
).returns(Orb::Plans::PlanVersionDraft)
|
|
31
|
+
end
|
|
32
|
+
def fetch(external_plan_id, request_options: {})
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# This endpoint publishes the plan's draft as the next numbered version. A draft
|
|
36
|
+
# that fails plan version validation is a 400 and is left as it was.
|
|
37
|
+
sig do
|
|
38
|
+
params(
|
|
39
|
+
external_plan_id: String,
|
|
40
|
+
set_as_default: T::Boolean,
|
|
41
|
+
request_options: Orb::RequestOptions::OrHash
|
|
42
|
+
).returns(Orb::PlanVersion)
|
|
43
|
+
end
|
|
44
|
+
def publish(
|
|
45
|
+
external_plan_id,
|
|
46
|
+
# Also make the new version the plan's default.
|
|
47
|
+
set_as_default: nil,
|
|
48
|
+
request_options: {}
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# This endpoint creates the plan's draft version or fully replaces its changes.
|
|
53
|
+
# The changes are always relative to the latest published version. A save replaces
|
|
54
|
+
# the draft; last write wins.
|
|
55
|
+
sig do
|
|
56
|
+
params(
|
|
57
|
+
external_plan_id: String,
|
|
58
|
+
add_adjustments:
|
|
59
|
+
T.nilable(
|
|
60
|
+
T::Array[
|
|
61
|
+
Orb::Plans::ExternalPlanID::DraftSaveParams::AddAdjustment::OrHash
|
|
62
|
+
]
|
|
63
|
+
),
|
|
64
|
+
add_prices:
|
|
65
|
+
T.nilable(
|
|
66
|
+
T::Array[
|
|
67
|
+
Orb::Plans::ExternalPlanID::DraftSaveParams::AddPrice::OrHash
|
|
68
|
+
]
|
|
69
|
+
),
|
|
70
|
+
description: T.nilable(String),
|
|
71
|
+
remove_adjustments:
|
|
72
|
+
T.nilable(
|
|
73
|
+
T::Array[
|
|
74
|
+
Orb::Plans::ExternalPlanID::DraftSaveParams::RemoveAdjustment::OrHash
|
|
75
|
+
]
|
|
76
|
+
),
|
|
77
|
+
remove_prices:
|
|
78
|
+
T.nilable(
|
|
79
|
+
T::Array[
|
|
80
|
+
Orb::Plans::ExternalPlanID::DraftSaveParams::RemovePrice::OrHash
|
|
81
|
+
]
|
|
82
|
+
),
|
|
83
|
+
replace_adjustments:
|
|
84
|
+
T.nilable(
|
|
85
|
+
T::Array[
|
|
86
|
+
Orb::Plans::ExternalPlanID::DraftSaveParams::ReplaceAdjustment::OrHash
|
|
87
|
+
]
|
|
88
|
+
),
|
|
89
|
+
replace_prices:
|
|
90
|
+
T.nilable(
|
|
91
|
+
T::Array[
|
|
92
|
+
Orb::Plans::ExternalPlanID::DraftSaveParams::ReplacePrice::OrHash
|
|
93
|
+
]
|
|
94
|
+
),
|
|
95
|
+
request_options: Orb::RequestOptions::OrHash
|
|
96
|
+
).returns(Orb::Plans::PlanVersionDraft)
|
|
97
|
+
end
|
|
98
|
+
def save(
|
|
99
|
+
external_plan_id,
|
|
100
|
+
# Additional adjustments to be added to the plan.
|
|
101
|
+
add_adjustments: nil,
|
|
102
|
+
# Additional prices to be added to the plan.
|
|
103
|
+
add_prices: nil,
|
|
104
|
+
# Optional description of what changes in this draft
|
|
105
|
+
description: nil,
|
|
106
|
+
# Adjustments to be removed from the plan.
|
|
107
|
+
remove_adjustments: nil,
|
|
108
|
+
# Prices to be removed from the plan.
|
|
109
|
+
remove_prices: nil,
|
|
110
|
+
# Adjustments to be replaced with additional adjustments on the plan.
|
|
111
|
+
replace_adjustments: nil,
|
|
112
|
+
# Prices to be replaced with additional prices on the plan.
|
|
113
|
+
replace_prices: nil,
|
|
114
|
+
request_options: {}
|
|
115
|
+
)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# @api private
|
|
119
|
+
sig { params(client: Orb::Client).returns(T.attached_class) }
|
|
120
|
+
def self.new(client:)
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
end
|
|
@@ -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
|
+
sig { returns(Orb::Resources::Plans::ExternalPlanID::Draft) }
|
|
16
|
+
attr_reader :draft
|
|
17
|
+
|
|
11
18
|
# This endpoint can be used to update the `name`, `external_plan_id`,
|
|
12
19
|
# `description`, and `metadata` of an existing plan. A plan's `name` cannot be
|
|
13
20
|
# empty.
|
|
@@ -41,6 +48,73 @@ module Orb
|
|
|
41
48
|
)
|
|
42
49
|
end
|
|
43
50
|
|
|
51
|
+
# This endpoint allows the creation of a new plan version for an existing plan.
|
|
52
|
+
sig do
|
|
53
|
+
params(
|
|
54
|
+
external_plan_id: String,
|
|
55
|
+
version: Integer,
|
|
56
|
+
add_adjustments:
|
|
57
|
+
T.nilable(
|
|
58
|
+
T::Array[
|
|
59
|
+
Orb::Plans::ExternalPlanIDCreatePlanVersionParams::AddAdjustment::OrHash
|
|
60
|
+
]
|
|
61
|
+
),
|
|
62
|
+
add_prices:
|
|
63
|
+
T.nilable(
|
|
64
|
+
T::Array[
|
|
65
|
+
Orb::Plans::ExternalPlanIDCreatePlanVersionParams::AddPrice::OrHash
|
|
66
|
+
]
|
|
67
|
+
),
|
|
68
|
+
remove_adjustments:
|
|
69
|
+
T.nilable(
|
|
70
|
+
T::Array[
|
|
71
|
+
Orb::Plans::ExternalPlanIDCreatePlanVersionParams::RemoveAdjustment::OrHash
|
|
72
|
+
]
|
|
73
|
+
),
|
|
74
|
+
remove_prices:
|
|
75
|
+
T.nilable(
|
|
76
|
+
T::Array[
|
|
77
|
+
Orb::Plans::ExternalPlanIDCreatePlanVersionParams::RemovePrice::OrHash
|
|
78
|
+
]
|
|
79
|
+
),
|
|
80
|
+
replace_adjustments:
|
|
81
|
+
T.nilable(
|
|
82
|
+
T::Array[
|
|
83
|
+
Orb::Plans::ExternalPlanIDCreatePlanVersionParams::ReplaceAdjustment::OrHash
|
|
84
|
+
]
|
|
85
|
+
),
|
|
86
|
+
replace_prices:
|
|
87
|
+
T.nilable(
|
|
88
|
+
T::Array[
|
|
89
|
+
Orb::Plans::ExternalPlanIDCreatePlanVersionParams::ReplacePrice::OrHash
|
|
90
|
+
]
|
|
91
|
+
),
|
|
92
|
+
set_as_default: T.nilable(T::Boolean),
|
|
93
|
+
request_options: Orb::RequestOptions::OrHash
|
|
94
|
+
).returns(Orb::PlanVersion)
|
|
95
|
+
end
|
|
96
|
+
def create_plan_version(
|
|
97
|
+
external_plan_id,
|
|
98
|
+
# New version number.
|
|
99
|
+
version:,
|
|
100
|
+
# Additional adjustments to be added to the plan.
|
|
101
|
+
add_adjustments: nil,
|
|
102
|
+
# Additional prices to be added to the plan.
|
|
103
|
+
add_prices: nil,
|
|
104
|
+
# Adjustments to be removed from the plan.
|
|
105
|
+
remove_adjustments: nil,
|
|
106
|
+
# Prices to be removed from the plan.
|
|
107
|
+
remove_prices: nil,
|
|
108
|
+
# Adjustments to be replaced with additional adjustments on the plan.
|
|
109
|
+
replace_adjustments: nil,
|
|
110
|
+
# Prices to be replaced with additional prices on the plan.
|
|
111
|
+
replace_prices: nil,
|
|
112
|
+
# Set this new plan version as the default
|
|
113
|
+
set_as_default: nil,
|
|
114
|
+
request_options: {}
|
|
115
|
+
)
|
|
116
|
+
end
|
|
117
|
+
|
|
44
118
|
# This endpoint is used to fetch [plan](/core-concepts##plan-and-price) details
|
|
45
119
|
# given an external_plan_id identifier. It returns information about the prices
|
|
46
120
|
# included in the plan and their configuration, as well as the product that the
|
|
@@ -66,6 +140,34 @@ module Orb
|
|
|
66
140
|
def fetch(external_plan_id, request_options: {})
|
|
67
141
|
end
|
|
68
142
|
|
|
143
|
+
# This endpoint is used to fetch a plan version. It returns the phases, prices,
|
|
144
|
+
# and adjustments present on this version of the plan.
|
|
145
|
+
sig do
|
|
146
|
+
params(
|
|
147
|
+
version: String,
|
|
148
|
+
external_plan_id: String,
|
|
149
|
+
request_options: Orb::RequestOptions::OrHash
|
|
150
|
+
).returns(Orb::PlanVersion)
|
|
151
|
+
end
|
|
152
|
+
def fetch_plan_version(version, external_plan_id:, request_options: {})
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# This endpoint allows setting the default version of a plan.
|
|
156
|
+
sig do
|
|
157
|
+
params(
|
|
158
|
+
external_plan_id: String,
|
|
159
|
+
version: Integer,
|
|
160
|
+
request_options: Orb::RequestOptions::OrHash
|
|
161
|
+
).returns(Orb::Plan)
|
|
162
|
+
end
|
|
163
|
+
def set_default_plan_version(
|
|
164
|
+
external_plan_id,
|
|
165
|
+
# Plan version to set as the default.
|
|
166
|
+
version:,
|
|
167
|
+
request_options: {}
|
|
168
|
+
)
|
|
169
|
+
end
|
|
170
|
+
|
|
69
171
|
# @api private
|
|
70
172
|
sig { params(client: Orb::Client).returns(T.attached_class) }
|
|
71
173
|
def self.new(client:)
|
data/rbi/orb/resources/plans.rbi
CHANGED
|
@@ -14,6 +14,13 @@ module Orb
|
|
|
14
14
|
sig { returns(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
|
+
sig { returns(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
|
|
@@ -140,6 +147,65 @@ module Orb
|
|
|
140
147
|
)
|
|
141
148
|
end
|
|
142
149
|
|
|
150
|
+
# This endpoint allows the creation of a new plan version for an existing plan.
|
|
151
|
+
sig do
|
|
152
|
+
params(
|
|
153
|
+
plan_id: String,
|
|
154
|
+
version: Integer,
|
|
155
|
+
add_adjustments:
|
|
156
|
+
T.nilable(
|
|
157
|
+
T::Array[Orb::PlanCreatePlanVersionParams::AddAdjustment::OrHash]
|
|
158
|
+
),
|
|
159
|
+
add_prices:
|
|
160
|
+
T.nilable(
|
|
161
|
+
T::Array[Orb::PlanCreatePlanVersionParams::AddPrice::OrHash]
|
|
162
|
+
),
|
|
163
|
+
remove_adjustments:
|
|
164
|
+
T.nilable(
|
|
165
|
+
T::Array[
|
|
166
|
+
Orb::PlanCreatePlanVersionParams::RemoveAdjustment::OrHash
|
|
167
|
+
]
|
|
168
|
+
),
|
|
169
|
+
remove_prices:
|
|
170
|
+
T.nilable(
|
|
171
|
+
T::Array[Orb::PlanCreatePlanVersionParams::RemovePrice::OrHash]
|
|
172
|
+
),
|
|
173
|
+
replace_adjustments:
|
|
174
|
+
T.nilable(
|
|
175
|
+
T::Array[
|
|
176
|
+
Orb::PlanCreatePlanVersionParams::ReplaceAdjustment::OrHash
|
|
177
|
+
]
|
|
178
|
+
),
|
|
179
|
+
replace_prices:
|
|
180
|
+
T.nilable(
|
|
181
|
+
T::Array[Orb::PlanCreatePlanVersionParams::ReplacePrice::OrHash]
|
|
182
|
+
),
|
|
183
|
+
set_as_default: T.nilable(T::Boolean),
|
|
184
|
+
request_options: Orb::RequestOptions::OrHash
|
|
185
|
+
).returns(Orb::PlanVersion)
|
|
186
|
+
end
|
|
187
|
+
def create_plan_version(
|
|
188
|
+
plan_id,
|
|
189
|
+
# New version number.
|
|
190
|
+
version:,
|
|
191
|
+
# Additional adjustments to be added to the plan.
|
|
192
|
+
add_adjustments: nil,
|
|
193
|
+
# Additional prices to be added to the plan.
|
|
194
|
+
add_prices: nil,
|
|
195
|
+
# Adjustments to be removed from the plan.
|
|
196
|
+
remove_adjustments: nil,
|
|
197
|
+
# Prices to be removed from the plan.
|
|
198
|
+
remove_prices: nil,
|
|
199
|
+
# Adjustments to be replaced with additional adjustments on the plan.
|
|
200
|
+
replace_adjustments: nil,
|
|
201
|
+
# Prices to be replaced with additional prices on the plan.
|
|
202
|
+
replace_prices: nil,
|
|
203
|
+
# Set this new plan version as the default
|
|
204
|
+
set_as_default: nil,
|
|
205
|
+
request_options: {}
|
|
206
|
+
)
|
|
207
|
+
end
|
|
208
|
+
|
|
143
209
|
# This endpoint is used to fetch [plan](/core-concepts#plan-and-price) details
|
|
144
210
|
# given a plan identifier. It returns information about the prices included in the
|
|
145
211
|
# plan and their configuration, as well as the product that the plan is attached
|
|
@@ -166,6 +232,34 @@ module Orb
|
|
|
166
232
|
def fetch(plan_id, request_options: {})
|
|
167
233
|
end
|
|
168
234
|
|
|
235
|
+
# This endpoint is used to fetch a plan version. It returns the phases, prices,
|
|
236
|
+
# and adjustments present on this version of the plan.
|
|
237
|
+
sig do
|
|
238
|
+
params(
|
|
239
|
+
version: String,
|
|
240
|
+
plan_id: String,
|
|
241
|
+
request_options: Orb::RequestOptions::OrHash
|
|
242
|
+
).returns(Orb::PlanVersion)
|
|
243
|
+
end
|
|
244
|
+
def fetch_plan_version(version, plan_id:, request_options: {})
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# This endpoint allows setting the default version of a plan.
|
|
248
|
+
sig do
|
|
249
|
+
params(
|
|
250
|
+
plan_id: String,
|
|
251
|
+
version: Integer,
|
|
252
|
+
request_options: Orb::RequestOptions::OrHash
|
|
253
|
+
).returns(Orb::Plan)
|
|
254
|
+
end
|
|
255
|
+
def set_default_plan_version(
|
|
256
|
+
plan_id,
|
|
257
|
+
# Plan version to set as the default.
|
|
258
|
+
version:,
|
|
259
|
+
request_options: {}
|
|
260
|
+
)
|
|
261
|
+
end
|
|
262
|
+
|
|
169
263
|
# @api private
|
|
170
264
|
sig { params(client: Orb::Client).returns(T.attached_class) }
|
|
171
265
|
def self.new(client:)
|
data/sig/orb/client.rbs
CHANGED
|
@@ -14,6 +14,7 @@ module Orb
|
|
|
14
14
|
plan_id: String?,
|
|
15
15
|
plan_version_numbers: ::Array[Integer]?,
|
|
16
16
|
reason: String?,
|
|
17
|
+
skip_grace_period: bool,
|
|
17
18
|
statuses: ::Array[Orb::Models::MigrationCreateParams::status]
|
|
18
19
|
}
|
|
19
20
|
& Orb::Internal::Type::request_parameters
|
|
@@ -50,6 +51,10 @@ module Orb
|
|
|
50
51
|
|
|
51
52
|
attr_accessor reason: String?
|
|
52
53
|
|
|
54
|
+
attr_reader skip_grace_period: bool?
|
|
55
|
+
|
|
56
|
+
def skip_grace_period=: (bool) -> bool
|
|
57
|
+
|
|
53
58
|
attr_reader statuses: ::Array[Orb::Models::MigrationCreateParams::status]?
|
|
54
59
|
|
|
55
60
|
def statuses=: (
|
|
@@ -69,6 +74,7 @@ module Orb
|
|
|
69
74
|
?plan_id: String?,
|
|
70
75
|
?plan_version_numbers: ::Array[Integer]?,
|
|
71
76
|
?reason: String?,
|
|
77
|
+
?skip_grace_period: bool,
|
|
72
78
|
?statuses: ::Array[Orb::Models::MigrationCreateParams::status],
|
|
73
79
|
?request_options: Orb::request_opts
|
|
74
80
|
) -> void
|
|
@@ -86,6 +92,7 @@ module Orb
|
|
|
86
92
|
plan_id: String?,
|
|
87
93
|
plan_version_numbers: ::Array[Integer]?,
|
|
88
94
|
reason: String?,
|
|
95
|
+
skip_grace_period: bool,
|
|
89
96
|
statuses: ::Array[Orb::Models::MigrationCreateParams::status],
|
|
90
97
|
request_options: Orb::RequestOptions
|
|
91
98
|
}
|