Class: Orb::Resources::Plans::Migrations
- Inherits:
-
Object
- Object
- Orb::Resources::Plans::Migrations
- Defined in:
- lib/orb/resources/plans/migrations.rb,
sig/orb/resources/plans/migrations.rbs
Overview
The Plan resource represents a plan that can be subscribed to by a customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices in the Price resource.
Instance Method Summary collapse
-
#cancel(migration_id, plan_id:, request_options: {}) ⇒ Orb::Models::Plans::MigrationCancelResponse
This endpoint cancels a migration.
-
#initialize(client:) ⇒ Migrations
constructor
private
A new instance of Migrations.
-
#list(plan_id, cursor: nil, limit: nil, request_options: {}) ⇒ Orb::Internal::Page<Orb::Models::Plans::MigrationListResponse>
Some parameter documentations has been truncated, see Models::Plans::MigrationListParams for more details.
-
#retrieve(migration_id, plan_id:, request_options: {}) ⇒ Orb::Models::Plans::MigrationRetrieveResponse
Fetch migration.
Constructor Details
#initialize(client:) ⇒ Migrations
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Migrations.
98 99 100 |
# File 'lib/orb/resources/plans/migrations.rb', line 98 def initialize(client:) @client = client end |
Instance Method Details
#cancel(migration_id, plan_id:, request_options: {}) ⇒ Orb::Models::Plans::MigrationCancelResponse
This endpoint cancels a migration.
81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/orb/resources/plans/migrations.rb', line 81 def cancel(migration_id, params) parsed, = Orb::Plans::MigrationCancelParams.dump_request(params) plan_id = parsed.delete(:plan_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["plans/%1$s/migrations/%2$s/cancel", plan_id, migration_id], model: Orb::Models::Plans::MigrationCancelResponse, options: ) end |
#list(plan_id, cursor: nil, limit: nil, request_options: {}) ⇒ Orb::Internal::Page<Orb::Models::Plans::MigrationListResponse>
Some parameter documentations has been truncated, see Models::Plans::MigrationListParams for more details.
This endpoint returns a list of all migrations for a plan. The list of migrations is ordered starting from the most recently created migration. The response also includes pagination_metadata, which lets the caller retrieve the next page of results if they exist.
57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/orb/resources/plans/migrations.rb', line 57 def list(plan_id, params = {}) parsed, = Orb::Plans::MigrationListParams.dump_request(params) query = Orb::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["plans/%1$s/migrations", plan_id], query: query, page: Orb::Internal::Page, model: Orb::Models::Plans::MigrationListResponse, options: ) end |
#retrieve(migration_id, plan_id:, request_options: {}) ⇒ Orb::Models::Plans::MigrationRetrieveResponse
Fetch migration
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/orb/resources/plans/migrations.rb', line 22 def retrieve(migration_id, params) parsed, = Orb::Plans::MigrationRetrieveParams.dump_request(params) plan_id = parsed.delete(:plan_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["plans/%1$s/migrations/%2$s", plan_id, migration_id], model: Orb::Models::Plans::MigrationRetrieveResponse, options: ) end |