<?php
|
/**
|
* This class is autogenerated by the Spapi class generator
|
* Date of generation: 2022-05-26
|
* Specification: https://github.com/amzn/selling-partner-api-models/blob/main/models/reports-api-model/reports_2021-06-30.json
|
* Source MD5 signature: 7c73f3a324cad408ef57b0b24c657e6f
|
*
|
*
|
* 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.
|
*/
|
namespace DoubleBreak\Spapi\Api;
|
use DoubleBreak\Spapi\Client;
|
|
class Reports extends Client {
|
|
/**
|
* Operation getReports
|
*
|
* @param array $queryParams
|
* - *reportTypes* array - A list of report types used to filter reports. When reportTypes is provided, the other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also be provided. Either reportTypes or nextToken is required.
|
* - *processingStatuses* array - A list of processing statuses used to filter reports.
|
* - *marketplaceIds* array - A list of marketplace identifiers used to filter reports. The reports returned will match at least one of the marketplaces that you specify.
|
* - *pageSize* integer - The maximum number of reports to return in a single call.
|
* - *createdSince* string - The earliest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is 90 days ago. Reports are retained for a maximum of 90 days.
|
* - *createdUntil* string - The latest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is now.
|
* - *nextToken* string - A string token returned in the response to your previous request. nextToken is returned when the number of results exceeds the specified pageSize value. To get the next page of results, call the getReports operation and include this token as the only parameter. Specifying nextToken with any other parameters will cause the request to fail.
|
*
|
*/
|
public function getReports($queryParams = [])
|
{
|
return $this->send("/reports/2021-06-30/reports", [
|
'method' => 'GET',
|
'query' => $queryParams,
|
]);
|
}
|
|
public function getReportsAsync($queryParams = [])
|
{
|
return $this->sendAsync("/reports/2021-06-30/reports", [
|
'method' => 'GET',
|
'query' => $queryParams,
|
]);
|
}
|
|
/**
|
* Operation createReport
|
*
|
*/
|
public function createReport($body = [])
|
{
|
return $this->send("/reports/2021-06-30/reports", [
|
'method' => 'POST',
|
'json' => $body
|
]);
|
}
|
|
public function createReportAsync($body = [])
|
{
|
return $this->sendAsync("/reports/2021-06-30/reports", [
|
'method' => 'POST',
|
'json' => $body
|
]);
|
}
|
|
/**
|
* Operation cancelReport
|
*
|
* @param string $reportId The identifier for the report. This identifier is unique only in combination with a seller ID.
|
*
|
*/
|
public function cancelReport($reportId)
|
{
|
return $this->send("/reports/2021-06-30/reports/{$reportId}", [
|
'method' => 'DELETE',
|
]);
|
}
|
|
public function cancelReportAsync($reportId)
|
{
|
return $this->sendAsync("/reports/2021-06-30/reports/{$reportId}", [
|
'method' => 'DELETE',
|
]);
|
}
|
|
/**
|
* Operation getReport
|
*
|
* @param string $reportId The identifier for the report. This identifier is unique only in combination with a seller ID.
|
*
|
*/
|
public function getReport($reportId)
|
{
|
return $this->send("/reports/2021-06-30/reports/{$reportId}", [
|
'method' => 'GET',
|
]);
|
}
|
|
public function getReportAsync($reportId)
|
{
|
return $this->sendAsync("/reports/2021-06-30/reports/{$reportId}", [
|
'method' => 'GET',
|
]);
|
}
|
|
/**
|
* Operation getReportSchedules
|
*
|
* @param array $queryParams
|
* - *reportTypes* array - A list of report types used to filter report schedules.
|
*
|
*/
|
public function getReportSchedules($queryParams = [])
|
{
|
return $this->send("/reports/2021-06-30/schedules", [
|
'method' => 'GET',
|
'query' => $queryParams,
|
]);
|
}
|
|
public function getReportSchedulesAsync($queryParams = [])
|
{
|
return $this->sendAsync("/reports/2021-06-30/schedules", [
|
'method' => 'GET',
|
'query' => $queryParams,
|
]);
|
}
|
|
/**
|
* Operation createReportSchedule
|
*
|
*/
|
public function createReportSchedule($body = [])
|
{
|
return $this->send("/reports/2021-06-30/schedules", [
|
'method' => 'POST',
|
'json' => $body
|
]);
|
}
|
|
public function createReportScheduleAsync($body = [])
|
{
|
return $this->sendAsync("/reports/2021-06-30/schedules", [
|
'method' => 'POST',
|
'json' => $body
|
]);
|
}
|
|
/**
|
* Operation cancelReportSchedule
|
*
|
* @param string $reportScheduleId The identifier for the report schedule. This identifier is unique only in combination with a seller ID.
|
*
|
*/
|
public function cancelReportSchedule($reportScheduleId)
|
{
|
return $this->send("/reports/2021-06-30/schedules/{$reportScheduleId}", [
|
'method' => 'DELETE',
|
]);
|
}
|
|
public function cancelReportScheduleAsync($reportScheduleId)
|
{
|
return $this->sendAsync("/reports/2021-06-30/schedules/{$reportScheduleId}", [
|
'method' => 'DELETE',
|
]);
|
}
|
|
/**
|
* Operation getReportSchedule
|
*
|
* @param string $reportScheduleId The identifier for the report schedule. This identifier is unique only in combination with a seller ID.
|
*
|
*/
|
public function getReportSchedule($reportScheduleId)
|
{
|
return $this->send("/reports/2021-06-30/schedules/{$reportScheduleId}", [
|
'method' => 'GET',
|
]);
|
}
|
|
public function getReportScheduleAsync($reportScheduleId)
|
{
|
return $this->sendAsync("/reports/2021-06-30/schedules/{$reportScheduleId}", [
|
'method' => 'GET',
|
]);
|
}
|
|
/**
|
* Operation getReportDocument
|
*
|
* @param string $reportDocumentId The identifier for the report document.
|
*
|
*/
|
public function getReportDocument($reportDocumentId)
|
{
|
return $this->send("/reports/2021-06-30/documents/{$reportDocumentId}", [
|
'method' => 'GET',
|
]);
|
}
|
|
public function getReportDocumentAsync($reportDocumentId)
|
{
|
return $this->sendAsync("/reports/2021-06-30/documents/{$reportDocumentId}", [
|
'method' => 'GET',
|
]);
|
}
|
}
|