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.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +7 -0
  5. data/lib/orb/models/metric_update_params.rb +4 -3
  6. data/lib/orb/models/migration_cancel_params.rb +20 -0
  7. data/lib/orb/models/migration_cancel_response.rb +133 -0
  8. data/lib/orb/models/migration_create_params.rb +159 -0
  9. data/lib/orb/models/migration_create_response.rb +133 -0
  10. data/lib/orb/models/migration_list_params.rb +48 -0
  11. data/lib/orb/models/migration_list_response.rb +133 -0
  12. data/lib/orb/models/migration_retrieve_params.rb +20 -0
  13. data/lib/orb/models/migration_retrieve_response.rb +133 -0
  14. data/lib/orb/models/migration_subscription.rb +75 -0
  15. data/lib/orb/models/migrations/subscription_list_params.rb +74 -0
  16. data/lib/orb/models/plan.rb +9 -1
  17. data/lib/orb/models/plans/migration_cancel_response.rb +28 -8
  18. data/lib/orb/models/plans/migration_list_response.rb +28 -8
  19. data/lib/orb/models/plans/migration_retrieve_response.rb +28 -8
  20. data/lib/orb/models.rb +12 -0
  21. data/lib/orb/resources/metrics.rb +11 -10
  22. data/lib/orb/resources/migrations/subscriptions.rb +60 -0
  23. data/lib/orb/resources/migrations.rb +153 -0
  24. data/lib/orb/version.rb +1 -1
  25. data/lib/orb.rb +12 -0
  26. data/rbi/orb/client.rbi +6 -0
  27. data/rbi/orb/models/metric_update_params.rbi +6 -4
  28. data/rbi/orb/models/migration_cancel_params.rbi +35 -0
  29. data/rbi/orb/models/migration_cancel_response.rbi +218 -0
  30. data/rbi/orb/models/migration_create_params.rbi +248 -0
  31. data/rbi/orb/models/migration_create_response.rbi +218 -0
  32. data/rbi/orb/models/migration_list_params.rbi +66 -0
  33. data/rbi/orb/models/migration_list_response.rbi +214 -0
  34. data/rbi/orb/models/migration_retrieve_params.rbi +35 -0
  35. data/rbi/orb/models/migration_retrieve_response.rbi +221 -0
  36. data/rbi/orb/models/migration_subscription.rbi +112 -0
  37. data/rbi/orb/models/migrations/subscription_list_params.rbi +147 -0
  38. data/rbi/orb/models/plan.rbi +8 -0
  39. data/rbi/orb/models/plans/migration_cancel_response.rbi +36 -12
  40. data/rbi/orb/models/plans/migration_list_response.rbi +36 -12
  41. data/rbi/orb/models/plans/migration_retrieve_response.rbi +36 -12
  42. data/rbi/orb/models.rbi +12 -0
  43. data/rbi/orb/resources/metrics.rbi +13 -11
  44. data/rbi/orb/resources/migrations/subscriptions.rbi +54 -0
  45. data/rbi/orb/resources/migrations.rbi +130 -0
  46. data/sig/orb/client.rbs +2 -0
  47. data/sig/orb/models/migration_cancel_params.rbs +23 -0
  48. data/sig/orb/models/migration_cancel_response.rbs +84 -0
  49. data/sig/orb/models/migration_create_params.rbs +126 -0
  50. data/sig/orb/models/migration_create_response.rbs +84 -0
  51. data/sig/orb/models/migration_list_params.rbs +43 -0
  52. data/sig/orb/models/migration_list_response.rbs +84 -0
  53. data/sig/orb/models/migration_retrieve_params.rbs +23 -0
  54. data/sig/orb/models/migration_retrieve_response.rbs +84 -0
  55. data/sig/orb/models/migration_subscription.rbs +54 -0
  56. data/sig/orb/models/migrations/subscription_list_params.rbs +64 -0
  57. data/sig/orb/models/plan.rbs +5 -0
  58. data/sig/orb/models/plans/migration_cancel_response.rbs +17 -4
  59. data/sig/orb/models/plans/migration_list_response.rbs +17 -4
  60. data/sig/orb/models/plans/migration_retrieve_response.rbs +17 -4
  61. data/sig/orb/models.rbs +12 -0
  62. data/sig/orb/resources/migrations/subscriptions.rbs +18 -0
  63. data/sig/orb/resources/migrations.rbs +44 -0
  64. metadata +37 -1
@@ -0,0 +1,133 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::Migrations#list
6
+ class MigrationListResponse < Orb::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # Unique identifier for this plan version change.
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute effective_time
14
+ # When the migration takes effect. Can be a specific date/time, 'start_of_term' or
15
+ # 'end_of_term' when scheduled to be at the start or end of the current billing
16
+ # period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
17
+ # start of the current or next invoice.
18
+ #
19
+ # @return [Date, Time, Symbol, Orb::Models::MigrationListResponse::EffectiveTime, nil]
20
+ required :effective_time, union: -> { Orb::Models::MigrationListResponse::EffectiveTime }, nil?: true
21
+
22
+ # @!attribute ended_at
23
+ # When the migration completed or was canceled, or null if it is still in
24
+ # progress.
25
+ #
26
+ # @return [Time, nil]
27
+ required :ended_at, Time, nil?: true
28
+
29
+ # @!attribute plan_id
30
+ # The ID of the plan being migrated.
31
+ #
32
+ # @return [String]
33
+ required :plan_id, String
34
+
35
+ # @!attribute started_at
36
+ # When Orb began migrating the plan's subscriptions. Null if the migration has not
37
+ # begun, or was canceled before it began.
38
+ #
39
+ # @return [Time, nil]
40
+ required :started_at, Time, nil?: true
41
+
42
+ # @!attribute status
43
+ # Current status of the migration: 'not_started', 'in_progress', 'completed',
44
+ # 'action_needed', or 'canceled'.
45
+ #
46
+ # @return [Symbol, Orb::Models::MigrationListResponse::Status]
47
+ required :status, enum: -> { Orb::Models::MigrationListResponse::Status }
48
+
49
+ # @!attribute target_plan_version_number
50
+ # The plan version subscriptions are migrated to.
51
+ #
52
+ # @return [Integer]
53
+ required :target_plan_version_number, Integer
54
+
55
+ # @!method initialize(id:, effective_time:, ended_at:, plan_id:, started_at:, status:, target_plan_version_number:)
56
+ # Some parameter documentations has been truncated, see
57
+ # {Orb::Models::MigrationListResponse} for more details.
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.
62
+ #
63
+ # @param id [String] Unique identifier for this plan version change.
64
+ #
65
+ # @param effective_time [Date, Time, Symbol, Orb::Models::MigrationListResponse::EffectiveTime, nil] When the migration takes effect. Can be a specific date/time, 'start_of_term' or
66
+ #
67
+ # @param ended_at [Time, nil] When the migration completed or was canceled, or null if it is still in progress
68
+ #
69
+ # @param plan_id [String] The ID of the plan being migrated.
70
+ #
71
+ # @param started_at [Time, nil] When Orb began migrating the plan's subscriptions. Null if the migration has not
72
+ #
73
+ # @param status [Symbol, Orb::Models::MigrationListResponse::Status] Current status of the migration: 'not_started', 'in_progress', 'completed', 'act
74
+ #
75
+ # @param target_plan_version_number [Integer] The plan version subscriptions are migrated to.
76
+
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
+ #
82
+ # @see Orb::Models::MigrationListResponse#effective_time
83
+ module EffectiveTime
84
+ extend Orb::Internal::Type::Union
85
+
86
+ variant Date
87
+
88
+ variant Time
89
+
90
+ variant const: -> { Orb::Models::MigrationListResponse::EffectiveTime::START_OF_TERM }
91
+
92
+ variant const: -> { Orb::Models::MigrationListResponse::EffectiveTime::END_OF_TERM }
93
+
94
+ variant const: -> { Orb::Models::MigrationListResponse::EffectiveTime::START_OF_INVOICE }
95
+
96
+ variant const: -> { Orb::Models::MigrationListResponse::EffectiveTime::END_OF_INVOICE }
97
+
98
+ # @!method self.variants
99
+ # @return [Array(Date, Time, Symbol)]
100
+
101
+ define_sorbet_constant!(:Variants) do
102
+ T.type_alias { T.any(Date, Time, Orb::Models::MigrationListResponse::EffectiveTime::TaggedSymbol) }
103
+ end
104
+
105
+ # @!group
106
+
107
+ START_OF_TERM = :start_of_term
108
+ END_OF_TERM = :end_of_term
109
+ START_OF_INVOICE = :start_of_invoice
110
+ END_OF_INVOICE = :end_of_invoice
111
+
112
+ # @!endgroup
113
+ end
114
+
115
+ # Current status of the migration: 'not_started', 'in_progress', 'completed',
116
+ # 'action_needed', or 'canceled'.
117
+ #
118
+ # @see Orb::Models::MigrationListResponse#status
119
+ module Status
120
+ extend Orb::Internal::Type::Enum
121
+
122
+ NOT_STARTED = :not_started
123
+ IN_PROGRESS = :in_progress
124
+ COMPLETED = :completed
125
+ ACTION_NEEDED = :action_needed
126
+ CANCELED = :canceled
127
+
128
+ # @!method self.values
129
+ # @return [Array<Symbol>]
130
+ end
131
+ end
132
+ end
133
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::Migrations#retrieve
6
+ class MigrationRetrieveParams < Orb::Internal::Type::BaseModel
7
+ extend Orb::Internal::Type::RequestParameters::Converter
8
+ include Orb::Internal::Type::RequestParameters
9
+
10
+ # @!attribute migration_id
11
+ #
12
+ # @return [String]
13
+ required :migration_id, String
14
+
15
+ # @!method initialize(migration_id:, request_options: {})
16
+ # @param migration_id [String]
17
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,133 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::Migrations#retrieve
6
+ class MigrationRetrieveResponse < Orb::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # Unique identifier for this plan version change.
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute effective_time
14
+ # When the migration takes effect. Can be a specific date/time, 'start_of_term' or
15
+ # 'end_of_term' when scheduled to be at the start or end of the current billing
16
+ # period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
17
+ # start of the current or next invoice.
18
+ #
19
+ # @return [Date, Time, Symbol, Orb::Models::MigrationRetrieveResponse::EffectiveTime, nil]
20
+ required :effective_time, union: -> { Orb::Models::MigrationRetrieveResponse::EffectiveTime }, nil?: true
21
+
22
+ # @!attribute ended_at
23
+ # When the migration completed or was canceled, or null if it is still in
24
+ # progress.
25
+ #
26
+ # @return [Time, nil]
27
+ required :ended_at, Time, nil?: true
28
+
29
+ # @!attribute plan_id
30
+ # The ID of the plan being migrated.
31
+ #
32
+ # @return [String]
33
+ required :plan_id, String
34
+
35
+ # @!attribute started_at
36
+ # When Orb began migrating the plan's subscriptions. Null if the migration has not
37
+ # begun, or was canceled before it began.
38
+ #
39
+ # @return [Time, nil]
40
+ required :started_at, Time, nil?: true
41
+
42
+ # @!attribute status
43
+ # Current status of the migration: 'not_started', 'in_progress', 'completed',
44
+ # 'action_needed', or 'canceled'.
45
+ #
46
+ # @return [Symbol, Orb::Models::MigrationRetrieveResponse::Status]
47
+ required :status, enum: -> { Orb::Models::MigrationRetrieveResponse::Status }
48
+
49
+ # @!attribute target_plan_version_number
50
+ # The plan version subscriptions are migrated to.
51
+ #
52
+ # @return [Integer]
53
+ required :target_plan_version_number, Integer
54
+
55
+ # @!method initialize(id:, effective_time:, ended_at:, plan_id:, started_at:, status:, target_plan_version_number:)
56
+ # Some parameter documentations has been truncated, see
57
+ # {Orb::Models::MigrationRetrieveResponse} for more details.
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.
62
+ #
63
+ # @param id [String] Unique identifier for this plan version change.
64
+ #
65
+ # @param effective_time [Date, Time, Symbol, Orb::Models::MigrationRetrieveResponse::EffectiveTime, nil] When the migration takes effect. Can be a specific date/time, 'start_of_term' or
66
+ #
67
+ # @param ended_at [Time, nil] When the migration completed or was canceled, or null if it is still in progress
68
+ #
69
+ # @param plan_id [String] The ID of the plan being migrated.
70
+ #
71
+ # @param started_at [Time, nil] When Orb began migrating the plan's subscriptions. Null if the migration has not
72
+ #
73
+ # @param status [Symbol, Orb::Models::MigrationRetrieveResponse::Status] Current status of the migration: 'not_started', 'in_progress', 'completed', 'act
74
+ #
75
+ # @param target_plan_version_number [Integer] The plan version subscriptions are migrated to.
76
+
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
+ #
82
+ # @see Orb::Models::MigrationRetrieveResponse#effective_time
83
+ module EffectiveTime
84
+ extend Orb::Internal::Type::Union
85
+
86
+ variant Date
87
+
88
+ variant Time
89
+
90
+ variant const: -> { Orb::Models::MigrationRetrieveResponse::EffectiveTime::START_OF_TERM }
91
+
92
+ variant const: -> { Orb::Models::MigrationRetrieveResponse::EffectiveTime::END_OF_TERM }
93
+
94
+ variant const: -> { Orb::Models::MigrationRetrieveResponse::EffectiveTime::START_OF_INVOICE }
95
+
96
+ variant const: -> { Orb::Models::MigrationRetrieveResponse::EffectiveTime::END_OF_INVOICE }
97
+
98
+ # @!method self.variants
99
+ # @return [Array(Date, Time, Symbol)]
100
+
101
+ define_sorbet_constant!(:Variants) do
102
+ T.type_alias { T.any(Date, Time, Orb::Models::MigrationRetrieveResponse::EffectiveTime::TaggedSymbol) }
103
+ end
104
+
105
+ # @!group
106
+
107
+ START_OF_TERM = :start_of_term
108
+ END_OF_TERM = :end_of_term
109
+ START_OF_INVOICE = :start_of_invoice
110
+ END_OF_INVOICE = :end_of_invoice
111
+
112
+ # @!endgroup
113
+ end
114
+
115
+ # Current status of the migration: 'not_started', 'in_progress', 'completed',
116
+ # 'action_needed', or 'canceled'.
117
+ #
118
+ # @see Orb::Models::MigrationRetrieveResponse#status
119
+ module Status
120
+ extend Orb::Internal::Type::Enum
121
+
122
+ NOT_STARTED = :not_started
123
+ IN_PROGRESS = :in_progress
124
+ COMPLETED = :completed
125
+ ACTION_NEEDED = :action_needed
126
+ CANCELED = :canceled
127
+
128
+ # @!method self.values
129
+ # @return [Array<Symbol>]
130
+ end
131
+ end
132
+ end
133
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ class MigrationSubscription < Orb::Internal::Type::BaseModel
6
+ # @!attribute customer
7
+ #
8
+ # @return [Orb::Models::CustomerMinified]
9
+ required :customer, -> { Orb::CustomerMinified }
10
+
11
+ # @!attribute effective_date
12
+ # When the subscription is migrated to the target plan version. Null unless the
13
+ # status is 'scheduled' or 'completed'.
14
+ #
15
+ # @return [Time, nil]
16
+ required :effective_date, Time, nil?: true
17
+
18
+ # @!attribute failure_reason
19
+ # Why the subscription could not be migrated. Null unless the status is 'failed'.
20
+ #
21
+ # @return [String, nil]
22
+ required :failure_reason, String, nil?: true
23
+
24
+ # @!attribute status
25
+ # The subscription's status in the migration: 'scheduling' until the migration has
26
+ # processed it, 'scheduled' when it will be migrated to the target version at
27
+ # `effective_date`, 'completed' once it has been migrated, 'skipped' when the
28
+ # migration left it unchanged, or 'failed' when it could not be migrated (see
29
+ # `failure_reason`).
30
+ #
31
+ # @return [Symbol, Orb::Models::MigrationSubscription::Status]
32
+ required :status, enum: -> { Orb::MigrationSubscription::Status }
33
+
34
+ # @!attribute subscription_id
35
+ # The ID of the subscription.
36
+ #
37
+ # @return [String]
38
+ required :subscription_id, String
39
+
40
+ # @!method initialize(customer:, effective_date:, failure_reason:, status:, subscription_id:)
41
+ # Some parameter documentations has been truncated, see
42
+ # {Orb::Models::MigrationSubscription} for more details.
43
+ #
44
+ # @param customer [Orb::Models::CustomerMinified]
45
+ #
46
+ # @param effective_date [Time, nil] When the subscription is migrated to the target plan version. Null unless the st
47
+ #
48
+ # @param failure_reason [String, nil] Why the subscription could not be migrated. Null unless the status is 'failed'.
49
+ #
50
+ # @param status [Symbol, Orb::Models::MigrationSubscription::Status] The subscription's status in the migration: 'scheduling' until the migration has
51
+ #
52
+ # @param subscription_id [String] The ID of the subscription.
53
+
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
+ #
60
+ # @see Orb::Models::MigrationSubscription#status
61
+ module Status
62
+ extend Orb::Internal::Type::Enum
63
+
64
+ SCHEDULING = :scheduling
65
+ SCHEDULED = :scheduled
66
+ COMPLETED = :completed
67
+ SKIPPED = :skipped
68
+ FAILED = :failed
69
+
70
+ # @!method self.values
71
+ # @return [Array<Symbol>]
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ module Migrations
6
+ # @see Orb::Resources::Migrations::Subscriptions#list
7
+ class SubscriptionListParams < Orb::Internal::Type::BaseModel
8
+ extend Orb::Internal::Type::RequestParameters::Converter
9
+ include Orb::Internal::Type::RequestParameters
10
+
11
+ # @!attribute migration_id
12
+ #
13
+ # @return [String]
14
+ required :migration_id, String
15
+
16
+ # @!attribute cursor
17
+ # Cursor for pagination. This can be populated by the `next_cursor` value returned
18
+ # from the initial request.
19
+ #
20
+ # @return [String, nil]
21
+ optional :cursor, String, nil?: true
22
+
23
+ # @!attribute limit
24
+ # The number of items to fetch. Defaults to 20.
25
+ #
26
+ # @return [Integer, nil]
27
+ optional :limit, Integer
28
+
29
+ # @!attribute status
30
+ # Only return subscriptions with one of these statuses.
31
+ #
32
+ # @return [Array<Symbol, Orb::Models::Migrations::SubscriptionListParams::Status>, nil]
33
+ optional :status,
34
+ -> { Orb::Internal::Type::ArrayOf[enum: Orb::Migrations::SubscriptionListParams::Status] },
35
+ nil?: true
36
+
37
+ # @!attribute subscription_id
38
+ # Only return these subscriptions. Up to 100 IDs.
39
+ #
40
+ # @return [Array<String>, nil]
41
+ optional :subscription_id, Orb::Internal::Type::ArrayOf[String], nil?: true
42
+
43
+ # @!method initialize(migration_id:, cursor: nil, limit: nil, status: nil, subscription_id: nil, request_options: {})
44
+ # Some parameter documentations has been truncated, see
45
+ # {Orb::Models::Migrations::SubscriptionListParams} for more details.
46
+ #
47
+ # @param migration_id [String]
48
+ #
49
+ # @param cursor [String, nil] Cursor for pagination. This can be populated by the `next_cursor` value returned
50
+ #
51
+ # @param limit [Integer] The number of items to fetch. Defaults to 20.
52
+ #
53
+ # @param status [Array<Symbol, Orb::Models::Migrations::SubscriptionListParams::Status>, nil] Only return subscriptions with one of these statuses.
54
+ #
55
+ # @param subscription_id [Array<String>, nil] Only return these subscriptions. Up to 100 IDs.
56
+ #
57
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
58
+
59
+ module Status
60
+ extend Orb::Internal::Type::Enum
61
+
62
+ SCHEDULING = :scheduling
63
+ SCHEDULED = :scheduled
64
+ COMPLETED = :completed
65
+ SKIPPED = :skipped
66
+ FAILED = :failed
67
+
68
+ # @!method self.values
69
+ # @return [Array<Symbol>]
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
@@ -74,6 +74,12 @@ module Orb
74
74
  # @return [String, nil]
75
75
  required :external_plan_id, String, nil?: true
76
76
 
77
+ # @!attribute has_draft
78
+ # Whether the plan has an unpublished draft version.
79
+ #
80
+ # @return [Boolean]
81
+ required :has_draft, Orb::Internal::Type::Boolean
82
+
77
83
  # @!attribute invoicing_currency
78
84
  # An ISO 4217 currency string for which this plan is billed in. Matches `currency`
79
85
  # unless `currency` is a custom pricing unit.
@@ -161,7 +167,7 @@ module Orb
161
167
  # @return [Integer]
162
168
  required :version, Integer
163
169
 
164
- # @!method initialize(id:, adjustments:, base_plan:, base_plan_id:, created_at:, currency:, default_invoice_memo:, description:, discount:, external_plan_id:, invoicing_currency:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, net_terms:, plan_phases:, prices:, product:, status:, trial_config:, version:)
170
+ # @!method initialize(id:, adjustments:, base_plan:, base_plan_id:, created_at:, currency:, default_invoice_memo:, description:, discount:, external_plan_id:, has_draft:, invoicing_currency:, maximum:, maximum_amount:, metadata:, minimum:, minimum_amount:, name:, net_terms:, plan_phases:, prices:, product:, status:, trial_config:, version:)
165
171
  # Some parameter documentations has been truncated, see {Orb::Models::Plan} for
166
172
  # more details.
167
173
  #
@@ -190,6 +196,8 @@ module Orb
190
196
  #
191
197
  # @param external_plan_id [String, nil] An optional user-defined ID for this plan resource, used throughout the system a
192
198
  #
199
+ # @param has_draft [Boolean] Whether the plan has an unpublished draft version.
200
+ #
193
201
  # @param invoicing_currency [String] An ISO 4217 currency string for which this plan is billed in. Matches `currency`
194
202
  #
195
203
  # @param maximum [Orb::Models::Maximum, nil]
@@ -12,9 +12,10 @@ module Orb
12
12
  required :id, String
13
13
 
14
14
  # @!attribute effective_time
15
- # When the migration takes effect. Can be a specific date/time, 'end_of_term' when
16
- # scheduled to be at the end of the current billing period, or 'end_of_invoice'
17
- # when scheduled to be at the start of the next invoice.
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.
18
19
  #
19
20
  # @return [Date, Time, Symbol, Orb::Models::Plans::MigrationCancelResponse::EffectiveTime, nil]
20
21
  required :effective_time,
@@ -48,13 +49,23 @@ module Orb
48
49
  # @return [Symbol, Orb::Models::Plans::MigrationCancelResponse::Status]
49
50
  required :status, enum: -> { Orb::Models::Plans::MigrationCancelResponse::Status }
50
51
 
51
- # @!method initialize(id:, effective_time:, ended_at:, plan_id:, started_at:, status:)
52
+ # @!attribute target_plan_version_number
53
+ # The plan version subscriptions are migrated to.
54
+ #
55
+ # @return [Integer]
56
+ required :target_plan_version_number, Integer
57
+
58
+ # @!method initialize(id:, effective_time:, ended_at:, plan_id:, started_at:, status:, target_plan_version_number:)
52
59
  # Some parameter documentations has been truncated, see
53
60
  # {Orb::Models::Plans::MigrationCancelResponse} for more details.
54
61
  #
62
+ # A migration moves a plan's subscriptions onto one of the plan's versions. Each
63
+ # subscription is migrated asynchronously, either immediately or at a scheduled
64
+ # time, and the migration reports its overall status as it progresses.
65
+ #
55
66
  # @param id [String] Unique identifier for this plan version change.
56
67
  #
57
- # @param effective_time [Date, Time, Symbol, Orb::Models::Plans::MigrationCancelResponse::EffectiveTime, nil] When the migration takes effect. Can be a specific date/time, 'end_of_term' when
68
+ # @param effective_time [Date, Time, Symbol, Orb::Models::Plans::MigrationCancelResponse::EffectiveTime, nil] When the migration takes effect. Can be a specific date/time, 'start_of_term' or
58
69
  #
59
70
  # @param ended_at [Time, nil] When the migration completed or was canceled, or null if it is still in progress
60
71
  #
@@ -63,10 +74,13 @@ module Orb
63
74
  # @param started_at [Time, nil] When Orb began migrating the plan's subscriptions. Null if the migration has not
64
75
  #
65
76
  # @param status [Symbol, Orb::Models::Plans::MigrationCancelResponse::Status] Current status of the migration: 'not_started', 'in_progress', 'completed', 'act
77
+ #
78
+ # @param target_plan_version_number [Integer] The plan version subscriptions are migrated to.
66
79
 
67
- # When the migration takes effect. Can be a specific date/time, 'end_of_term' when
68
- # scheduled to be at the end of the current billing period, or 'end_of_invoice'
69
- # when scheduled to be at the start of the next invoice.
80
+ # When the migration takes effect. Can be a specific date/time, 'start_of_term' or
81
+ # 'end_of_term' when scheduled to be at the start or end of the current billing
82
+ # period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
83
+ # start of the current or next invoice.
70
84
  #
71
85
  # @see Orb::Models::Plans::MigrationCancelResponse#effective_time
72
86
  module EffectiveTime
@@ -76,8 +90,12 @@ module Orb
76
90
 
77
91
  variant Time
78
92
 
93
+ variant const: -> { Orb::Models::Plans::MigrationCancelResponse::EffectiveTime::START_OF_TERM }
94
+
79
95
  variant const: -> { Orb::Models::Plans::MigrationCancelResponse::EffectiveTime::END_OF_TERM }
80
96
 
97
+ variant const: -> { Orb::Models::Plans::MigrationCancelResponse::EffectiveTime::START_OF_INVOICE }
98
+
81
99
  variant const: -> { Orb::Models::Plans::MigrationCancelResponse::EffectiveTime::END_OF_INVOICE }
82
100
 
83
101
  # @!method self.variants
@@ -89,7 +107,9 @@ module Orb
89
107
 
90
108
  # @!group
91
109
 
110
+ START_OF_TERM = :start_of_term
92
111
  END_OF_TERM = :end_of_term
112
+ START_OF_INVOICE = :start_of_invoice
93
113
  END_OF_INVOICE = :end_of_invoice
94
114
 
95
115
  # @!endgroup
@@ -12,9 +12,10 @@ module Orb
12
12
  required :id, String
13
13
 
14
14
  # @!attribute effective_time
15
- # When the migration takes effect. Can be a specific date/time, 'end_of_term' when
16
- # scheduled to be at the end of the current billing period, or 'end_of_invoice'
17
- # when scheduled to be at the start of the next invoice.
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.
18
19
  #
19
20
  # @return [Date, Time, Symbol, Orb::Models::Plans::MigrationListResponse::EffectiveTime, nil]
20
21
  required :effective_time,
@@ -48,13 +49,23 @@ module Orb
48
49
  # @return [Symbol, Orb::Models::Plans::MigrationListResponse::Status]
49
50
  required :status, enum: -> { Orb::Models::Plans::MigrationListResponse::Status }
50
51
 
51
- # @!method initialize(id:, effective_time:, ended_at:, plan_id:, started_at:, status:)
52
+ # @!attribute target_plan_version_number
53
+ # The plan version subscriptions are migrated to.
54
+ #
55
+ # @return [Integer]
56
+ required :target_plan_version_number, Integer
57
+
58
+ # @!method initialize(id:, effective_time:, ended_at:, plan_id:, started_at:, status:, target_plan_version_number:)
52
59
  # Some parameter documentations has been truncated, see
53
60
  # {Orb::Models::Plans::MigrationListResponse} for more details.
54
61
  #
62
+ # A migration moves a plan's subscriptions onto one of the plan's versions. Each
63
+ # subscription is migrated asynchronously, either immediately or at a scheduled
64
+ # time, and the migration reports its overall status as it progresses.
65
+ #
55
66
  # @param id [String] Unique identifier for this plan version change.
56
67
  #
57
- # @param effective_time [Date, Time, Symbol, Orb::Models::Plans::MigrationListResponse::EffectiveTime, nil] When the migration takes effect. Can be a specific date/time, 'end_of_term' when
68
+ # @param effective_time [Date, Time, Symbol, Orb::Models::Plans::MigrationListResponse::EffectiveTime, nil] When the migration takes effect. Can be a specific date/time, 'start_of_term' or
58
69
  #
59
70
  # @param ended_at [Time, nil] When the migration completed or was canceled, or null if it is still in progress
60
71
  #
@@ -63,10 +74,13 @@ module Orb
63
74
  # @param started_at [Time, nil] When Orb began migrating the plan's subscriptions. Null if the migration has not
64
75
  #
65
76
  # @param status [Symbol, Orb::Models::Plans::MigrationListResponse::Status] Current status of the migration: 'not_started', 'in_progress', 'completed', 'act
77
+ #
78
+ # @param target_plan_version_number [Integer] The plan version subscriptions are migrated to.
66
79
 
67
- # When the migration takes effect. Can be a specific date/time, 'end_of_term' when
68
- # scheduled to be at the end of the current billing period, or 'end_of_invoice'
69
- # when scheduled to be at the start of the next invoice.
80
+ # When the migration takes effect. Can be a specific date/time, 'start_of_term' or
81
+ # 'end_of_term' when scheduled to be at the start or end of the current billing
82
+ # period, or 'start_of_invoice' or 'end_of_invoice' when scheduled to be at the
83
+ # start of the current or next invoice.
70
84
  #
71
85
  # @see Orb::Models::Plans::MigrationListResponse#effective_time
72
86
  module EffectiveTime
@@ -76,8 +90,12 @@ module Orb
76
90
 
77
91
  variant Time
78
92
 
93
+ variant const: -> { Orb::Models::Plans::MigrationListResponse::EffectiveTime::START_OF_TERM }
94
+
79
95
  variant const: -> { Orb::Models::Plans::MigrationListResponse::EffectiveTime::END_OF_TERM }
80
96
 
97
+ variant const: -> { Orb::Models::Plans::MigrationListResponse::EffectiveTime::START_OF_INVOICE }
98
+
81
99
  variant const: -> { Orb::Models::Plans::MigrationListResponse::EffectiveTime::END_OF_INVOICE }
82
100
 
83
101
  # @!method self.variants
@@ -89,7 +107,9 @@ module Orb
89
107
 
90
108
  # @!group
91
109
 
110
+ START_OF_TERM = :start_of_term
92
111
  END_OF_TERM = :end_of_term
112
+ START_OF_INVOICE = :start_of_invoice
93
113
  END_OF_INVOICE = :end_of_invoice
94
114
 
95
115
  # @!endgroup