Class: Nombaone::Resources::Prices
- Inherits:
-
BaseResource
- Object
- BaseResource
- Nombaone::Resources::Prices
- Defined in:
- lib/nombaone/resources/prices.rb,
sig/nombaone/resources.rbs
Overview
Prices — the amounts and cadences plans are sold at. Create and list them
under a plan via nombaone.plans.prices; this namespace reads and
deactivates them directly.
Prices are immutable once created — to change pricing, create a new price and deactivate the old one. Existing subscriptions keep the price they were sold at.
Instance Method Summary collapse
-
#deactivate(id, request_options: {}) ⇒ NombaObject
Deactivate a price so no new subscriptions can be created against it.
-
#list(plan_ref: OMIT, active: OMIT, limit: OMIT, cursor: OMIT, request_options: {}) ⇒ Page<NombaObject>
List prices across all plans, newest first.
-
#retrieve(id, request_options: {}) ⇒ NombaObject
Retrieve a price by id.
Methods inherited from BaseResource
#encode, #initialize, #request, #request_page
Constructor Details
This class inherits a constructor from Nombaone::Resources::BaseResource
Instance Method Details
#deactivate(id, request_options: {}) ⇒ NombaObject
Deactivate a price so no new subscriptions can be created against it. Existing subscriptions are unaffected — prices are immutable history.
48 49 50 |
# File 'lib/nombaone/resources/prices.rb', line 48 def deactivate(id, request_options: {}) request(:post, "/prices/#{encode(id)}/deactivate", body: {}, options: ) end |
#list(plan_ref: OMIT, active: OMIT, limit: OMIT, cursor: OMIT, request_options: {}) ⇒ Page<NombaObject>
List prices across all plans, newest first.
35 36 37 38 39 |
# File 'lib/nombaone/resources/prices.rb', line 35 def list(plan_ref: OMIT, active: OMIT, limit: OMIT, cursor: OMIT, request_options: {}) request_page("/prices", query: { plan_ref: plan_ref, active: active, limit: limit, cursor: cursor }, options: ) end |
#retrieve(id, request_options: {}) ⇒ NombaObject
Retrieve a price by id.
19 20 21 |
# File 'lib/nombaone/resources/prices.rb', line 19 def retrieve(id, request_options: {}) request(:get, "/prices/#{encode(id)}", options: ) end |