Class: Peddler::APIs::SupplySources20200701

Inherits:
Peddler::API show all
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

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

Note:

This operation can make a static sandbox call.

Archive a supply source, making it inactive. Cannot be undone.

Parameters:

  • supply_source_id (String)

    The unique identifier of a supply source.

Returns:



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

Note:

This operation can make a static sandbox call.

Create a new supply source.

Parameters:

  • payload (Hash)

    A request to create a supply source.

Returns:



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

Note:

This operation can make a static sandbox call.

Retrieve a supply source.

Parameters:

  • supply_source_id (String)

    The unique identifier of a supply source.

Returns:



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

Note:

This operation can make a static sandbox call.

The path to retrieve paginated supply sources.

Parameters:

  • next_page_token (String) (defaults to: nil)

    The pagination token to retrieve a specific page of results.

  • page_size (Number) (defaults to: 10)

    The number of supply sources to return per paginated request.

Returns:



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

Note:

This operation can make a static sandbox call.

Update the configuration and capabilities of a supply source.

Parameters:

  • supply_source_id (String)

    The unique identitier of a supply source.

  • payload (Hash) (defaults to: nil)

Returns:



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

Note:

This operation can make a static sandbox call.

Update the status of a supply source.

Parameters:

  • supply_source_id (String)

    The unique identifier of a supply source.

  • payload (Hash) (defaults to: nil)

Returns:



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