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

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) ⇒ 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:



74
75
76
77
78
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 74

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

  delete(path)
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:



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

def create_supply_source(payload)
  path = "/supplySources/2020-07-01/supplySources"
  body = payload

  post(path, body:)
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:



50
51
52
53
54
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 50

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

  get(path)
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:



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

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

  get(path, params:)
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:



62
63
64
65
66
67
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 62

def update_supply_source(supply_source_id, payload: 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) ⇒ 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:



86
87
88
89
90
91
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 86

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

  put(path, body:)
end