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
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.
Instance Attribute Summary
Attributes inherited from Peddler::API
#access_token, #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, 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
Methods inherited from Peddler::API
#endpoint_uri, #http, #initialize, #meter, #retriable, #sandbox, #sandbox?, #typed, #typed?, #use, #via
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.
81 82 83 84 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 81 def cancel_report(report_id, rate_limit: 0.0222) path = "/reports/2021-06-30/reports/#{percent_encode(report_id)}" meter(rate_limit).delete(path) 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.
135 136 137 138 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 135 def cancel_report_schedule(report_schedule_id, rate_limit: 0.0222) path = "/reports/2021-06-30/schedules/#{percent_encode(report_schedule_id)}" meter(rate_limit).delete(path) end |
#create_report(body, rate_limit: 0.0167) ⇒ Peddler::Response
This operation can make a static sandbox call.
Creates a report.
67 68 69 70 71 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 67 def create_report(body, rate_limit: 0.0167) path = "/reports/2021-06-30/reports" parser = Peddler::Types::Reports20210630::CreateReportResponse if typed? meter(rate_limit).post(path, body:, 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.
122 123 124 125 126 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 122 def create_report_schedule(body, rate_limit: 0.0222) path = "/reports/2021-06-30/schedules" parser = Peddler::Types::Reports20210630::CreateReportScheduleResponse if typed? meter(rate_limit).post(path, body:, 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.
93 94 95 96 97 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 93 def get_report(report_id, rate_limit: 2.0) path = "/reports/2021-06-30/reports/#{percent_encode(report_id)}" parser = Peddler::Types::Reports20210630::Report if typed? meter(rate_limit).get(path, parser:) end |
#get_report_document(report_document_id, 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.
159 160 161 162 163 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 159 def get_report_document(report_document_id, rate_limit: 0.0167) path = "/reports/2021-06-30/documents/#{percent_encode(report_document_id)}" parser = Peddler::Types::Reports20210630::ReportDocument if typed? meter(rate_limit).get(path, 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.
147 148 149 150 151 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 147 def get_report_schedule(report_schedule_id, rate_limit: 0.0222) path = "/reports/2021-06-30/schedules/#{percent_encode(report_schedule_id)}" parser = Peddler::Types::Reports20210630::ReportSchedule if typed? meter(rate_limit).get(path, 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.
106 107 108 109 110 111 112 113 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 106 def get_report_schedules(report_types, rate_limit: 0.0222) path = "/reports/2021-06-30/schedules" params = { "reportTypes" => stringify_array(report_types), }.compact parser = Peddler::Types::Reports20210630::ReportScheduleList if typed? meter(rate_limit).get(path, params:, 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.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/peddler/apis/reports_2021_06_30.rb', line 45 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 = Peddler::Types::Reports20210630::GetReportsResponse if typed? meter(rate_limit).get(path, params:, parser:) end |