Class: Peddler::APIs::SupplySources20200701

Inherits:
Peddler::API show all
Defined in:
lib/peddler/apis/supply_sources_2020_07_01.rb,
lib/peddler/apis/supply_sources_2020_07_01/error.rb,
lib/peddler/apis/supply_sources_2020_07_01/address.rb,
lib/peddler/apis/supply_sources_2020_07_01/duration.rb,
lib/peddler/apis/supply_sources_2020_07_01/error_list.rb,
lib/peddler/apis/supply_sources_2020_07_01/supply_source.rb,
lib/peddler/apis/supply_sources_2020_07_01/operating_hour.rb,
lib/peddler/apis/supply_sources_2020_07_01/pickup_channel.rb,
lib/peddler/apis/supply_sources_2020_07_01/throughput_cap.rb,
lib/peddler/apis/supply_sources_2020_07_01/contact_details.rb,
lib/peddler/apis/supply_sources_2020_07_01/operating_hours.rb,
lib/peddler/apis/supply_sources_2020_07_01/return_location.rb,
lib/peddler/apis/supply_sources_2020_07_01/delivery_channel.rb,
lib/peddler/apis/supply_sources_2020_07_01/throughput_config.rb,
lib/peddler/apis/supply_sources_2020_07_01/supply_source_list.rb,
lib/peddler/apis/supply_sources_2020_07_01/outbound_capability.rb,
lib/peddler/apis/supply_sources_2020_07_01/services_capability.rb,
lib/peddler/apis/supply_sources_2020_07_01/address_with_contact.rb,
lib/peddler/apis/supply_sources_2020_07_01/parking_configuration.rb,
lib/peddler/apis/supply_sources_2020_07_01/operating_hours_by_day.rb,
lib/peddler/apis/supply_sources_2020_07_01/operational_configuration.rb,
lib/peddler/apis/supply_sources_2020_07_01/supply_source_capabilities.rb,
lib/peddler/apis/supply_sources_2020_07_01/get_supply_sources_response.rb,
lib/peddler/apis/supply_sources_2020_07_01/supply_source_configuration.rb,
lib/peddler/apis/supply_sources_2020_07_01/create_supply_source_request.rb,
lib/peddler/apis/supply_sources_2020_07_01/update_supply_source_request.rb,
lib/peddler/apis/supply_sources_2020_07_01/create_supply_source_response.rb,
lib/peddler/apis/supply_sources_2020_07_01/curbside_pickup_configuration.rb,
lib/peddler/apis/supply_sources_2020_07_01/in_store_pickup_configuration.rb,
lib/peddler/apis/supply_sources_2020_07_01/parking_with_address_configuration.rb,
lib/peddler/apis/supply_sources_2020_07_01/update_supply_source_status_request.rb,
sig/peddler/apis/supply_sources_2020_07_01.rbs

Overview

Selling Partner API for Supply Sources

Manage configurations and capabilities of seller supply sources.

Defined Under Namespace

Classes: Address, AddressWithContact, ContactDetails, CreateSupplySourceRequest, CreateSupplySourceResponse, CurbsidePickupConfiguration, DeliveryChannel, Duration, Error, ErrorList, GetSupplySourcesResponse, InStorePickupConfiguration, OperatingHour, OperatingHours, OperatingHoursByDay, OperationalConfiguration, OutboundCapability, ParkingConfiguration, ParkingWithAddressConfiguration, PickupChannel, ReturnLocation, ServicesCapability, SupplySource, SupplySourceCapabilities, SupplySourceConfiguration, SupplySourceList, ThroughputCap, ThroughputConfig, UpdateSupplySourceRequest, UpdateSupplySourceStatusRequest

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #delete, #endpoint_uri, #get, #http, #initialize, #must_sandbox!, #patch, #percent_encode, #post, #put, #request, #sandbox, #sandbox?, #stringify_array, #timestamp, #user_agent

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.

  • (String)

Returns:



70
71
72
73
74
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 70

def archive_supply_source(supply_source_id)
  path = "/supplySources/2020-07-01/supplySources/#{percent_encode(supply_source_id)}"
  parser = -> { ErrorList }
  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.

  • (Hash[untyped, untyped])

Returns:



34
35
36
37
38
39
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 34

def create_supply_source(payload)
  path = "/supplySources/2020-07-01/supplySources"
  body = payload
  parser = -> { CreateSupplySourceResponse }
  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.

  • (String)

Returns:



46
47
48
49
50
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 46

def get_supply_source(supply_source_id)
  path = "/supplySources/2020-07-01/supplySources/#{percent_encode(supply_source_id)}"
  parser = -> { SupplySource }
  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.

  • next_page_token: (String, nil) (defaults to: nil)
  • page_size: (Numeric, nil) (defaults to: 10)

Returns:



19
20
21
22
23
24
25
26
27
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 19

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 = -> { GetSupplySourcesResponse }
  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)
  • (String)
  • payload: (Hash[untyped, untyped], nil) (defaults to: nil)

Returns:



58
59
60
61
62
63
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 58

def update_supply_source(supply_source_id, payload: nil)
  path = "/supplySources/2020-07-01/supplySources/#{percent_encode(supply_source_id)}"
  body = payload
  parser = -> { ErrorList }
  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)
  • (String)
  • payload: (Hash[untyped, untyped], nil) (defaults to: nil)

Returns:



82
83
84
85
86
87
# File 'lib/peddler/apis/supply_sources_2020_07_01.rb', line 82

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 = -> { ErrorList }
  put(path, body:, parser:)
end