Class: Inttegro::Resources::Prices
- Inherits:
-
Object
- Object
- Inttegro::Resources::Prices
- Defined in:
- lib/inttegro/resources/prices.rb
Instance Method Summary collapse
- #activate(price_id:) ⇒ Object
- #archive(price_id:) ⇒ Object
- #create(payload) ⇒ Object
- #deactivate(price_id:) ⇒ Object
-
#initialize(http) ⇒ Prices
constructor
A new instance of Prices.
- #lookup(price_id:) ⇒ Object
- #page(payload = {}) ⇒ Object
- #update(payload) ⇒ Object
Constructor Details
#initialize(http) ⇒ Prices
Returns a new instance of Prices.
7 8 9 |
# File 'lib/inttegro/resources/prices.rb', line 7 def initialize(http) @http = T.let(http, Inttegro::HTTPClient) end |
Instance Method Details
#activate(price_id:) ⇒ Object
27 28 29 |
# File 'lib/inttegro/resources/prices.rb', line 27 def activate(price_id:) @http.post_resource("/prices/activate", Inttegro::CatalogPrice, :price, { price_id: price_id }) end |
#archive(price_id:) ⇒ Object
35 36 37 |
# File 'lib/inttegro/resources/prices.rb', line 35 def archive(price_id:) @http.post_resource("/prices/archive", Inttegro::CatalogPrice, :price, { price_id: price_id }) end |
#create(payload) ⇒ Object
11 12 13 |
# File 'lib/inttegro/resources/prices.rb', line 11 def create(payload) @http.post_resource("/prices/create", Inttegro::CatalogPrice, :price, payload) end |
#deactivate(price_id:) ⇒ Object
31 32 33 |
# File 'lib/inttegro/resources/prices.rb', line 31 def deactivate(price_id:) @http.post_resource("/prices/deactivate", Inttegro::CatalogPrice, :price, { price_id: price_id }) end |
#lookup(price_id:) ⇒ Object
15 16 17 |
# File 'lib/inttegro/resources/prices.rb', line 15 def lookup(price_id:) @http.post_resource("/prices/lookup", Inttegro::CatalogPrice, :price, { price_id: price_id }) end |
#page(payload = {}) ⇒ Object
19 20 21 |
# File 'lib/inttegro/resources/prices.rb', line 19 def page(payload = {}) @http.post_resource("/prices/page", Inttegro::PricePage, :page, payload || {}) end |
#update(payload) ⇒ Object
23 24 25 |
# File 'lib/inttegro/resources/prices.rb', line 23 def update(payload) @http.post_resource("/prices/update", Inttegro::CatalogPrice, :price, payload) end |