Class: Peddler::APIs::Support20250201

Inherits:
Peddler::API show all
Defined in:
lib/peddler/apis/support_2025_02_01.rb,
lib/peddler/apis/support_2025_02_01/case.rb,
lib/peddler/apis/support_2025_02_01/error.rb,
lib/peddler/apis/support_2025_02_01/contact.rb,
lib/peddler/apis/support_2025_02_01/attachment.rb,
lib/peddler/apis/support_2025_02_01/chat_event.rb,
lib/peddler/apis/support_2025_02_01/error_list.rb,
lib/peddler/apis/support_2025_02_01/appointment.rb,
lib/peddler/apis/support_2025_02_01/date_filter.rb,
lib/peddler/apis/support_2025_02_01/participant.rb,
lib/peddler/apis/support_2025_02_01/case_filters.rb,
lib/peddler/apis/support_2025_02_01/chat_content.rb,
lib/peddler/apis/support_2025_02_01/phone_number.rb,
lib/peddler/apis/support_2025_02_01/email_content.rb,
lib/peddler/apis/support_2025_02_01/phone_content.rb,
lib/peddler/apis/support_2025_02_01/callback_timing.rb,
lib/peddler/apis/support_2025_02_01/list_cases_result.rb,
lib/peddler/apis/support_2025_02_01/list_cases_request.rb,
lib/peddler/apis/support_2025_02_01/list_contacts_result.rb,
sig/peddler/apis/support_2025_02_01.rbs

Overview

The Selling Partner API for Support

The Selling Partner API for Support provides programmatic access to information about Selling Partner support.

Defined Under Namespace

Classes: Appointment, Attachment, CallbackTiming, Case, CaseFilters, ChatContent, ChatEvent, Contact, DateFilter, EmailContent, Error, ErrorList, ListCasesRequest, ListCasesResult, ListContactsResult, Participant, PhoneContent, PhoneNumber

Constant Summary

Constants inherited from Peddler::API

Peddler::API::TRANSIENT_STATUSES

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #base_url, #endpoint, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #delete, #endpoint_uri, #get, #host_header, #http, #initialize, #must_sandbox!, #parse_base_url, #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

#get_case(case_id) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieve a specific support case.

Parameters:

  • case_id (String) —

    The case identifier.

  • (String)

Returns:



29
30
31
32
33
# File 'lib/peddler/apis/support_2025_02_01.rb', line 29

def get_case(case_id)
  path = "/support/2025-02-01/cases/#{percent_encode(case_id)}"
  parser = -> { Case }
  get(path, parser:)
end

#list_cases(body) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieve support cases for a selling partner.

Parameters:

  • body (Hash) —

    The request body for the listCases operation.

  • (Hash[untyped, untyped])

Returns:



18
19
20
21
22
# File 'lib/peddler/apis/support_2025_02_01.rb', line 18

def list_cases(body)
  path = "/support/2025-02-01/cases"
  parser = -> { ListCasesResult }
  post(path, body:, parser:)
end

#list_contacts(case_id, max_results: 10, next_token: nil, sort_order: "DESC") ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieve contacts for a specific support case.

Parameters:

  • case_id (String) —

    The case identifier.

  • max_results (Integer) (defaults to: 10) —

    The maximum number of results to include in the response.

  • next_token (String) (defaults to: nil) —

    A token to retrieve the next page of results. The response includes nextToken when the number of results exceeds the specified maxResults value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until nextToken is null. Note that this operation can return empty pages.

  • sort_order (String) (defaults to: "DESC") —

    Sort the returned contacts by createdDate in either ascending or descending order.

  • (String)
  • max_results: (Integer, nil) (defaults to: 10)
  • next_token: (String, nil) (defaults to: nil)
  • sort_order: (String, nil) (defaults to: "DESC")

Returns:



46
47
48
49
50
51
52
53
54
55
# File 'lib/peddler/apis/support_2025_02_01.rb', line 46

def list_contacts(case_id, max_results: 10, next_token: nil, sort_order: "DESC")
  path = "/support/2025-02-01/cases/#{percent_encode(case_id)}/contacts"
  params = {
    "maxResults" => max_results,
    "nextToken" => next_token,
    "sortOrder" => sort_order,
  }.compact
  parser = -> { ListContactsResult }
  get(path, params:, parser:)
end