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,66 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Orb
|
|
4
|
+
module Models
|
|
5
|
+
class MigrationListParams < Orb::Internal::Type::BaseModel
|
|
6
|
+
extend Orb::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Orb::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias { T.any(Orb::MigrationListParams, Orb::Internal::AnyHash) }
|
|
11
|
+
|
|
12
|
+
# Cursor for pagination. This can be populated by the `next_cursor` value returned
|
|
13
|
+
# from the initial request.
|
|
14
|
+
sig { returns(T.nilable(String)) }
|
|
15
|
+
attr_accessor :cursor
|
|
16
|
+
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_accessor :external_plan_id
|
|
19
|
+
|
|
20
|
+
# The number of items to fetch. Defaults to 20.
|
|
21
|
+
sig { returns(T.nilable(Integer)) }
|
|
22
|
+
attr_reader :limit
|
|
23
|
+
|
|
24
|
+
sig { params(limit: Integer).void }
|
|
25
|
+
attr_writer :limit
|
|
26
|
+
|
|
27
|
+
sig { returns(T.nilable(String)) }
|
|
28
|
+
attr_accessor :plan_id
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
params(
|
|
32
|
+
cursor: T.nilable(String),
|
|
33
|
+
external_plan_id: T.nilable(String),
|
|
34
|
+
limit: Integer,
|
|
35
|
+
plan_id: T.nilable(String),
|
|
36
|
+
request_options: Orb::RequestOptions::OrHash
|
|
37
|
+
).returns(T.attached_class)
|
|
38
|
+
end
|
|
39
|
+
def self.new(
|
|
40
|
+
# Cursor for pagination. This can be populated by the `next_cursor` value returned
|
|
41
|
+
# from the initial request.
|
|
42
|
+
cursor: nil,
|
|
43
|
+
external_plan_id: nil,
|
|
44
|
+
# The number of items to fetch. Defaults to 20.
|
|
45
|
+
limit: nil,
|
|
46
|
+
plan_id: nil,
|
|
47
|
+
request_options: {}
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
sig do
|
|
52
|
+
override.returns(
|
|
53
|
+
{
|
|
54
|
+
cursor: T.nilable(String),
|
|
55
|
+
external_plan_id: T.nilable(String),
|
|
56
|
+
limit: Integer,
|
|
57
|
+
plan_id: T.nilable(String),
|
|
58
|
+
request_options: Orb::RequestOptions
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
end
|
|
62
|
+
def to_hash
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Orb
|
|
4
|
+
module Models
|
|
5
|
+
class MigrationListResponse < Orb::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Orb::Models::MigrationListResponse, Orb::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Unique identifier for this plan version change.
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :id
|
|
14
|
+
|
|
15
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
16
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
17
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
18
|
+
# start of the current or next invoice.
|
|
19
|
+
sig do
|
|
20
|
+
returns(
|
|
21
|
+
T.nilable(Orb::Models::MigrationListResponse::EffectiveTime::Variants)
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
attr_accessor :effective_time
|
|
25
|
+
|
|
26
|
+
# When the migration completed or was canceled, or null if it is still in
|
|
27
|
+
# progress.
|
|
28
|
+
sig { returns(T.nilable(Time)) }
|
|
29
|
+
attr_accessor :ended_at
|
|
30
|
+
|
|
31
|
+
# The ID of the plan being migrated.
|
|
32
|
+
sig { returns(String) }
|
|
33
|
+
attr_accessor :plan_id
|
|
34
|
+
|
|
35
|
+
# When Orb began migrating the plan's subscriptions. Null if the migration has not
|
|
36
|
+
# begun, or was canceled before it began.
|
|
37
|
+
sig { returns(T.nilable(Time)) }
|
|
38
|
+
attr_accessor :started_at
|
|
39
|
+
|
|
40
|
+
# Current status of the migration: 'not_started', 'in_progress', 'completed',
|
|
41
|
+
# 'action_needed', or 'canceled'.
|
|
42
|
+
sig { returns(Orb::Models::MigrationListResponse::Status::TaggedSymbol) }
|
|
43
|
+
attr_accessor :status
|
|
44
|
+
|
|
45
|
+
# The plan version subscriptions are migrated to.
|
|
46
|
+
sig { returns(Integer) }
|
|
47
|
+
attr_accessor :target_plan_version_number
|
|
48
|
+
|
|
49
|
+
# A migration moves a plan's subscriptions onto one of the plan's versions. Each
|
|
50
|
+
# subscription is migrated asynchronously, either immediately or at a scheduled
|
|
51
|
+
# time, and the migration reports its overall status as it progresses.
|
|
52
|
+
sig do
|
|
53
|
+
params(
|
|
54
|
+
id: String,
|
|
55
|
+
effective_time:
|
|
56
|
+
T.nilable(
|
|
57
|
+
T.any(
|
|
58
|
+
Date,
|
|
59
|
+
Time,
|
|
60
|
+
Orb::Models::MigrationListResponse::EffectiveTime::OrSymbol
|
|
61
|
+
)
|
|
62
|
+
),
|
|
63
|
+
ended_at: T.nilable(Time),
|
|
64
|
+
plan_id: String,
|
|
65
|
+
started_at: T.nilable(Time),
|
|
66
|
+
status: Orb::Models::MigrationListResponse::Status::OrSymbol,
|
|
67
|
+
target_plan_version_number: Integer
|
|
68
|
+
).returns(T.attached_class)
|
|
69
|
+
end
|
|
70
|
+
def self.new(
|
|
71
|
+
# Unique identifier for this plan version change.
|
|
72
|
+
id:,
|
|
73
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
74
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
75
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
76
|
+
# start of the current or next invoice.
|
|
77
|
+
effective_time:,
|
|
78
|
+
# When the migration completed or was canceled, or null if it is still in
|
|
79
|
+
# progress.
|
|
80
|
+
ended_at:,
|
|
81
|
+
# The ID of the plan being migrated.
|
|
82
|
+
plan_id:,
|
|
83
|
+
# When Orb began migrating the plan's subscriptions. Null if the migration has not
|
|
84
|
+
# begun, or was canceled before it began.
|
|
85
|
+
started_at:,
|
|
86
|
+
# Current status of the migration: 'not_started', 'in_progress', 'completed',
|
|
87
|
+
# 'action_needed', or 'canceled'.
|
|
88
|
+
status:,
|
|
89
|
+
# The plan version subscriptions are migrated to.
|
|
90
|
+
target_plan_version_number:
|
|
91
|
+
)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
sig do
|
|
95
|
+
override.returns(
|
|
96
|
+
{
|
|
97
|
+
id: String,
|
|
98
|
+
effective_time:
|
|
99
|
+
T.nilable(
|
|
100
|
+
Orb::Models::MigrationListResponse::EffectiveTime::Variants
|
|
101
|
+
),
|
|
102
|
+
ended_at: T.nilable(Time),
|
|
103
|
+
plan_id: String,
|
|
104
|
+
started_at: T.nilable(Time),
|
|
105
|
+
status: Orb::Models::MigrationListResponse::Status::TaggedSymbol,
|
|
106
|
+
target_plan_version_number: Integer
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
def to_hash
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
114
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
115
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
116
|
+
# start of the current or next invoice.
|
|
117
|
+
module EffectiveTime
|
|
118
|
+
extend Orb::Internal::Type::Union
|
|
119
|
+
|
|
120
|
+
Variants =
|
|
121
|
+
T.type_alias do
|
|
122
|
+
T.any(
|
|
123
|
+
Date,
|
|
124
|
+
Time,
|
|
125
|
+
Orb::Models::MigrationListResponse::EffectiveTime::TaggedSymbol
|
|
126
|
+
)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
sig do
|
|
130
|
+
override.returns(
|
|
131
|
+
T::Array[
|
|
132
|
+
Orb::Models::MigrationListResponse::EffectiveTime::Variants
|
|
133
|
+
]
|
|
134
|
+
)
|
|
135
|
+
end
|
|
136
|
+
def self.variants
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
TaggedSymbol =
|
|
140
|
+
T.type_alias do
|
|
141
|
+
T.all(Symbol, Orb::Models::MigrationListResponse::EffectiveTime)
|
|
142
|
+
end
|
|
143
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
144
|
+
|
|
145
|
+
START_OF_TERM =
|
|
146
|
+
T.let(
|
|
147
|
+
:start_of_term,
|
|
148
|
+
Orb::Models::MigrationListResponse::EffectiveTime::TaggedSymbol
|
|
149
|
+
)
|
|
150
|
+
END_OF_TERM =
|
|
151
|
+
T.let(
|
|
152
|
+
:end_of_term,
|
|
153
|
+
Orb::Models::MigrationListResponse::EffectiveTime::TaggedSymbol
|
|
154
|
+
)
|
|
155
|
+
START_OF_INVOICE =
|
|
156
|
+
T.let(
|
|
157
|
+
:start_of_invoice,
|
|
158
|
+
Orb::Models::MigrationListResponse::EffectiveTime::TaggedSymbol
|
|
159
|
+
)
|
|
160
|
+
END_OF_INVOICE =
|
|
161
|
+
T.let(
|
|
162
|
+
:end_of_invoice,
|
|
163
|
+
Orb::Models::MigrationListResponse::EffectiveTime::TaggedSymbol
|
|
164
|
+
)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Current status of the migration: 'not_started', 'in_progress', 'completed',
|
|
168
|
+
# 'action_needed', or 'canceled'.
|
|
169
|
+
module Status
|
|
170
|
+
extend Orb::Internal::Type::Enum
|
|
171
|
+
|
|
172
|
+
TaggedSymbol =
|
|
173
|
+
T.type_alias do
|
|
174
|
+
T.all(Symbol, Orb::Models::MigrationListResponse::Status)
|
|
175
|
+
end
|
|
176
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
177
|
+
|
|
178
|
+
NOT_STARTED =
|
|
179
|
+
T.let(
|
|
180
|
+
:not_started,
|
|
181
|
+
Orb::Models::MigrationListResponse::Status::TaggedSymbol
|
|
182
|
+
)
|
|
183
|
+
IN_PROGRESS =
|
|
184
|
+
T.let(
|
|
185
|
+
:in_progress,
|
|
186
|
+
Orb::Models::MigrationListResponse::Status::TaggedSymbol
|
|
187
|
+
)
|
|
188
|
+
COMPLETED =
|
|
189
|
+
T.let(
|
|
190
|
+
:completed,
|
|
191
|
+
Orb::Models::MigrationListResponse::Status::TaggedSymbol
|
|
192
|
+
)
|
|
193
|
+
ACTION_NEEDED =
|
|
194
|
+
T.let(
|
|
195
|
+
:action_needed,
|
|
196
|
+
Orb::Models::MigrationListResponse::Status::TaggedSymbol
|
|
197
|
+
)
|
|
198
|
+
CANCELED =
|
|
199
|
+
T.let(
|
|
200
|
+
:canceled,
|
|
201
|
+
Orb::Models::MigrationListResponse::Status::TaggedSymbol
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
sig do
|
|
205
|
+
override.returns(
|
|
206
|
+
T::Array[Orb::Models::MigrationListResponse::Status::TaggedSymbol]
|
|
207
|
+
)
|
|
208
|
+
end
|
|
209
|
+
def self.values
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Orb
|
|
4
|
+
module Models
|
|
5
|
+
class MigrationRetrieveParams < Orb::Internal::Type::BaseModel
|
|
6
|
+
extend Orb::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Orb::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Orb::MigrationRetrieveParams, Orb::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :migration_id
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(
|
|
19
|
+
migration_id: String,
|
|
20
|
+
request_options: Orb::RequestOptions::OrHash
|
|
21
|
+
).returns(T.attached_class)
|
|
22
|
+
end
|
|
23
|
+
def self.new(migration_id:, request_options: {})
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
override.returns(
|
|
28
|
+
{ migration_id: String, request_options: Orb::RequestOptions }
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
def to_hash
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Orb
|
|
4
|
+
module Models
|
|
5
|
+
class MigrationRetrieveResponse < Orb::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Orb::Models::MigrationRetrieveResponse, Orb::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Unique identifier for this plan version change.
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :id
|
|
14
|
+
|
|
15
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
16
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
17
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
18
|
+
# start of the current or next invoice.
|
|
19
|
+
sig do
|
|
20
|
+
returns(
|
|
21
|
+
T.nilable(
|
|
22
|
+
Orb::Models::MigrationRetrieveResponse::EffectiveTime::Variants
|
|
23
|
+
)
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
attr_accessor :effective_time
|
|
27
|
+
|
|
28
|
+
# When the migration completed or was canceled, or null if it is still in
|
|
29
|
+
# progress.
|
|
30
|
+
sig { returns(T.nilable(Time)) }
|
|
31
|
+
attr_accessor :ended_at
|
|
32
|
+
|
|
33
|
+
# The ID of the plan being migrated.
|
|
34
|
+
sig { returns(String) }
|
|
35
|
+
attr_accessor :plan_id
|
|
36
|
+
|
|
37
|
+
# When Orb began migrating the plan's subscriptions. Null if the migration has not
|
|
38
|
+
# begun, or was canceled before it began.
|
|
39
|
+
sig { returns(T.nilable(Time)) }
|
|
40
|
+
attr_accessor :started_at
|
|
41
|
+
|
|
42
|
+
# Current status of the migration: 'not_started', 'in_progress', 'completed',
|
|
43
|
+
# 'action_needed', or 'canceled'.
|
|
44
|
+
sig do
|
|
45
|
+
returns(Orb::Models::MigrationRetrieveResponse::Status::TaggedSymbol)
|
|
46
|
+
end
|
|
47
|
+
attr_accessor :status
|
|
48
|
+
|
|
49
|
+
# The plan version subscriptions are migrated to.
|
|
50
|
+
sig { returns(Integer) }
|
|
51
|
+
attr_accessor :target_plan_version_number
|
|
52
|
+
|
|
53
|
+
# A migration moves a plan's subscriptions onto one of the plan's versions. Each
|
|
54
|
+
# subscription is migrated asynchronously, either immediately or at a scheduled
|
|
55
|
+
# time, and the migration reports its overall status as it progresses.
|
|
56
|
+
sig do
|
|
57
|
+
params(
|
|
58
|
+
id: String,
|
|
59
|
+
effective_time:
|
|
60
|
+
T.nilable(
|
|
61
|
+
T.any(
|
|
62
|
+
Date,
|
|
63
|
+
Time,
|
|
64
|
+
Orb::Models::MigrationRetrieveResponse::EffectiveTime::OrSymbol
|
|
65
|
+
)
|
|
66
|
+
),
|
|
67
|
+
ended_at: T.nilable(Time),
|
|
68
|
+
plan_id: String,
|
|
69
|
+
started_at: T.nilable(Time),
|
|
70
|
+
status: Orb::Models::MigrationRetrieveResponse::Status::OrSymbol,
|
|
71
|
+
target_plan_version_number: Integer
|
|
72
|
+
).returns(T.attached_class)
|
|
73
|
+
end
|
|
74
|
+
def self.new(
|
|
75
|
+
# Unique identifier for this plan version change.
|
|
76
|
+
id:,
|
|
77
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
78
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
79
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
80
|
+
# start of the current or next invoice.
|
|
81
|
+
effective_time:,
|
|
82
|
+
# When the migration completed or was canceled, or null if it is still in
|
|
83
|
+
# progress.
|
|
84
|
+
ended_at:,
|
|
85
|
+
# The ID of the plan being migrated.
|
|
86
|
+
plan_id:,
|
|
87
|
+
# When Orb began migrating the plan's subscriptions. Null if the migration has not
|
|
88
|
+
# begun, or was canceled before it began.
|
|
89
|
+
started_at:,
|
|
90
|
+
# Current status of the migration: 'not_started', 'in_progress', 'completed',
|
|
91
|
+
# 'action_needed', or 'canceled'.
|
|
92
|
+
status:,
|
|
93
|
+
# The plan version subscriptions are migrated to.
|
|
94
|
+
target_plan_version_number:
|
|
95
|
+
)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
sig do
|
|
99
|
+
override.returns(
|
|
100
|
+
{
|
|
101
|
+
id: String,
|
|
102
|
+
effective_time:
|
|
103
|
+
T.nilable(
|
|
104
|
+
Orb::Models::MigrationRetrieveResponse::EffectiveTime::Variants
|
|
105
|
+
),
|
|
106
|
+
ended_at: T.nilable(Time),
|
|
107
|
+
plan_id: String,
|
|
108
|
+
started_at: T.nilable(Time),
|
|
109
|
+
status:
|
|
110
|
+
Orb::Models::MigrationRetrieveResponse::Status::TaggedSymbol,
|
|
111
|
+
target_plan_version_number: Integer
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
end
|
|
115
|
+
def to_hash
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# When the migration takes effect. Can be a specific date/time, 'start_of_term' or
|
|
119
|
+
# 'end_of_term' when scheduled to be at the start or end of the current billing
|
|
120
|
+
# period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
|
|
121
|
+
# start of the current or next invoice.
|
|
122
|
+
module EffectiveTime
|
|
123
|
+
extend Orb::Internal::Type::Union
|
|
124
|
+
|
|
125
|
+
Variants =
|
|
126
|
+
T.type_alias do
|
|
127
|
+
T.any(
|
|
128
|
+
Date,
|
|
129
|
+
Time,
|
|
130
|
+
Orb::Models::MigrationRetrieveResponse::EffectiveTime::TaggedSymbol
|
|
131
|
+
)
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
sig do
|
|
135
|
+
override.returns(
|
|
136
|
+
T::Array[
|
|
137
|
+
Orb::Models::MigrationRetrieveResponse::EffectiveTime::Variants
|
|
138
|
+
]
|
|
139
|
+
)
|
|
140
|
+
end
|
|
141
|
+
def self.variants
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
TaggedSymbol =
|
|
145
|
+
T.type_alias do
|
|
146
|
+
T.all(Symbol, Orb::Models::MigrationRetrieveResponse::EffectiveTime)
|
|
147
|
+
end
|
|
148
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
149
|
+
|
|
150
|
+
START_OF_TERM =
|
|
151
|
+
T.let(
|
|
152
|
+
:start_of_term,
|
|
153
|
+
Orb::Models::MigrationRetrieveResponse::EffectiveTime::TaggedSymbol
|
|
154
|
+
)
|
|
155
|
+
END_OF_TERM =
|
|
156
|
+
T.let(
|
|
157
|
+
:end_of_term,
|
|
158
|
+
Orb::Models::MigrationRetrieveResponse::EffectiveTime::TaggedSymbol
|
|
159
|
+
)
|
|
160
|
+
START_OF_INVOICE =
|
|
161
|
+
T.let(
|
|
162
|
+
:start_of_invoice,
|
|
163
|
+
Orb::Models::MigrationRetrieveResponse::EffectiveTime::TaggedSymbol
|
|
164
|
+
)
|
|
165
|
+
END_OF_INVOICE =
|
|
166
|
+
T.let(
|
|
167
|
+
:end_of_invoice,
|
|
168
|
+
Orb::Models::MigrationRetrieveResponse::EffectiveTime::TaggedSymbol
|
|
169
|
+
)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Current status of the migration: 'not_started', 'in_progress', 'completed',
|
|
173
|
+
# 'action_needed', or 'canceled'.
|
|
174
|
+
module Status
|
|
175
|
+
extend Orb::Internal::Type::Enum
|
|
176
|
+
|
|
177
|
+
TaggedSymbol =
|
|
178
|
+
T.type_alias do
|
|
179
|
+
T.all(Symbol, Orb::Models::MigrationRetrieveResponse::Status)
|
|
180
|
+
end
|
|
181
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
182
|
+
|
|
183
|
+
NOT_STARTED =
|
|
184
|
+
T.let(
|
|
185
|
+
:not_started,
|
|
186
|
+
Orb::Models::MigrationRetrieveResponse::Status::TaggedSymbol
|
|
187
|
+
)
|
|
188
|
+
IN_PROGRESS =
|
|
189
|
+
T.let(
|
|
190
|
+
:in_progress,
|
|
191
|
+
Orb::Models::MigrationRetrieveResponse::Status::TaggedSymbol
|
|
192
|
+
)
|
|
193
|
+
COMPLETED =
|
|
194
|
+
T.let(
|
|
195
|
+
:completed,
|
|
196
|
+
Orb::Models::MigrationRetrieveResponse::Status::TaggedSymbol
|
|
197
|
+
)
|
|
198
|
+
ACTION_NEEDED =
|
|
199
|
+
T.let(
|
|
200
|
+
:action_needed,
|
|
201
|
+
Orb::Models::MigrationRetrieveResponse::Status::TaggedSymbol
|
|
202
|
+
)
|
|
203
|
+
CANCELED =
|
|
204
|
+
T.let(
|
|
205
|
+
:canceled,
|
|
206
|
+
Orb::Models::MigrationRetrieveResponse::Status::TaggedSymbol
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
sig do
|
|
210
|
+
override.returns(
|
|
211
|
+
T::Array[
|
|
212
|
+
Orb::Models::MigrationRetrieveResponse::Status::TaggedSymbol
|
|
213
|
+
]
|
|
214
|
+
)
|
|
215
|
+
end
|
|
216
|
+
def self.values
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
end
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Orb
|
|
4
|
+
module Models
|
|
5
|
+
class MigrationSubscription < Orb::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Orb::MigrationSubscription, Orb::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(Orb::CustomerMinified) }
|
|
12
|
+
attr_reader :customer
|
|
13
|
+
|
|
14
|
+
sig { params(customer: Orb::CustomerMinified::OrHash).void }
|
|
15
|
+
attr_writer :customer
|
|
16
|
+
|
|
17
|
+
# When the subscription is migrated to the target plan version. Null unless the
|
|
18
|
+
# status is 'scheduled' or 'completed'.
|
|
19
|
+
sig { returns(T.nilable(Time)) }
|
|
20
|
+
attr_accessor :effective_date
|
|
21
|
+
|
|
22
|
+
# Why the subscription could not be migrated. Null unless the status is 'failed'.
|
|
23
|
+
sig { returns(T.nilable(String)) }
|
|
24
|
+
attr_accessor :failure_reason
|
|
25
|
+
|
|
26
|
+
# The subscription's status in the migration: 'scheduling' until the migration has
|
|
27
|
+
# processed it, 'scheduled' when it will be migrated to the target version at
|
|
28
|
+
# `effective_date`, 'completed' once it has been migrated, 'skipped' when the
|
|
29
|
+
# migration left it unchanged, or 'failed' when it could not be migrated (see
|
|
30
|
+
# `failure_reason`).
|
|
31
|
+
sig { returns(Orb::MigrationSubscription::Status::TaggedSymbol) }
|
|
32
|
+
attr_accessor :status
|
|
33
|
+
|
|
34
|
+
# The ID of the subscription.
|
|
35
|
+
sig { returns(String) }
|
|
36
|
+
attr_accessor :subscription_id
|
|
37
|
+
|
|
38
|
+
sig do
|
|
39
|
+
params(
|
|
40
|
+
customer: Orb::CustomerMinified::OrHash,
|
|
41
|
+
effective_date: T.nilable(Time),
|
|
42
|
+
failure_reason: T.nilable(String),
|
|
43
|
+
status: Orb::MigrationSubscription::Status::OrSymbol,
|
|
44
|
+
subscription_id: String
|
|
45
|
+
).returns(T.attached_class)
|
|
46
|
+
end
|
|
47
|
+
def self.new(
|
|
48
|
+
customer:,
|
|
49
|
+
# When the subscription is migrated to the target plan version. Null unless the
|
|
50
|
+
# status is 'scheduled' or 'completed'.
|
|
51
|
+
effective_date:,
|
|
52
|
+
# Why the subscription could not be migrated. Null unless the status is 'failed'.
|
|
53
|
+
failure_reason:,
|
|
54
|
+
# The subscription's status in the migration: 'scheduling' until the migration has
|
|
55
|
+
# processed it, 'scheduled' when it will be migrated to the target version at
|
|
56
|
+
# `effective_date`, 'completed' once it has been migrated, 'skipped' when the
|
|
57
|
+
# migration left it unchanged, or 'failed' when it could not be migrated (see
|
|
58
|
+
# `failure_reason`).
|
|
59
|
+
status:,
|
|
60
|
+
# The ID of the subscription.
|
|
61
|
+
subscription_id:
|
|
62
|
+
)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
sig do
|
|
66
|
+
override.returns(
|
|
67
|
+
{
|
|
68
|
+
customer: Orb::CustomerMinified,
|
|
69
|
+
effective_date: T.nilable(Time),
|
|
70
|
+
failure_reason: T.nilable(String),
|
|
71
|
+
status: Orb::MigrationSubscription::Status::TaggedSymbol,
|
|
72
|
+
subscription_id: String
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
end
|
|
76
|
+
def to_hash
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# The subscription's status in the migration: 'scheduling' until the migration has
|
|
80
|
+
# processed it, 'scheduled' when it will be migrated to the target version at
|
|
81
|
+
# `effective_date`, 'completed' once it has been migrated, 'skipped' when the
|
|
82
|
+
# migration left it unchanged, or 'failed' when it could not be migrated (see
|
|
83
|
+
# `failure_reason`).
|
|
84
|
+
module Status
|
|
85
|
+
extend Orb::Internal::Type::Enum
|
|
86
|
+
|
|
87
|
+
TaggedSymbol =
|
|
88
|
+
T.type_alias { T.all(Symbol, Orb::MigrationSubscription::Status) }
|
|
89
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
90
|
+
|
|
91
|
+
SCHEDULING =
|
|
92
|
+
T.let(:scheduling, Orb::MigrationSubscription::Status::TaggedSymbol)
|
|
93
|
+
SCHEDULED =
|
|
94
|
+
T.let(:scheduled, Orb::MigrationSubscription::Status::TaggedSymbol)
|
|
95
|
+
COMPLETED =
|
|
96
|
+
T.let(:completed, Orb::MigrationSubscription::Status::TaggedSymbol)
|
|
97
|
+
SKIPPED =
|
|
98
|
+
T.let(:skipped, Orb::MigrationSubscription::Status::TaggedSymbol)
|
|
99
|
+
FAILED =
|
|
100
|
+
T.let(:failed, Orb::MigrationSubscription::Status::TaggedSymbol)
|
|
101
|
+
|
|
102
|
+
sig do
|
|
103
|
+
override.returns(
|
|
104
|
+
T::Array[Orb::MigrationSubscription::Status::TaggedSymbol]
|
|
105
|
+
)
|
|
106
|
+
end
|
|
107
|
+
def self.values
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|