Class: Orb::Resources::Plans::ExternalPlanID
- Inherits:
-
Object
- Object
- Orb::Resources::Plans::ExternalPlanID
- Defined in:
- lib/orb/resources/plans/external_plan_id.rb,
sig/orb/resources/plans/external_plan_id.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
-
#fetch(external_plan_id, request_options: {}) ⇒ Orb::Models::Plan
This endpoint is used to fetch plan details given an external_plan_id identifier.
-
#initialize(client:) ⇒ ExternalPlanID
constructor
private
A new instance of ExternalPlanID.
-
#update(other_external_plan_id, description: nil, 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.
82 83 84 |
# File 'lib/orb/resources/plans/external_plan_id.rb', line 82 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 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
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. "
70 71 72 73 74 75 76 77 |
# File 'lib/orb/resources/plans/external_plan_id.rb', line 70 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, description: nil, 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, description, and
metadata of an existing plan.
Other fields on a plan are currently immutable.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/orb/resources/plans/external_plan_id.rb', line 34 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 |