Class: Orb::Resources::Beta::ExternalPlanID
- Inherits:
-
Object
- Object
- Orb::Resources::Beta::ExternalPlanID
- Defined in:
- lib/orb/resources/beta/external_plan_id.rb
Instance Method Summary collapse
-
#create_plan_version(external_plan_id, version: , add_adjustments: nil, add_prices: nil, remove_adjustments: nil, remove_prices: nil, replace_adjustments: nil, replace_prices: nil, set_as_default: nil, request_options: {}) ⇒ Orb::Models::PlanVersion
This API endpoint is in beta and its interface may change.
-
#fetch_plan_version(version, external_plan_id: , request_options: {}) ⇒ Orb::Models::PlanVersion
This API endpoint is in beta and its interface may change.
-
#initialize(client:) ⇒ ExternalPlanID
constructor
private
A new instance of ExternalPlanID.
-
#set_default_plan_version(external_plan_id, version: , request_options: {}) ⇒ Orb::Models::Plan
This API endpoint is in beta and its interface may change.
Constructor Details
#initialize(client:) ⇒ ExternalPlanID
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 ExternalPlanID.
107 108 109 |
# File 'lib/orb/resources/beta/external_plan_id.rb', line 107 def initialize(client:) @client = client end |
Instance Method Details
#create_plan_version(external_plan_id, version: , add_adjustments: nil, add_prices: nil, remove_adjustments: nil, remove_prices: nil, replace_adjustments: nil, replace_prices: nil, set_as_default: nil, request_options: {}) ⇒ Orb::Models::PlanVersion
This API endpoint is in beta and its interface may change. It is recommended for use only in test mode.
This endpoint allows the creation of a new plan version for an existing plan.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/orb/resources/beta/external_plan_id.rb', line 37 def create_plan_version(external_plan_id, params) parsed, = Orb::Beta::ExternalPlanIDCreatePlanVersionParams.dump_request(params) @client.request( method: :post, path: ["plans/external_plan_id/%1$s/versions", external_plan_id], body: parsed, model: Orb::PlanVersion, options: ) end |
#fetch_plan_version(version, external_plan_id: , request_options: {}) ⇒ Orb::Models::PlanVersion
This API endpoint is in beta and its interface may change. It is recommended for use only in test mode.
This endpoint is used to fetch a plan version. It returns the phases, prices, and adjustments present on this version of the plan.
63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/orb/resources/beta/external_plan_id.rb', line 63 def fetch_plan_version(version, params) parsed, = Orb::Beta::ExternalPlanIDFetchPlanVersionParams.dump_request(params) external_plan_id = parsed.delete(:external_plan_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["plans/external_plan_id/%1$s/versions/%2$s", external_plan_id, version], model: Orb::PlanVersion, options: ) end |
#set_default_plan_version(external_plan_id, version: , request_options: {}) ⇒ Orb::Models::Plan
This API endpoint is in beta and its interface may change. It is recommended for use only in test mode.
This endpoint allows setting the default version of a plan.
93 94 95 96 97 98 99 100 101 102 |
# File 'lib/orb/resources/beta/external_plan_id.rb', line 93 def set_default_plan_version(external_plan_id, params) parsed, = Orb::Beta::ExternalPlanIDSetDefaultPlanVersionParams.dump_request(params) @client.request( method: :post, path: ["plans/external_plan_id/%1$s/set_default_version", external_plan_id], body: parsed, model: Orb::Plan, options: ) end |