Class: Peddler::APIs::Reports20210630
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::APIs::Reports20210630
- Includes:
- Helpers::Reports20210630
- Defined in:
- lib/peddler/apis/reports_2021_06_30.rb,
lib/peddler/apis/reports_2021_06_30/error.rb,
lib/peddler/apis/reports_2021_06_30/report.rb,
lib/peddler/apis/reports_2021_06_30/error_list.rb,
lib/peddler/apis/reports_2021_06_30/report_list.rb,
lib/peddler/apis/reports_2021_06_30/report_document.rb,
lib/peddler/apis/reports_2021_06_30/report_schedule.rb,
lib/peddler/apis/reports_2021_06_30/get_reports_response.rb,
lib/peddler/apis/reports_2021_06_30/report_schedule_list.rb,
lib/peddler/apis/reports_2021_06_30/create_report_response.rb,
lib/peddler/apis/reports_2021_06_30/create_report_specification.rb,
lib/peddler/apis/reports_2021_06_30/create_report_schedule_response.rb,
lib/peddler/apis/reports_2021_06_30/create_report_schedule_specification.rb,
sig/peddler/apis/reports_2021_06_30.rbs
Overview
Selling Partner API for Reports
The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses.
Defined Under Namespace
Classes: CreateReportResponse, CreateReportScheduleResponse, CreateReportScheduleSpecification, CreateReportSpecification, Error, ErrorList, GetReportsResponse, Report, ReportDocument, ReportList, ReportSchedule, ReportScheduleList
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
-
#cancel_report(report_id, rate_limit: 0.0222) ⇒ Peddler::Response
Cancels the report that you specify.
-
#cancel_report_schedule(report_schedule_id, rate_limit: 0.0222) ⇒ Peddler::Response
Cancels the report schedule that you specify.
-
#create_report(body, rate_limit: 0.0167) ⇒ Peddler::Response
Creates a report.
-
#create_report_schedule(body, rate_limit: 0.0222) ⇒ Peddler::Response
Creates a report schedule.
-
#get_report(report_id, rate_limit: 2.0) ⇒ Peddler::Response
Returns report details (including the
reportDocumentId, if available) for the report that you specify. -
#get_report_document(report_document_id, enable_content_encoding_url_header: nil, rate_limit: 0.0167) ⇒ Peddler::Response
Returns the information required for retrieving a report document's contents.
-
#get_report_schedule(report_schedule_id, rate_limit: 0.0222) ⇒ Peddler::Response
Returns report schedule details for the report schedule that you specify.
-
#get_report_schedules(report_types, rate_limit: 0.0222) ⇒ Peddler::Response
Returns report schedule details that match the filters that you specify.
-
#get_reports(report_types: nil, processing_statuses: nil, marketplace_ids: nil, page_size: 10, created_since: nil, created_until: nil, next_token: nil, rate_limit: 0.0222) ⇒ Peddler::Response
Returns report details for the reports that match the filters that you specify.
Methods included from Helpers::Reports20210630
#download_report_document, #download_report_document_from_url
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
#cancel_report(report_id, rate_limit: 0.0222) ⇒ Peddler::Response
This operation can make a static sandbox call.
Cancels the report that you specify. Only reports with processingStatus=IN_QUEUE can be cancelled. Cancelled
reports are returned in subsequent calls to the getReport and getReports operations.
75 76 77 78 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 75 def cancel_report(report_id, rate_limit: 0.0222) path = "/reports/2021-06-30/reports/#{percent_encode(report_id)}" delete(path, rate_limit:) end |
#cancel_report_schedule(report_schedule_id, rate_limit: 0.0222) ⇒ Peddler::Response
This operation can make a static sandbox call.
Cancels the report schedule that you specify.
129 130 131 132 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 129 def cancel_report_schedule(report_schedule_id, rate_limit: 0.0222) path = "/reports/2021-06-30/schedules/#{percent_encode(report_schedule_id)}" delete(path, rate_limit:) end |
#create_report(body, rate_limit: 0.0167) ⇒ Peddler::Response
This operation can make a static sandbox call.
Creates a report.
61 62 63 64 65 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 61 def create_report(body, rate_limit: 0.0167) path = "/reports/2021-06-30/reports" parser = -> { CreateReportResponse } post(path, body:, rate_limit:, parser:) end |
#create_report_schedule(body, rate_limit: 0.0222) ⇒ Peddler::Response
This operation can make a static sandbox call.
Creates a report schedule. If a report schedule with the same report type and marketplace IDs already exists, it will be cancelled and replaced with this one.
116 117 118 119 120 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 116 def create_report_schedule(body, rate_limit: 0.0222) path = "/reports/2021-06-30/schedules" parser = -> { CreateReportScheduleResponse } post(path, body:, rate_limit:, parser:) end |
#get_report(report_id, rate_limit: 2.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns report details (including the reportDocumentId, if available) for the report that you specify.
87 88 89 90 91 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 87 def get_report(report_id, rate_limit: 2.0) path = "/reports/2021-06-30/reports/#{percent_encode(report_id)}" parser = -> { Report } get(path, rate_limit:, parser:) end |
#get_report_document(report_document_id, enable_content_encoding_url_header: nil, rate_limit: 0.0167) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns the information required for retrieving a report document's contents.
156 157 158 159 160 161 162 163 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 156 def get_report_document(report_document_id, enable_content_encoding_url_header: nil, rate_limit: 0.0167) path = "/reports/2021-06-30/documents/#{percent_encode(report_document_id)}" params = { "enableContentEncodingUrlHeader" => enable_content_encoding_url_header, }.compact parser = -> { ReportDocument } get(path, params:, rate_limit:, parser:) end |
#get_report_schedule(report_schedule_id, rate_limit: 0.0222) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns report schedule details for the report schedule that you specify.
141 142 143 144 145 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 141 def get_report_schedule(report_schedule_id, rate_limit: 0.0222) path = "/reports/2021-06-30/schedules/#{percent_encode(report_schedule_id)}" parser = -> { ReportSchedule } get(path, rate_limit:, parser:) end |
#get_report_schedules(report_types, rate_limit: 0.0222) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns report schedule details that match the filters that you specify.
100 101 102 103 104 105 106 107 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 100 def get_report_schedules(report_types, rate_limit: 0.0222) path = "/reports/2021-06-30/schedules" params = { "reportTypes" => stringify_array(report_types), }.compact parser = -> { ReportScheduleList } get(path, params:, rate_limit:, parser:) end |
#get_reports(report_types: nil, processing_statuses: nil, marketplace_ids: nil, page_size: 10, created_since: nil, created_until: nil, next_token: nil, rate_limit: 0.0222) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns report details for the reports that match the filters that you specify.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 39 def get_reports(report_types: nil, processing_statuses: nil, marketplace_ids: nil, page_size: 10, created_since: nil, created_until: nil, next_token: nil, rate_limit: 0.0222) path = "/reports/2021-06-30/reports" params = { "reportTypes" => stringify_array(report_types), "processingStatuses" => stringify_array(processing_statuses), "marketplaceIds" => stringify_array(marketplace_ids), "pageSize" => page_size, "createdSince" => created_since, "createdUntil" => created_until, "nextToken" => next_token, }.compact parser = -> { GetReportsResponse } get(path, params:, rate_limit:, parser:) end |