Class: Orb::Resources::Plans::ExternalPlanID
- Inherits:
-
Object
- Object
- Orb::Resources::Plans::ExternalPlanID
- Defined in:
- lib/orb/resources/plans/external_plan_id.rb
Instance Method Summary collapse
-
#fetch(external_plan_id, request_options: {}) ⇒ Orb::Models::Plan
This endpoint is used to fetch [plan](/core-concepts##plan-and-price) details given an external_plan_id identifier.
-
#initialize(client:) ⇒ ExternalPlanID
constructor
private
A new instance of ExternalPlanID.
-
#update(other_external_plan_id, external_plan_id: nil, metadata: nil, request_options: {}) ⇒ Orb::Models::Plan
Some parameter documentations has been truncated, see Models::Plans::ExternalPlanIDUpdateParams for more details.
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.
76 77 78 |
# File 'lib/orb/resources/plans/external_plan_id.rb', line 76 def initialize(client:) @client = client end |
Instance Method Details
#fetch(external_plan_id, request_options: {}) ⇒ Orb::Models::Plan
This endpoint is used to fetch [plan](/core-concepts##plan-and-price) details given an external_plan_id identifier. It returns information about the prices included in the plan and their configuration, as well as the product that the plan is attached to.
If multiple plans are found to contain the specified external_plan_id, the active plans will take priority over archived ones, and among those, the endpoint will return the most recently created plan.
## Serialized prices
Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a given [Price](/core-concepts#plan-and-price) object. The ‘model_type` field determines the key for the configuration object that is present. A detailed explanation of price types can be found in the [Price schema](/core-concepts#plan-and-price). “
64 65 66 67 68 69 70 71 |
# File 'lib/orb/resources/plans/external_plan_id.rb', line 64 def fetch(external_plan_id, params = {}) @client.request( method: :get, path: ["plans/external_plan_id/%1$s", external_plan_id], model: Orb::Plan, options: params[:request_options] ) end |
#update(other_external_plan_id, external_plan_id: nil, metadata: nil, request_options: {}) ⇒ Orb::Models::Plan
Some parameter documentations has been truncated, see Models::Plans::ExternalPlanIDUpdateParams for more details.
This endpoint can be used to update the ‘external_plan_id`, and `metadata` of an existing plan.
Other fields on a plan are currently immutable.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/orb/resources/plans/external_plan_id.rb', line 28 def update(other_external_plan_id, params = {}) parsed, = Orb::Plans::ExternalPlanIDUpdateParams.dump_request(params) @client.request( method: :put, path: ["plans/external_plan_id/%1$s", other_external_plan_id], body: parsed, model: Orb::Plan, options: ) end |