orb-billing 1.55.0 → 1.57.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 +16 -0
- data/README.md +1 -1
- data/lib/orb/client.rb +7 -0
- data/lib/orb/models/metric_update_params.rb +4 -3
- data/lib/orb/models/migration_cancel_params.rb +20 -0
- data/lib/orb/models/migration_cancel_response.rb +133 -0
- data/lib/orb/models/migration_create_params.rb +159 -0
- data/lib/orb/models/migration_create_response.rb +133 -0
- data/lib/orb/models/migration_list_params.rb +48 -0
- data/lib/orb/models/migration_list_response.rb +133 -0
- data/lib/orb/models/migration_retrieve_params.rb +20 -0
- data/lib/orb/models/migration_retrieve_response.rb +133 -0
- data/lib/orb/models/migration_subscription.rb +75 -0
- data/lib/orb/models/migrations/subscription_list_params.rb +74 -0
- data/lib/orb/models/plan.rb +9 -1
- data/lib/orb/models/plans/migration_cancel_response.rb +28 -8
- data/lib/orb/models/plans/migration_list_response.rb +28 -8
- data/lib/orb/models/plans/migration_retrieve_response.rb +28 -8
- data/lib/orb/models.rb +12 -0
- data/lib/orb/resources/metrics.rb +11 -10
- data/lib/orb/resources/migrations/subscriptions.rb +60 -0
- data/lib/orb/resources/migrations.rb +153 -0
- data/lib/orb/version.rb +1 -1
- data/lib/orb.rb +12 -0
- data/rbi/orb/client.rbi +6 -0
- data/rbi/orb/models/metric_update_params.rbi +6 -4
- data/rbi/orb/models/migration_cancel_params.rbi +35 -0
- data/rbi/orb/models/migration_cancel_response.rbi +218 -0
- data/rbi/orb/models/migration_create_params.rbi +248 -0
- data/rbi/orb/models/migration_create_response.rbi +218 -0
- data/rbi/orb/models/migration_list_params.rbi +66 -0
- data/rbi/orb/models/migration_list_response.rbi +214 -0
- data/rbi/orb/models/migration_retrieve_params.rbi +35 -0
- data/rbi/orb/models/migration_retrieve_response.rbi +221 -0
- data/rbi/orb/models/migration_subscription.rbi +112 -0
- data/rbi/orb/models/migrations/subscription_list_params.rbi +147 -0
- data/rbi/orb/models/plan.rbi +8 -0
- data/rbi/orb/models/plans/migration_cancel_response.rbi +36 -12
- data/rbi/orb/models/plans/migration_list_response.rbi +36 -12
- data/rbi/orb/models/plans/migration_retrieve_response.rbi +36 -12
- data/rbi/orb/models.rbi +12 -0
- data/rbi/orb/resources/metrics.rbi +13 -11
- data/rbi/orb/resources/migrations/subscriptions.rbi +54 -0
- data/rbi/orb/resources/migrations.rbi +130 -0
- data/sig/orb/client.rbs +2 -0
- data/sig/orb/models/migration_cancel_params.rbs +23 -0
- data/sig/orb/models/migration_cancel_response.rbs +84 -0
- data/sig/orb/models/migration_create_params.rbs +126 -0
- data/sig/orb/models/migration_create_response.rbs +84 -0
- data/sig/orb/models/migration_list_params.rbs +43 -0
- data/sig/orb/models/migration_list_response.rbs +84 -0
- data/sig/orb/models/migration_retrieve_params.rbs +23 -0
- data/sig/orb/models/migration_retrieve_response.rbs +84 -0
- data/sig/orb/models/migration_subscription.rbs +54 -0
- data/sig/orb/models/migrations/subscription_list_params.rbs +64 -0
- data/sig/orb/models/plan.rbs +5 -0
- data/sig/orb/models/plans/migration_cancel_response.rbs +17 -4
- data/sig/orb/models/plans/migration_list_response.rbs +17 -4
- data/sig/orb/models/plans/migration_retrieve_response.rbs +17 -4
- data/sig/orb/models.rbs +12 -0
- data/sig/orb/resources/migrations/subscriptions.rbs +18 -0
- data/sig/orb/resources/migrations.rbs +44 -0
- metadata +37 -1
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Orb
|
|
4
|
+
module Models
|
|
5
|
+
module Migrations
|
|
6
|
+
class SubscriptionListParams < Orb::Internal::Type::BaseModel
|
|
7
|
+
extend Orb::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Orb::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Orb::Migrations::SubscriptionListParams,
|
|
14
|
+
Orb::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :migration_id
|
|
20
|
+
|
|
21
|
+
# Cursor for pagination. This can be populated by the `next_cursor` value returned
|
|
22
|
+
# from the initial request.
|
|
23
|
+
sig { returns(T.nilable(String)) }
|
|
24
|
+
attr_accessor :cursor
|
|
25
|
+
|
|
26
|
+
# The number of items to fetch. Defaults to 20.
|
|
27
|
+
sig { returns(T.nilable(Integer)) }
|
|
28
|
+
attr_reader :limit
|
|
29
|
+
|
|
30
|
+
sig { params(limit: Integer).void }
|
|
31
|
+
attr_writer :limit
|
|
32
|
+
|
|
33
|
+
# Only return subscriptions with one of these statuses.
|
|
34
|
+
sig do
|
|
35
|
+
returns(
|
|
36
|
+
T.nilable(
|
|
37
|
+
T::Array[
|
|
38
|
+
Orb::Migrations::SubscriptionListParams::Status::OrSymbol
|
|
39
|
+
]
|
|
40
|
+
)
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
attr_accessor :status
|
|
44
|
+
|
|
45
|
+
# Only return these subscriptions. Up to 100 IDs.
|
|
46
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
47
|
+
attr_accessor :subscription_id
|
|
48
|
+
|
|
49
|
+
sig do
|
|
50
|
+
params(
|
|
51
|
+
migration_id: String,
|
|
52
|
+
cursor: T.nilable(String),
|
|
53
|
+
limit: Integer,
|
|
54
|
+
status:
|
|
55
|
+
T.nilable(
|
|
56
|
+
T::Array[
|
|
57
|
+
Orb::Migrations::SubscriptionListParams::Status::OrSymbol
|
|
58
|
+
]
|
|
59
|
+
),
|
|
60
|
+
subscription_id: T.nilable(T::Array[String]),
|
|
61
|
+
request_options: Orb::RequestOptions::OrHash
|
|
62
|
+
).returns(T.attached_class)
|
|
63
|
+
end
|
|
64
|
+
def self.new(
|
|
65
|
+
migration_id:,
|
|
66
|
+
# Cursor for pagination. This can be populated by the `next_cursor` value returned
|
|
67
|
+
# from the initial request.
|
|
68
|
+
cursor: nil,
|
|
69
|
+
# The number of items to fetch. Defaults to 20.
|
|
70
|
+
limit: nil,
|
|
71
|
+
# Only return subscriptions with one of these statuses.
|
|
72
|
+
status: nil,
|
|
73
|
+
# Only return these subscriptions. Up to 100 IDs.
|
|
74
|
+
subscription_id: nil,
|
|
75
|
+
request_options: {}
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
sig do
|
|
80
|
+
override.returns(
|
|
81
|
+
{
|
|
82
|
+
migration_id: String,
|
|
83
|
+
cursor: T.nilable(String),
|
|
84
|
+
limit: Integer,
|
|
85
|
+
status:
|
|
86
|
+
T.nilable(
|
|
87
|
+
T::Array[
|
|
88
|
+
Orb::Migrations::SubscriptionListParams::Status::OrSymbol
|
|
89
|
+
]
|
|
90
|
+
),
|
|
91
|
+
subscription_id: T.nilable(T::Array[String]),
|
|
92
|
+
request_options: Orb::RequestOptions
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
end
|
|
96
|
+
def to_hash
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
module Status
|
|
100
|
+
extend Orb::Internal::Type::Enum
|
|
101
|
+
|
|
102
|
+
TaggedSymbol =
|
|
103
|
+
T.type_alias do
|
|
104
|
+
T.all(Symbol, Orb::Migrations::SubscriptionListParams::Status)
|
|
105
|
+
end
|
|
106
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
107
|
+
|
|
108
|
+
SCHEDULING =
|
|
109
|
+
T.let(
|
|
110
|
+
:scheduling,
|
|
111
|
+
Orb::Migrations::SubscriptionListParams::Status::TaggedSymbol
|
|
112
|
+
)
|
|
113
|
+
SCHEDULED =
|
|
114
|
+
T.let(
|
|
115
|
+
:scheduled,
|
|
116
|
+
Orb::Migrations::SubscriptionListParams::Status::TaggedSymbol
|
|
117
|
+
)
|
|
118
|
+
COMPLETED =
|
|
119
|
+
T.let(
|
|
120
|
+
:completed,
|
|
121
|
+
Orb::Migrations::SubscriptionListParams::Status::TaggedSymbol
|
|
122
|
+
)
|
|
123
|
+
SKIPPED =
|
|
124
|
+
T.let(
|
|
125
|
+
:skipped,
|
|
126
|
+
Orb::Migrations::SubscriptionListParams::Status::TaggedSymbol
|
|
127
|
+
)
|
|
128
|
+
FAILED =
|
|
129
|
+
T.let(
|
|
130
|
+
:failed,
|
|
131
|
+
Orb::Migrations::SubscriptionListParams::Status::TaggedSymbol
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
sig do
|
|
135
|
+
override.returns(
|
|
136
|
+
T::Array[
|
|
137
|
+
Orb::Migrations::SubscriptionListParams::Status::TaggedSymbol
|
|
138
|
+
]
|
|
139
|
+
)
|
|
140
|
+
end
|
|
141
|
+
def self.values
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
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),
|
|
@@ -16,9 +16,10 @@ module Orb
|
|
|
16
16
|
sig { returns(String) }
|
|
17
17
|
attr_accessor :id
|
|
18
18
|
|
|
19
|
-
# When the migration takes effect. Can be a specific date/time, '
|
|
20
|
-
# scheduled to be at the end of the current billing
|
|
21
|
-
# when scheduled to be at the
|
|
19
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
20
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
21
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
22
|
+
# start of the current or next invoice.
|
|
22
23
|
sig do
|
|
23
24
|
returns(
|
|
24
25
|
T.nilable(
|
|
@@ -51,6 +52,13 @@ module Orb
|
|
|
51
52
|
end
|
|
52
53
|
attr_accessor :status
|
|
53
54
|
|
|
55
|
+
# The plan version subscriptions are migrated to.
|
|
56
|
+
sig { returns(Integer) }
|
|
57
|
+
attr_accessor :target_plan_version_number
|
|
58
|
+
|
|
59
|
+
# A migration moves a plan's subscriptions onto one of the plan's versions. Each
|
|
60
|
+
# subscription is migrated asynchronously, either immediately or at a scheduled
|
|
61
|
+
# time, and the migration reports its overall status as it progresses.
|
|
54
62
|
sig do
|
|
55
63
|
params(
|
|
56
64
|
id: String,
|
|
@@ -66,15 +74,17 @@ module Orb
|
|
|
66
74
|
plan_id: String,
|
|
67
75
|
started_at: T.nilable(Time),
|
|
68
76
|
status:
|
|
69
|
-
Orb::Models::Plans::MigrationCancelResponse::Status::OrSymbol
|
|
77
|
+
Orb::Models::Plans::MigrationCancelResponse::Status::OrSymbol,
|
|
78
|
+
target_plan_version_number: Integer
|
|
70
79
|
).returns(T.attached_class)
|
|
71
80
|
end
|
|
72
81
|
def self.new(
|
|
73
82
|
# Unique identifier for this plan version change.
|
|
74
83
|
id:,
|
|
75
|
-
# When the migration takes effect. Can be a specific date/time, '
|
|
76
|
-
# scheduled to be at the end of the current billing
|
|
77
|
-
# when scheduled to be at the
|
|
84
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
85
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
86
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
87
|
+
# start of the current or next invoice.
|
|
78
88
|
effective_time:,
|
|
79
89
|
# When the migration completed or was canceled, or null if it is still in
|
|
80
90
|
# progress.
|
|
@@ -86,7 +96,9 @@ module Orb
|
|
|
86
96
|
started_at:,
|
|
87
97
|
# Current status of the migration: 'not_started', 'in_progress', 'completed',
|
|
88
98
|
# 'action_needed', or 'canceled'.
|
|
89
|
-
status
|
|
99
|
+
status:,
|
|
100
|
+
# The plan version subscriptions are migrated to.
|
|
101
|
+
target_plan_version_number:
|
|
90
102
|
)
|
|
91
103
|
end
|
|
92
104
|
|
|
@@ -102,16 +114,18 @@ module Orb
|
|
|
102
114
|
plan_id: String,
|
|
103
115
|
started_at: T.nilable(Time),
|
|
104
116
|
status:
|
|
105
|
-
Orb::Models::Plans::MigrationCancelResponse::Status::TaggedSymbol
|
|
117
|
+
Orb::Models::Plans::MigrationCancelResponse::Status::TaggedSymbol,
|
|
118
|
+
target_plan_version_number: Integer
|
|
106
119
|
}
|
|
107
120
|
)
|
|
108
121
|
end
|
|
109
122
|
def to_hash
|
|
110
123
|
end
|
|
111
124
|
|
|
112
|
-
# When the migration takes effect. Can be a specific date/time, '
|
|
113
|
-
# scheduled to be at the end of the current billing
|
|
114
|
-
# when scheduled to be at the
|
|
125
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
126
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
127
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
128
|
+
# start of the current or next invoice.
|
|
115
129
|
module EffectiveTime
|
|
116
130
|
extend Orb::Internal::Type::Union
|
|
117
131
|
|
|
@@ -143,11 +157,21 @@ module Orb
|
|
|
143
157
|
end
|
|
144
158
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
145
159
|
|
|
160
|
+
START_OF_TERM =
|
|
161
|
+
T.let(
|
|
162
|
+
:start_of_term,
|
|
163
|
+
Orb::Models::Plans::MigrationCancelResponse::EffectiveTime::TaggedSymbol
|
|
164
|
+
)
|
|
146
165
|
END_OF_TERM =
|
|
147
166
|
T.let(
|
|
148
167
|
:end_of_term,
|
|
149
168
|
Orb::Models::Plans::MigrationCancelResponse::EffectiveTime::TaggedSymbol
|
|
150
169
|
)
|
|
170
|
+
START_OF_INVOICE =
|
|
171
|
+
T.let(
|
|
172
|
+
:start_of_invoice,
|
|
173
|
+
Orb::Models::Plans::MigrationCancelResponse::EffectiveTime::TaggedSymbol
|
|
174
|
+
)
|
|
151
175
|
END_OF_INVOICE =
|
|
152
176
|
T.let(
|
|
153
177
|
:end_of_invoice,
|
|
@@ -16,9 +16,10 @@ module Orb
|
|
|
16
16
|
sig { returns(String) }
|
|
17
17
|
attr_accessor :id
|
|
18
18
|
|
|
19
|
-
# When the migration takes effect. Can be a specific date/time, '
|
|
20
|
-
# scheduled to be at the end of the current billing
|
|
21
|
-
# when scheduled to be at the
|
|
19
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
20
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
21
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
22
|
+
# start of the current or next invoice.
|
|
22
23
|
sig do
|
|
23
24
|
returns(
|
|
24
25
|
T.nilable(
|
|
@@ -51,6 +52,13 @@ module Orb
|
|
|
51
52
|
end
|
|
52
53
|
attr_accessor :status
|
|
53
54
|
|
|
55
|
+
# The plan version subscriptions are migrated to.
|
|
56
|
+
sig { returns(Integer) }
|
|
57
|
+
attr_accessor :target_plan_version_number
|
|
58
|
+
|
|
59
|
+
# A migration moves a plan's subscriptions onto one of the plan's versions. Each
|
|
60
|
+
# subscription is migrated asynchronously, either immediately or at a scheduled
|
|
61
|
+
# time, and the migration reports its overall status as it progresses.
|
|
54
62
|
sig do
|
|
55
63
|
params(
|
|
56
64
|
id: String,
|
|
@@ -65,15 +73,17 @@ module Orb
|
|
|
65
73
|
ended_at: T.nilable(Time),
|
|
66
74
|
plan_id: String,
|
|
67
75
|
started_at: T.nilable(Time),
|
|
68
|
-
status: Orb::Models::Plans::MigrationListResponse::Status::OrSymbol
|
|
76
|
+
status: Orb::Models::Plans::MigrationListResponse::Status::OrSymbol,
|
|
77
|
+
target_plan_version_number: Integer
|
|
69
78
|
).returns(T.attached_class)
|
|
70
79
|
end
|
|
71
80
|
def self.new(
|
|
72
81
|
# Unique identifier for this plan version change.
|
|
73
82
|
id:,
|
|
74
|
-
# When the migration takes effect. Can be a specific date/time, '
|
|
75
|
-
# scheduled to be at the end of the current billing
|
|
76
|
-
# when scheduled to be at the
|
|
83
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
84
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
85
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
86
|
+
# start of the current or next invoice.
|
|
77
87
|
effective_time:,
|
|
78
88
|
# When the migration completed or was canceled, or null if it is still in
|
|
79
89
|
# progress.
|
|
@@ -85,7 +95,9 @@ module Orb
|
|
|
85
95
|
started_at:,
|
|
86
96
|
# Current status of the migration: 'not_started', 'in_progress', 'completed',
|
|
87
97
|
# 'action_needed', or 'canceled'.
|
|
88
|
-
status
|
|
98
|
+
status:,
|
|
99
|
+
# The plan version subscriptions are migrated to.
|
|
100
|
+
target_plan_version_number:
|
|
89
101
|
)
|
|
90
102
|
end
|
|
91
103
|
|
|
@@ -101,16 +113,18 @@ module Orb
|
|
|
101
113
|
plan_id: String,
|
|
102
114
|
started_at: T.nilable(Time),
|
|
103
115
|
status:
|
|
104
|
-
Orb::Models::Plans::MigrationListResponse::Status::TaggedSymbol
|
|
116
|
+
Orb::Models::Plans::MigrationListResponse::Status::TaggedSymbol,
|
|
117
|
+
target_plan_version_number: Integer
|
|
105
118
|
}
|
|
106
119
|
)
|
|
107
120
|
end
|
|
108
121
|
def to_hash
|
|
109
122
|
end
|
|
110
123
|
|
|
111
|
-
# When the migration takes effect. Can be a specific date/time, '
|
|
112
|
-
# scheduled to be at the end of the current billing
|
|
113
|
-
# when scheduled to be at the
|
|
124
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
125
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
126
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
127
|
+
# start of the current or next invoice.
|
|
114
128
|
module EffectiveTime
|
|
115
129
|
extend Orb::Internal::Type::Union
|
|
116
130
|
|
|
@@ -142,11 +156,21 @@ module Orb
|
|
|
142
156
|
end
|
|
143
157
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
144
158
|
|
|
159
|
+
START_OF_TERM =
|
|
160
|
+
T.let(
|
|
161
|
+
:start_of_term,
|
|
162
|
+
Orb::Models::Plans::MigrationListResponse::EffectiveTime::TaggedSymbol
|
|
163
|
+
)
|
|
145
164
|
END_OF_TERM =
|
|
146
165
|
T.let(
|
|
147
166
|
:end_of_term,
|
|
148
167
|
Orb::Models::Plans::MigrationListResponse::EffectiveTime::TaggedSymbol
|
|
149
168
|
)
|
|
169
|
+
START_OF_INVOICE =
|
|
170
|
+
T.let(
|
|
171
|
+
:start_of_invoice,
|
|
172
|
+
Orb::Models::Plans::MigrationListResponse::EffectiveTime::TaggedSymbol
|
|
173
|
+
)
|
|
150
174
|
END_OF_INVOICE =
|
|
151
175
|
T.let(
|
|
152
176
|
:end_of_invoice,
|
|
@@ -16,9 +16,10 @@ module Orb
|
|
|
16
16
|
sig { returns(String) }
|
|
17
17
|
attr_accessor :id
|
|
18
18
|
|
|
19
|
-
# When the migration takes effect. Can be a specific date/time, '
|
|
20
|
-
# scheduled to be at the end of the current billing
|
|
21
|
-
# when scheduled to be at the
|
|
19
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
20
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
21
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
22
|
+
# start of the current or next invoice.
|
|
22
23
|
sig do
|
|
23
24
|
returns(
|
|
24
25
|
T.nilable(
|
|
@@ -51,6 +52,13 @@ module Orb
|
|
|
51
52
|
end
|
|
52
53
|
attr_accessor :status
|
|
53
54
|
|
|
55
|
+
# The plan version subscriptions are migrated to.
|
|
56
|
+
sig { returns(Integer) }
|
|
57
|
+
attr_accessor :target_plan_version_number
|
|
58
|
+
|
|
59
|
+
# A migration moves a plan's subscriptions onto one of the plan's versions. Each
|
|
60
|
+
# subscription is migrated asynchronously, either immediately or at a scheduled
|
|
61
|
+
# time, and the migration reports its overall status as it progresses.
|
|
54
62
|
sig do
|
|
55
63
|
params(
|
|
56
64
|
id: String,
|
|
@@ -66,15 +74,17 @@ module Orb
|
|
|
66
74
|
plan_id: String,
|
|
67
75
|
started_at: T.nilable(Time),
|
|
68
76
|
status:
|
|
69
|
-
Orb::Models::Plans::MigrationRetrieveResponse::Status::OrSymbol
|
|
77
|
+
Orb::Models::Plans::MigrationRetrieveResponse::Status::OrSymbol,
|
|
78
|
+
target_plan_version_number: Integer
|
|
70
79
|
).returns(T.attached_class)
|
|
71
80
|
end
|
|
72
81
|
def self.new(
|
|
73
82
|
# Unique identifier for this plan version change.
|
|
74
83
|
id:,
|
|
75
|
-
# When the migration takes effect. Can be a specific date/time, '
|
|
76
|
-
# scheduled to be at the end of the current billing
|
|
77
|
-
# when scheduled to be at the
|
|
84
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
85
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
86
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
87
|
+
# start of the current or next invoice.
|
|
78
88
|
effective_time:,
|
|
79
89
|
# When the migration completed or was canceled, or null if it is still in
|
|
80
90
|
# progress.
|
|
@@ -86,7 +96,9 @@ module Orb
|
|
|
86
96
|
started_at:,
|
|
87
97
|
# Current status of the migration: 'not_started', 'in_progress', 'completed',
|
|
88
98
|
# 'action_needed', or 'canceled'.
|
|
89
|
-
status
|
|
99
|
+
status:,
|
|
100
|
+
# The plan version subscriptions are migrated to.
|
|
101
|
+
target_plan_version_number:
|
|
90
102
|
)
|
|
91
103
|
end
|
|
92
104
|
|
|
@@ -102,16 +114,18 @@ module Orb
|
|
|
102
114
|
plan_id: String,
|
|
103
115
|
started_at: T.nilable(Time),
|
|
104
116
|
status:
|
|
105
|
-
Orb::Models::Plans::MigrationRetrieveResponse::Status::TaggedSymbol
|
|
117
|
+
Orb::Models::Plans::MigrationRetrieveResponse::Status::TaggedSymbol,
|
|
118
|
+
target_plan_version_number: Integer
|
|
106
119
|
}
|
|
107
120
|
)
|
|
108
121
|
end
|
|
109
122
|
def to_hash
|
|
110
123
|
end
|
|
111
124
|
|
|
112
|
-
# When the migration takes effect. Can be a specific date/time, '
|
|
113
|
-
# scheduled to be at the end of the current billing
|
|
114
|
-
# when scheduled to be at the
|
|
125
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
126
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
127
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
128
|
+
# start of the current or next invoice.
|
|
115
129
|
module EffectiveTime
|
|
116
130
|
extend Orb::Internal::Type::Union
|
|
117
131
|
|
|
@@ -143,11 +157,21 @@ module Orb
|
|
|
143
157
|
end
|
|
144
158
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
145
159
|
|
|
160
|
+
START_OF_TERM =
|
|
161
|
+
T.let(
|
|
162
|
+
:start_of_term,
|
|
163
|
+
Orb::Models::Plans::MigrationRetrieveResponse::EffectiveTime::TaggedSymbol
|
|
164
|
+
)
|
|
146
165
|
END_OF_TERM =
|
|
147
166
|
T.let(
|
|
148
167
|
:end_of_term,
|
|
149
168
|
Orb::Models::Plans::MigrationRetrieveResponse::EffectiveTime::TaggedSymbol
|
|
150
169
|
)
|
|
170
|
+
START_OF_INVOICE =
|
|
171
|
+
T.let(
|
|
172
|
+
:start_of_invoice,
|
|
173
|
+
Orb::Models::Plans::MigrationRetrieveResponse::EffectiveTime::TaggedSymbol
|
|
174
|
+
)
|
|
151
175
|
END_OF_INVOICE =
|
|
152
176
|
T.let(
|
|
153
177
|
:end_of_invoice,
|
data/rbi/orb/models.rbi
CHANGED
|
@@ -411,6 +411,18 @@ module Orb
|
|
|
411
411
|
|
|
412
412
|
MetricUpdateParams = Orb::Models::MetricUpdateParams
|
|
413
413
|
|
|
414
|
+
MigrationCancelParams = Orb::Models::MigrationCancelParams
|
|
415
|
+
|
|
416
|
+
MigrationCreateParams = Orb::Models::MigrationCreateParams
|
|
417
|
+
|
|
418
|
+
MigrationListParams = Orb::Models::MigrationListParams
|
|
419
|
+
|
|
420
|
+
MigrationRetrieveParams = Orb::Models::MigrationRetrieveParams
|
|
421
|
+
|
|
422
|
+
Migrations = Orb::Models::Migrations
|
|
423
|
+
|
|
424
|
+
MigrationSubscription = Orb::Models::MigrationSubscription
|
|
425
|
+
|
|
414
426
|
Minimum = Orb::Models::Minimum
|
|
415
427
|
|
|
416
428
|
MinimumInterval = Orb::Models::MinimumInterval
|
|
@@ -41,14 +41,16 @@ module Orb
|
|
|
41
41
|
)
|
|
42
42
|
end
|
|
43
43
|
|
|
44
|
-
# This endpoint allows you to update the `name`, `description`, and
|
|
45
|
-
# properties on a metric. Fields left out of the request are not
|
|
46
|
-
# `name` cannot be empty. If you pass `null` for the metadata value,
|
|
47
|
-
# any existing metadata for that metric.
|
|
44
|
+
# This endpoint allows you to update the `name`, `description`, `item_id`, and
|
|
45
|
+
# `metadata` properties on a metric. Fields left out of the request are not
|
|
46
|
+
# changed, and `name` cannot be empty. If you pass `null` for the metadata value,
|
|
47
|
+
# it will clear any existing metadata for that metric. Changing `item_id` applies
|
|
48
|
+
# to prices created on the metric afterwards; existing prices keep the item they
|
|
49
|
+
# were created with.
|
|
48
50
|
#
|
|
49
|
-
# While a metric is in `draft` status, its `sql`
|
|
50
|
-
#
|
|
51
|
-
#
|
|
51
|
+
# While a metric is in `draft` status, its `sql` can also be changed. Use
|
|
52
|
+
# [publish metric](/api-reference/metric/publish-metric) to make a draft metric
|
|
53
|
+
# active.
|
|
52
54
|
sig do
|
|
53
55
|
params(
|
|
54
56
|
metric_id: String,
|
|
@@ -64,8 +66,9 @@ module Orb
|
|
|
64
66
|
metric_id,
|
|
65
67
|
# A description of the metric.
|
|
66
68
|
description: nil,
|
|
67
|
-
# The id of the item to associate the metric with.
|
|
68
|
-
#
|
|
69
|
+
# The id of the item to associate the metric with. Prices created on the metric
|
|
70
|
+
# afterwards use the new item; existing prices keep the item they were created
|
|
71
|
+
# with.
|
|
69
72
|
item_id: nil,
|
|
70
73
|
# User-specified key/value pairs for the resource. Individual keys can be removed
|
|
71
74
|
# by setting the value to `null`, and the entire metadata mapping can be cleared
|
|
@@ -144,8 +147,7 @@ module Orb
|
|
|
144
147
|
|
|
145
148
|
# This endpoint publishes a [metric](/core-concepts#metric) in `draft` status,
|
|
146
149
|
# making it `active`. Only draft metrics can be published, and an active metric
|
|
147
|
-
# can't be moved back into `draft`, so its `sql`
|
|
148
|
-
# changed.
|
|
150
|
+
# can't be moved back into `draft`, so its `sql` can no longer be changed.
|
|
149
151
|
sig do
|
|
150
152
|
params(
|
|
151
153
|
metric_id: String,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Orb
|
|
4
|
+
module Resources
|
|
5
|
+
class Migrations
|
|
6
|
+
# A migration moves a plan's subscriptions onto one of the plan's versions. Each
|
|
7
|
+
# subscription is migrated asynchronously, either immediately or at a scheduled
|
|
8
|
+
# time, and the migration reports its overall status as it progresses.
|
|
9
|
+
class Subscriptions
|
|
10
|
+
# This endpoint returns the subscriptions a migration applies to, with the status
|
|
11
|
+
# of each one. A subscription that could not be migrated has the status `failed`
|
|
12
|
+
# and a `failure_reason`.
|
|
13
|
+
#
|
|
14
|
+
# The list is empty until the migration has finished selecting its subscriptions.
|
|
15
|
+
# Once a migration is canceled, only the subscriptions it processed before the
|
|
16
|
+
# cancellation are returned.
|
|
17
|
+
sig do
|
|
18
|
+
params(
|
|
19
|
+
migration_id: String,
|
|
20
|
+
cursor: T.nilable(String),
|
|
21
|
+
limit: Integer,
|
|
22
|
+
status:
|
|
23
|
+
T.nilable(
|
|
24
|
+
T::Array[
|
|
25
|
+
Orb::Migrations::SubscriptionListParams::Status::OrSymbol
|
|
26
|
+
]
|
|
27
|
+
),
|
|
28
|
+
subscription_id: T.nilable(T::Array[String]),
|
|
29
|
+
request_options: Orb::RequestOptions::OrHash
|
|
30
|
+
).returns(Orb::Internal::Page[Orb::MigrationSubscription])
|
|
31
|
+
end
|
|
32
|
+
def list(
|
|
33
|
+
migration_id,
|
|
34
|
+
# Cursor for pagination. This can be populated by the `next_cursor` value returned
|
|
35
|
+
# from the initial request.
|
|
36
|
+
cursor: nil,
|
|
37
|
+
# The number of items to fetch. Defaults to 20.
|
|
38
|
+
limit: nil,
|
|
39
|
+
# Only return subscriptions with one of these statuses.
|
|
40
|
+
status: nil,
|
|
41
|
+
# Only return these subscriptions. Up to 100 IDs.
|
|
42
|
+
subscription_id: nil,
|
|
43
|
+
request_options: {}
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# @api private
|
|
48
|
+
sig { params(client: Orb::Client).returns(T.attached_class) }
|
|
49
|
+
def self.new(client:)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|