Class: Inttegro::Resources::Products
- Inherits:
-
Object
- Object
- Inttegro::Resources::Products
- Defined in:
- lib/inttegro/resources/products.rb
Instance Method Summary collapse
- #add_price(payload) ⇒ Object
- #archive(product_id:) ⇒ Object
- #create(payload) ⇒ Object
-
#initialize(http) ⇒ Products
constructor
A new instance of Products.
- #lookup(product_id:) ⇒ Object
- #page(payload = {}) ⇒ Object
- #publish(product_id:) ⇒ Object
- #set_default_unit_price(payload) ⇒ Object
- #unpublish(product_id:) ⇒ Object
- #update(payload) ⇒ Object
Constructor Details
#initialize(http) ⇒ Products
Returns a new instance of Products.
7 8 9 |
# File 'lib/inttegro/resources/products.rb', line 7 def initialize(http) @http = T.let(http, Inttegro::HTTPClient) end |
Instance Method Details
#add_price(payload) ⇒ Object
15 16 17 |
# File 'lib/inttegro/resources/products.rb', line 15 def add_price(payload) @http.post_resource("/products/add_price", Inttegro::CatalogPrice, :price, payload) end |
#archive(product_id:) ⇒ Object
39 40 41 |
# File 'lib/inttegro/resources/products.rb', line 39 def archive(product_id:) @http.post_resource("/products/archive", Inttegro::Product, :product, { product_id: product_id }) end |
#create(payload) ⇒ Object
11 12 13 |
# File 'lib/inttegro/resources/products.rb', line 11 def create(payload) @http.post_resource("/products/create", Inttegro::Product, :product, payload) end |
#lookup(product_id:) ⇒ Object
23 24 25 |
# File 'lib/inttegro/resources/products.rb', line 23 def lookup(product_id:) @http.post_resource("/products/lookup", Inttegro::Product, :product, { product_id: product_id }) end |
#page(payload = {}) ⇒ Object
43 44 45 |
# File 'lib/inttegro/resources/products.rb', line 43 def page(payload = {}) @http.post_resource("/products/page", Inttegro::ProductPage, :page, payload || {}) end |
#publish(product_id:) ⇒ Object
31 32 33 |
# File 'lib/inttegro/resources/products.rb', line 31 def publish(product_id:) @http.post_resource("/products/publish", Inttegro::Product, :product, { product_id: product_id }) end |
#set_default_unit_price(payload) ⇒ Object
19 20 21 |
# File 'lib/inttegro/resources/products.rb', line 19 def set_default_unit_price(payload) @http.post_resource("/products/set_default_unit_price", Inttegro::Product, :product, payload) end |
#unpublish(product_id:) ⇒ Object
35 36 37 |
# File 'lib/inttegro/resources/products.rb', line 35 def unpublish(product_id:) @http.post_resource("/products/unpublish", Inttegro::Product, :product, { product_id: product_id }) end |
#update(payload) ⇒ Object
27 28 29 |
# File 'lib/inttegro/resources/products.rb', line 27 def update(payload) @http.post_resource("/products/update", Inttegro::UpdatedProduct, :product, payload) end |