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, #parser

Instance Method Summary collapse

Methods inherited from Peddler::API

#endpoint_uri, #http, #initialize, #meter, #retriable, #sandbox, #sandbox?, #use, #via

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#archive_supply_source(supply_source_id, rate_limit: nil) ⇒ 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.

  • rate_limit (Float) (defaults to: nil)

    Requests per second

Returns:



79
80
81
82
83
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 79

def archive_supply_source(supply_source_id, rate_limit: nil)
  path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"

  delete(path)
end

#create_supply_source(payload, rate_limit: nil) ⇒ 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.

  • rate_limit (Float) (defaults to: nil)

    Requests per second

Returns:



40
41
42
43
44
45
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 40

def create_supply_source(payload, rate_limit: nil)
  path = "/supplySources/2020-07-01/supplySources"
  body = payload

  post(path, body:)
end

#get_supply_source(supply_source_id, rate_limit: nil) ⇒ 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.

  • rate_limit (Float) (defaults to: nil)

    Requests per second

Returns:



53
54
55
56
57
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 53

def get_supply_source(supply_source_id, rate_limit: nil)
  path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"

  get(path)
end

#get_supply_sources(next_page_token: nil, page_size: 10, rate_limit: nil) ⇒ 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.

  • rate_limit (Float) (defaults to: nil)

    Requests per second

Returns:



24
25
26
27
28
29
30
31
32
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 24

def get_supply_sources(next_page_token: nil, page_size: 10, rate_limit: nil)
  path = "/supplySources/2020-07-01/supplySources"
  params = {
    "nextPageToken" => next_page_token,
    "pageSize" => page_size,
  }.compact

  get(path, params:)
end

#update_supply_source(supply_source_id, payload: nil, rate_limit: 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)
  • rate_limit (Float) (defaults to: nil)

    Requests per second

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, rate_limit: nil)
  path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"
  body = payload

  put(path, body:)
end

#update_supply_source_status(supply_source_id, payload: nil, rate_limit: 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)
  • rate_limit (Float) (defaults to: nil)

    Requests per second

Returns:



92
93
94
95
96
97
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 92

def update_supply_source_status(supply_source_id, payload: nil, rate_limit: nil)
  path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}/status"
  body = payload

  put(path, body:)
end