Class: AmadeusDiscover::Namespaces::Suppliers::Products::Collection

Inherits:
AmadeusDiscover::Namespace
  • Object
show all
Defined in:
lib/amadeus_discover/namespaces/suppliers/products.rb

Overview

Namespace for actions on a supplier’s products collection.

Instance Method Summary collapse

Instance Method Details

#create(product_data) ⇒ Object

Create a new product



16
17
18
19
# File 'lib/amadeus_discover/namespaces/suppliers/products.rb', line 16

def create(product_data)
  # WARN: Can not use path here because URLs do not follow REST conventions.
  connection.post("/api/supplier/#{client.supplier_id}/product", product_data).body
end

#listObject

Returns the list of products for supplier.



11
12
13
# File 'lib/amadeus_discover/namespaces/suppliers/products.rb', line 11

def list
  connection.get(path).body
end