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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ef71ac9d9c81b9dea0fab1815ad86078a1748dbf786c337f6d4674343a42d03
4
- data.tar.gz: f19d04fcd3bef9138b70c93af37b7ed69ab58a446a59262571bb97dd943e3c74
3
+ metadata.gz: aaede78921bee8ab038640273109b6d9006ae6a078bc0c55e82820e163c9a83c
4
+ data.tar.gz: a450f96afde784146606d099bb3a255a4b362f09d701ae68bfba3f43de77f4f3
5
5
  SHA512:
6
- metadata.gz: dc018e955adc3e59db185c65ba0ae34479ef8bc3f7cdcfc8c431772776a02b93fda78c22b61514e0b2f715da8d43caf3ce3d52d9e5584e718f650e780d0af7d3
7
- data.tar.gz: b1655fcd76a789906e3fbccda8509f9c733b805a7e2e9efc4bf3aab2fcc8f205514e58bec67da7fad9e179b876c2eec96cd6a427d5024224e6c950b461864b97
6
+ metadata.gz: 366f9bc195d4e3c914f2f4efa059a5b8c387a3d68b5fda069cab4d5faef22669bb2bacea424df3a542ed40fcaec659c942add9aac4d194abcbb057fd24493591
7
+ data.tar.gz: 3a4c96b9684834461f8bbba4925dcffc462659411f66207d3e9f5cbbfecaf6a2641536910f83b9cb7c4d288390ad4f3a1788024d263f4a6e4c7096f4ad223032
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.57.0](https://github.com/orbcorp/orb-ruby/compare/v1.56.0...v1.57.0) (2026-11-14)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** api update ([cbac7e8](https://github.com/orbcorp/orb-ruby/commit/cbac7e867077069a9d12302b97453b3112533372))
9
+
10
+ ## [1.56.0](https://github.com/orbcorp/orb-ruby/compare/v1.55.0...v1.56.0) (2026-11-13)
11
+
12
+
13
+ ### Features
14
+
15
+ * **api:** allow changing item_id on active metrics ([22348b9](https://github.com/orbcorp/orb-ruby/commit/22348b96def523d51a7af440aece88608118d50c))
16
+ * **api:** api update ([7d0e3d3](https://github.com/orbcorp/orb-ruby/commit/7d0e3d3d8fdffdf0ba92373915840401ba38d2e8))
17
+ * **api:** api update ([5ed2dd7](https://github.com/orbcorp/orb-ruby/commit/5ed2dd7c3e270be63ff343e5e8afd2ecf9a62ea1))
18
+
3
19
  ## [1.55.0](https://github.com/orbcorp/orb-ruby/compare/v1.54.0...v1.55.0) (2026-11-07)
4
20
 
5
21
 
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "orb-billing", "~> 1.55.0"
18
+ gem "orb-billing", "~> 1.57.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
data/lib/orb/client.rb CHANGED
@@ -114,6 +114,12 @@ module Orb
114
114
  # @return [Orb::Resources::Plans]
115
115
  attr_reader :plans
116
116
 
117
+ # A migration moves a plan's subscriptions onto one of the plan's versions. Each
118
+ # subscription is migrated asynchronously, either immediately or at a scheduled
119
+ # time, and the migration reports its overall status as it progresses.
120
+ # @return [Orb::Resources::Migrations]
121
+ attr_reader :migrations
122
+
117
123
  # The Price resource represents a price that can be billed on a subscription,
118
124
  # resulting in a charge on an invoice in the form of an invoice line item. Prices
119
125
  # take a quantity and determine an amount to bill.
@@ -240,6 +246,7 @@ module Orb
240
246
  @webhook_endpoints = Orb::Resources::WebhookEndpoints.new(client: self)
241
247
  @metrics = Orb::Resources::Metrics.new(client: self)
242
248
  @plans = Orb::Resources::Plans.new(client: self)
249
+ @migrations = Orb::Resources::Migrations.new(client: self)
243
250
  @prices = Orb::Resources::Prices.new(client: self)
244
251
  @subscriptions = Orb::Resources::Subscriptions.new(client: self)
245
252
  @alerts = Orb::Resources::Alerts.new(client: self)
@@ -19,8 +19,9 @@ module Orb
19
19
  optional :description, String, nil?: true
20
20
 
21
21
  # @!attribute item_id
22
- # The id of the item to associate the metric with. Can only be changed while the
23
- # metric is in `draft` status.
22
+ # The id of the item to associate the metric with. Prices created on the metric
23
+ # afterwards use the new item; existing prices keep the item they were created
24
+ # with.
24
25
  #
25
26
  # @return [String, nil]
26
27
  optional :item_id, String, nil?: true
@@ -55,7 +56,7 @@ module Orb
55
56
  #
56
57
  # @param description [String, nil] A description of the metric.
57
58
  #
58
- # @param item_id [String, nil] The id of the item to associate the metric with. Can only be changed while the m
59
+ # @param item_id [String, nil] The id of the item to associate the metric with. Prices created on the metric af
59
60
  #
60
61
  # @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
61
62
  #
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::Migrations#cancel
6
+ class MigrationCancelParams < 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#cancel
6
+ class MigrationCancelResponse < 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::MigrationCancelResponse::EffectiveTime, nil]
20
+ required :effective_time, union: -> { Orb::Models::MigrationCancelResponse::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::MigrationCancelResponse::Status]
47
+ required :status, enum: -> { Orb::Models::MigrationCancelResponse::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::MigrationCancelResponse} 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::MigrationCancelResponse::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::MigrationCancelResponse::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::MigrationCancelResponse#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::MigrationCancelResponse::EffectiveTime::START_OF_TERM }
91
+
92
+ variant const: -> { Orb::Models::MigrationCancelResponse::EffectiveTime::END_OF_TERM }
93
+
94
+ variant const: -> { Orb::Models::MigrationCancelResponse::EffectiveTime::START_OF_INVOICE }
95
+
96
+ variant const: -> { Orb::Models::MigrationCancelResponse::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::MigrationCancelResponse::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::MigrationCancelResponse#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,159 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::Migrations#create
6
+ class MigrationCreateParams < Orb::Internal::Type::BaseModel
7
+ extend Orb::Internal::Type::RequestParameters::Converter
8
+ include Orb::Internal::Type::RequestParameters
9
+
10
+ # @!attribute effective_time
11
+ # When the migration takes effect: 'immediately', 'requested_date' on
12
+ # `effective_date`, 'start_of_term' or 'end_of_term' for the start or end of each
13
+ # subscription's current billing period, or 'start_of_invoice' or 'end_of_invoice'
14
+ # for the start of its current or next invoice.
15
+ #
16
+ # @return [Symbol, Orb::Models::MigrationCreateParams::EffectiveTime]
17
+ required :effective_time, enum: -> { Orb::MigrationCreateParams::EffectiveTime }
18
+
19
+ # @!attribute target_plan_version_number
20
+ # The plan version to migrate subscriptions to. It can't be a draft version.
21
+ #
22
+ # @return [Integer]
23
+ required :target_plan_version_number, Integer
24
+
25
+ # @!attribute allow_invoice_credit_or_void
26
+ # When false, a subscription whose migration would void an issued invoice or
27
+ # create a credit note fails instead.
28
+ #
29
+ # @return [Boolean, nil]
30
+ optional :allow_invoice_credit_or_void, Orb::Internal::Type::Boolean
31
+
32
+ # @!attribute can_defer_billing
33
+ # When true, an in-arrears price the migration ends mid-cycle bills its final line
34
+ # item on the next scheduled invoice instead of on its end date.
35
+ #
36
+ # @return [Boolean, nil]
37
+ optional :can_defer_billing, Orb::Internal::Type::Boolean
38
+
39
+ # @!attribute effective_date
40
+ # The date the migration takes effect, at midnight in each customer's timezone.
41
+ # Required when `effective_time` is `requested_date`, and not allowed otherwise.
42
+ #
43
+ # @return [Date, nil]
44
+ optional :effective_date, Date, nil?: true
45
+
46
+ # @!attribute excluded_subscription_ids
47
+ # Leave these subscriptions out. Can't be combined with
48
+ # `included_subscription_ids`.
49
+ #
50
+ # @return [Array<String>, nil]
51
+ optional :excluded_subscription_ids, Orb::Internal::Type::ArrayOf[String], nil?: true
52
+
53
+ # @!attribute external_plan_id
54
+ # The external ID of the plan whose subscriptions to migrate.
55
+ #
56
+ # @return [String, nil]
57
+ optional :external_plan_id, String, nil?: true
58
+
59
+ # @!attribute in_trial
60
+ # `true` migrates only subscriptions in a trial, `false` only subscriptions not in
61
+ # a trial.
62
+ #
63
+ # @return [Boolean, nil]
64
+ optional :in_trial, Orb::Internal::Type::Boolean, nil?: true
65
+
66
+ # @!attribute included_subscription_ids
67
+ # Migrate only these subscriptions. When set, the filters below are ignored.
68
+ #
69
+ # @return [Array<String>, nil]
70
+ optional :included_subscription_ids, Orb::Internal::Type::ArrayOf[String], nil?: true
71
+
72
+ # @!attribute plan_id
73
+ # The plan whose subscriptions to migrate. Exactly one of `plan_id` and
74
+ # `external_plan_id` is required.
75
+ #
76
+ # @return [String, nil]
77
+ optional :plan_id, String, nil?: true
78
+
79
+ # @!attribute plan_version_numbers
80
+ # Migrate only subscriptions currently on these plan versions.
81
+ #
82
+ # @return [Array<Integer>, nil]
83
+ optional :plan_version_numbers, Orb::Internal::Type::ArrayOf[Integer], nil?: true
84
+
85
+ # @!attribute reason
86
+ # Why the migration was created.
87
+ #
88
+ # @return [String, nil]
89
+ optional :reason, String, nil?: true
90
+
91
+ # @!attribute statuses
92
+ # Migrate subscriptions with these statuses. Defaults to active subscriptions.
93
+ #
94
+ # @return [Array<Symbol, Orb::Models::MigrationCreateParams::Status>, nil]
95
+ optional :statuses, -> { Orb::Internal::Type::ArrayOf[enum: Orb::MigrationCreateParams::Status] }
96
+
97
+ # @!method initialize(effective_time:, target_plan_version_number:, allow_invoice_credit_or_void: nil, can_defer_billing: nil, effective_date: nil, excluded_subscription_ids: nil, external_plan_id: nil, in_trial: nil, included_subscription_ids: nil, plan_id: nil, plan_version_numbers: nil, reason: nil, statuses: nil, request_options: {})
98
+ # Some parameter documentations has been truncated, see
99
+ # {Orb::Models::MigrationCreateParams} for more details.
100
+ #
101
+ # @param effective_time [Symbol, Orb::Models::MigrationCreateParams::EffectiveTime] When the migration takes effect: 'immediately', 'requested_date' on `effective_d
102
+ #
103
+ # @param target_plan_version_number [Integer] The plan version to migrate subscriptions to. It can't be a draft version.
104
+ #
105
+ # @param allow_invoice_credit_or_void [Boolean] When false, a subscription whose migration would void an issued invoice or creat
106
+ #
107
+ # @param can_defer_billing [Boolean] When true, an in-arrears price the migration ends mid-cycle bills its final line
108
+ #
109
+ # @param effective_date [Date, nil] The date the migration takes effect, at midnight in each customer's timezone. Re
110
+ #
111
+ # @param excluded_subscription_ids [Array<String>, nil] Leave these subscriptions out. Can't be combined with `included_subscription_ids
112
+ #
113
+ # @param external_plan_id [String, nil] The external ID of the plan whose subscriptions to migrate.
114
+ #
115
+ # @param in_trial [Boolean, nil] `true` migrates only subscriptions in a trial, `false` only subscriptions not in
116
+ #
117
+ # @param included_subscription_ids [Array<String>, nil] Migrate only these subscriptions. When set, the filters below are ignored.
118
+ #
119
+ # @param plan_id [String, nil] The plan whose subscriptions to migrate. Exactly one of `plan_id` and
120
+ # `external\_
121
+ #
122
+ # @param plan_version_numbers [Array<Integer>, nil] Migrate only subscriptions currently on these plan versions.
123
+ #
124
+ # @param reason [String, nil] Why the migration was created.
125
+ #
126
+ # @param statuses [Array<Symbol, Orb::Models::MigrationCreateParams::Status>] Migrate subscriptions with these statuses. Defaults to active subscriptions.
127
+ #
128
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
129
+
130
+ # When the migration takes effect: 'immediately', 'requested_date' on
131
+ # `effective_date`, 'start_of_term' or 'end_of_term' for the start or end of each
132
+ # subscription's current billing period, or 'start_of_invoice' or 'end_of_invoice'
133
+ # for the start of its current or next invoice.
134
+ module EffectiveTime
135
+ extend Orb::Internal::Type::Enum
136
+
137
+ IMMEDIATELY = :immediately
138
+ REQUESTED_DATE = :requested_date
139
+ START_OF_TERM = :start_of_term
140
+ END_OF_TERM = :end_of_term
141
+ START_OF_INVOICE = :start_of_invoice
142
+ END_OF_INVOICE = :end_of_invoice
143
+
144
+ # @!method self.values
145
+ # @return [Array<Symbol>]
146
+ end
147
+
148
+ module Status
149
+ extend Orb::Internal::Type::Enum
150
+
151
+ ACTIVE = :active
152
+ UPCOMING = :upcoming
153
+
154
+ # @!method self.values
155
+ # @return [Array<Symbol>]
156
+ end
157
+ end
158
+ end
159
+ end
@@ -0,0 +1,133 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::Migrations#create
6
+ class MigrationCreateResponse < 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::MigrationCreateResponse::EffectiveTime, nil]
20
+ required :effective_time, union: -> { Orb::Models::MigrationCreateResponse::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::MigrationCreateResponse::Status]
47
+ required :status, enum: -> { Orb::Models::MigrationCreateResponse::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::MigrationCreateResponse} 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::MigrationCreateResponse::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::MigrationCreateResponse::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::MigrationCreateResponse#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::MigrationCreateResponse::EffectiveTime::START_OF_TERM }
91
+
92
+ variant const: -> { Orb::Models::MigrationCreateResponse::EffectiveTime::END_OF_TERM }
93
+
94
+ variant const: -> { Orb::Models::MigrationCreateResponse::EffectiveTime::START_OF_INVOICE }
95
+
96
+ variant const: -> { Orb::Models::MigrationCreateResponse::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::MigrationCreateResponse::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::MigrationCreateResponse#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,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::Migrations#list
6
+ class MigrationListParams < Orb::Internal::Type::BaseModel
7
+ extend Orb::Internal::Type::RequestParameters::Converter
8
+ include Orb::Internal::Type::RequestParameters
9
+
10
+ # @!attribute cursor
11
+ # Cursor for pagination. This can be populated by the `next_cursor` value returned
12
+ # from the initial request.
13
+ #
14
+ # @return [String, nil]
15
+ optional :cursor, String, nil?: true
16
+
17
+ # @!attribute external_plan_id
18
+ #
19
+ # @return [String, nil]
20
+ optional :external_plan_id, String, nil?: true
21
+
22
+ # @!attribute limit
23
+ # The number of items to fetch. Defaults to 20.
24
+ #
25
+ # @return [Integer, nil]
26
+ optional :limit, Integer
27
+
28
+ # @!attribute plan_id
29
+ #
30
+ # @return [String, nil]
31
+ optional :plan_id, String, nil?: true
32
+
33
+ # @!method initialize(cursor: nil, external_plan_id: nil, limit: nil, plan_id: nil, request_options: {})
34
+ # Some parameter documentations has been truncated, see
35
+ # {Orb::Models::MigrationListParams} for more details.
36
+ #
37
+ # @param cursor [String, nil] Cursor for pagination. This can be populated by the `next_cursor` value returned
38
+ #
39
+ # @param external_plan_id [String, nil]
40
+ #
41
+ # @param limit [Integer] The number of items to fetch. Defaults to 20.
42
+ #
43
+ # @param plan_id [String, nil]
44
+ #
45
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
46
+ end
47
+ end
48
+ end