Class: Peddler::APIs::SupplySources20200701
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::APIs::SupplySources20200701
- Defined in:
- lib/peddler/apis/supply_sources_2020_07_01.rb
Overview
Selling Partner API for Supply Sources
Manage configurations and capabilities of seller supply sources.
Instance Attribute Summary
Attributes inherited from Peddler::API
#access_token, #endpoint, #retries
Instance Method Summary collapse
-
#archive_supply_source(supply_source_id) ⇒ Peddler::Response
Archive a supply source, making it inactive.
-
#create_supply_source(payload) ⇒ Peddler::Response
Create a new supply source.
-
#get_supply_source(supply_source_id) ⇒ Peddler::Response
Retrieve a supply source.
-
#get_supply_sources(next_page_token: nil, page_size: 10) ⇒ Peddler::Response
The path to retrieve paginated supply sources.
-
#update_supply_source(supply_source_id, payload: nil) ⇒ Peddler::Response
Update the configuration and capabilities of a supply source.
-
#update_supply_source_status(supply_source_id, payload: nil) ⇒ Peddler::Response
Update the status of a supply source.
Methods inherited from Peddler::API
#endpoint_uri, #http, #initialize, #meter, #retriable, #sandbox, #sandbox?, #typed, #typed?, #use, #via
Constructor Details
This class inherits a constructor from Peddler::API
Instance Method Details
#archive_supply_source(supply_source_id) ⇒ Peddler::Response
This operation can make a static sandbox call.
Archive a supply source, making it inactive. Cannot be undone.
78 79 80 81 82 |
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 78 def archive_supply_source(supply_source_id) path = "/supplySources/2020-07-01/supplySources/#{percent_encode(supply_source_id)}" parser = Peddler::Types::SupplySources20200701::ErrorList if typed? delete(path, parser:) end |
#create_supply_source(payload) ⇒ Peddler::Response
This operation can make a static sandbox call.
Create a new supply source.
42 43 44 45 46 47 |
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 42 def create_supply_source(payload) path = "/supplySources/2020-07-01/supplySources" body = payload parser = Peddler::Types::SupplySources20200701::CreateSupplySourceResponse if typed? post(path, body:, parser:) end |
#get_supply_source(supply_source_id) ⇒ Peddler::Response
This operation can make a static sandbox call.
Retrieve a supply source.
54 55 56 57 58 |
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 54 def get_supply_source(supply_source_id) path = "/supplySources/2020-07-01/supplySources/#{percent_encode(supply_source_id)}" parser = Peddler::Types::SupplySources20200701::SupplySource if typed? get(path, parser:) end |
#get_supply_sources(next_page_token: nil, page_size: 10) ⇒ Peddler::Response
This operation can make a static sandbox call.
The path to retrieve paginated supply sources.
27 28 29 30 31 32 33 34 35 |
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 27 def get_supply_sources(next_page_token: nil, page_size: 10) path = "/supplySources/2020-07-01/supplySources" params = { "nextPageToken" => next_page_token, "pageSize" => page_size, }.compact parser = Peddler::Types::SupplySources20200701::GetSupplySourcesResponse if typed? get(path, params:, parser:) end |
#update_supply_source(supply_source_id, payload: nil) ⇒ Peddler::Response
This operation can make a static sandbox call.
Update the configuration and capabilities of a supply source.
66 67 68 69 70 71 |
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 66 def update_supply_source(supply_source_id, payload: nil) path = "/supplySources/2020-07-01/supplySources/#{percent_encode(supply_source_id)}" body = payload parser = Peddler::Types::SupplySources20200701::ErrorList if typed? put(path, body:, parser:) end |
#update_supply_source_status(supply_source_id, payload: nil) ⇒ Peddler::Response
This operation can make a static sandbox call.
Update the status of a supply source.
90 91 92 93 94 95 |
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 90 def update_supply_source_status(supply_source_id, payload: nil) path = "/supplySources/2020-07-01/supplySources/#{percent_encode(supply_source_id)}/status" body = payload parser = Peddler::Types::SupplySources20200701::ErrorList if typed? put(path, body:, parser:) end |