Class: Inttegro::Resources::Prices
- Inherits:
-
Object
- Object
- Inttegro::Resources::Prices
- Defined in:
- lib/inttegro/resources/prices.rb
Overview
Client for catalog prices and their lifecycle.
Access this resource through Client#prices.
Instance Method Summary collapse
-
#activate(price_id:) ⇒ Inttegro::Price::CatalogPrice
Reactivate an inactive price.
-
#archive(price_id:) ⇒ Inttegro::Price::CatalogPrice
Archive a price and mark it inactive.
-
#create(payload) ⇒ Inttegro::Price::CatalogPrice
Create a catalog price.
-
#deactivate(price_id:) ⇒ Inttegro::Price::CatalogPrice
Deactivate a price for new active catalog flows.
-
#initialize(http) ⇒ Prices
constructor
A new instance of Prices.
-
#lookup(price_id:) ⇒ Inttegro::Price::CatalogPrice
Retrieve one catalog price.
-
#page(payload = {}) ⇒ Inttegro::Price::Page
Retrieve a page of catalog prices.
-
#update(payload) ⇒ Inttegro::Price::CatalogPrice
Update mutable price metadata.
Constructor Details
#initialize(http) ⇒ Prices
Returns a new instance of Prices.
11 12 13 |
# File 'lib/inttegro/resources/prices.rb', line 11 def initialize(http) @http = T.let(http, Inttegro::HTTPClient) end |
Instance Method Details
#activate(price_id:) ⇒ Inttegro::Price::CatalogPrice
Reactivate an inactive price.
51 52 53 |
# File 'lib/inttegro/resources/prices.rb', line 51 def activate(price_id:) @http.post_resource("/prices/activate", Inttegro::Price::CatalogPrice, :price, { price_id: price_id }) end |
#archive(price_id:) ⇒ Inttegro::Price::CatalogPrice
Archive a price and mark it inactive.
67 68 69 |
# File 'lib/inttegro/resources/prices.rb', line 67 def archive(price_id:) @http.post_resource("/prices/archive", Inttegro::Price::CatalogPrice, :price, { price_id: price_id }) end |
#create(payload) ⇒ Inttegro::Price::CatalogPrice
Create a catalog price.
19 20 21 |
# File 'lib/inttegro/resources/prices.rb', line 19 def create(payload) @http.post_resource("/prices/create", Inttegro::Price::CatalogPrice, :price, payload) end |
#deactivate(price_id:) ⇒ Inttegro::Price::CatalogPrice
Deactivate a price for new active catalog flows.
59 60 61 |
# File 'lib/inttegro/resources/prices.rb', line 59 def deactivate(price_id:) @http.post_resource("/prices/deactivate", Inttegro::Price::CatalogPrice, :price, { price_id: price_id }) end |
#lookup(price_id:) ⇒ Inttegro::Price::CatalogPrice
Retrieve one catalog price.
27 28 29 |
# File 'lib/inttegro/resources/prices.rb', line 27 def lookup(price_id:) @http.post_resource("/prices/lookup", Inttegro::Price::CatalogPrice, :price, { price_id: price_id }) end |
#page(payload = {}) ⇒ Inttegro::Price::Page
Retrieve a page of catalog prices.
35 36 37 |
# File 'lib/inttegro/resources/prices.rb', line 35 def page(payload = {}) @http.post_resource("/prices/page", Inttegro::Price::Page, :page, payload || {}) end |
#update(payload) ⇒ Inttegro::Price::CatalogPrice
Update mutable price metadata.
43 44 45 |
# File 'lib/inttegro/resources/prices.rb', line 43 def update(payload) @http.post_resource("/prices/update", Inttegro::Price::CatalogPrice, :price, payload) end |