UNPKG

@scaleleap/selling-partner-api-sdk

Version:

📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API

655 lines • 51.4 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Selling Partner API for Reports * Effective **June 27, 2024**, the Selling Partner API for Reports v2020-09-04 will no longer be available and all calls to it will fail. Integrations that rely on the Reports API must migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * * The version of the OpenAPI document: 2020-09-04 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ReportsApi = exports.ReportsApiFactory = exports.ReportsApiFp = exports.ReportsApiAxiosParamCreator = exports.ReportDocumentEncryptionDetailsStandardEnum = exports.ReportDocumentCompressionAlgorithmEnum = exports.ReportProcessingStatusEnum = exports.CreateReportScheduleSpecificationPeriodEnum = void 0; const axios_1 = __importDefault(require("axios")); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("./common"); // @ts-ignore const base_1 = require("./base"); /** * @export * @enum {string} */ var CreateReportScheduleSpecificationPeriodEnum; (function (CreateReportScheduleSpecificationPeriodEnum) { CreateReportScheduleSpecificationPeriodEnum["Pt5M"] = "PT5M"; CreateReportScheduleSpecificationPeriodEnum["Pt15M"] = "PT15M"; CreateReportScheduleSpecificationPeriodEnum["Pt30M"] = "PT30M"; CreateReportScheduleSpecificationPeriodEnum["Pt1H"] = "PT1H"; CreateReportScheduleSpecificationPeriodEnum["Pt2H"] = "PT2H"; CreateReportScheduleSpecificationPeriodEnum["Pt4H"] = "PT4H"; CreateReportScheduleSpecificationPeriodEnum["Pt8H"] = "PT8H"; CreateReportScheduleSpecificationPeriodEnum["Pt12H"] = "PT12H"; CreateReportScheduleSpecificationPeriodEnum["P1D"] = "P1D"; CreateReportScheduleSpecificationPeriodEnum["P2D"] = "P2D"; CreateReportScheduleSpecificationPeriodEnum["P3D"] = "P3D"; CreateReportScheduleSpecificationPeriodEnum["Pt84H"] = "PT84H"; CreateReportScheduleSpecificationPeriodEnum["P7D"] = "P7D"; CreateReportScheduleSpecificationPeriodEnum["P14D"] = "P14D"; CreateReportScheduleSpecificationPeriodEnum["P15D"] = "P15D"; CreateReportScheduleSpecificationPeriodEnum["P18D"] = "P18D"; CreateReportScheduleSpecificationPeriodEnum["P30D"] = "P30D"; CreateReportScheduleSpecificationPeriodEnum["P1M"] = "P1M"; })(CreateReportScheduleSpecificationPeriodEnum || (exports.CreateReportScheduleSpecificationPeriodEnum = CreateReportScheduleSpecificationPeriodEnum = {})); /** * @export * @enum {string} */ var ReportProcessingStatusEnum; (function (ReportProcessingStatusEnum) { ReportProcessingStatusEnum["Cancelled"] = "CANCELLED"; ReportProcessingStatusEnum["Done"] = "DONE"; ReportProcessingStatusEnum["Fatal"] = "FATAL"; ReportProcessingStatusEnum["InProgress"] = "IN_PROGRESS"; ReportProcessingStatusEnum["InQueue"] = "IN_QUEUE"; })(ReportProcessingStatusEnum || (exports.ReportProcessingStatusEnum = ReportProcessingStatusEnum = {})); /** * @export * @enum {string} */ var ReportDocumentCompressionAlgorithmEnum; (function (ReportDocumentCompressionAlgorithmEnum) { ReportDocumentCompressionAlgorithmEnum["Gzip"] = "GZIP"; })(ReportDocumentCompressionAlgorithmEnum || (exports.ReportDocumentCompressionAlgorithmEnum = ReportDocumentCompressionAlgorithmEnum = {})); /** * @export * @enum {string} */ var ReportDocumentEncryptionDetailsStandardEnum; (function (ReportDocumentEncryptionDetailsStandardEnum) { ReportDocumentEncryptionDetailsStandardEnum["Aes"] = "AES"; })(ReportDocumentEncryptionDetailsStandardEnum || (exports.ReportDocumentEncryptionDetailsStandardEnum = ReportDocumentEncryptionDetailsStandardEnum = {})); /** * ReportsApi - axios parameter creator * @export */ const ReportsApiAxiosParamCreator = function (configuration) { return { /** * Effective **June 27, 2023**, the `cancelReport` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportId The identifier for the report. This identifier is unique only in combination with a seller ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ cancelReport: async (reportId, options = {}) => { // verify required parameter 'reportId' is not null or undefined (0, common_1.assertParamExists)('cancelReport', 'reportId', reportId); const localVarPath = `/reports/2020-09-04/reports/{reportId}` .replace(`{${"reportId"}}`, encodeURIComponent(String(reportId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Effective **June 27, 2023**, the `cancelReportSchedule` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportScheduleId The identifier for the report schedule. This identifier is unique only in combination with a seller ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ cancelReportSchedule: async (reportScheduleId, options = {}) => { // verify required parameter 'reportScheduleId' is not null or undefined (0, common_1.assertParamExists)('cancelReportSchedule', 'reportScheduleId', reportScheduleId); const localVarPath = `/reports/2020-09-04/schedules/{reportScheduleId}` .replace(`{${"reportScheduleId"}}`, encodeURIComponent(String(reportScheduleId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Effective **June 27, 2023**, the `createReport` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {CreateReportSpecification} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ createReport: async (body, options = {}) => { // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('createReport', 'body', body); const localVarPath = `/reports/2020-09-04/reports`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Effective **June 27, 2023**, the `createReportSchedule` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {CreateReportScheduleSpecification} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ createReportSchedule: async (body, options = {}) => { // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('createReportSchedule', 'body', body); const localVarPath = `/reports/2020-09-04/schedules`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Effective **June 27, 2023**, the `getReport` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportId The identifier for the report. This identifier is unique only in combination with a seller ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReport: async (reportId, options = {}) => { // verify required parameter 'reportId' is not null or undefined (0, common_1.assertParamExists)('getReport', 'reportId', reportId); const localVarPath = `/reports/2020-09-04/reports/{reportId}` .replace(`{${"reportId"}}`, encodeURIComponent(String(reportId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Effective **June 27, 2023**, the `getReportDocument` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportDocumentId The identifier for the report document. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReportDocument: async (reportDocumentId, options = {}) => { // verify required parameter 'reportDocumentId' is not null or undefined (0, common_1.assertParamExists)('getReportDocument', 'reportDocumentId', reportDocumentId); const localVarPath = `/reports/2020-09-04/documents/{reportDocumentId}` .replace(`{${"reportDocumentId"}}`, encodeURIComponent(String(reportDocumentId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Effective **June 27, 2023**, the `getReportSchedule` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportScheduleId The identifier for the report schedule. This identifier is unique only in combination with a seller ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReportSchedule: async (reportScheduleId, options = {}) => { // verify required parameter 'reportScheduleId' is not null or undefined (0, common_1.assertParamExists)('getReportSchedule', 'reportScheduleId', reportScheduleId); const localVarPath = `/reports/2020-09-04/schedules/{reportScheduleId}` .replace(`{${"reportScheduleId"}}`, encodeURIComponent(String(reportScheduleId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Effective **June 27, 2023**, the `getReportSchedules` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {Array<string>} reportTypes A list of report types used to filter report schedules. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReportSchedules: async (reportTypes, options = {}) => { // verify required parameter 'reportTypes' is not null or undefined (0, common_1.assertParamExists)('getReportSchedules', 'reportTypes', reportTypes); const localVarPath = `/reports/2020-09-04/schedules`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (reportTypes) { localVarQueryParameter['reportTypes'] = reportTypes.join(base_1.COLLECTION_FORMATS.csv); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Effective **June 27, 2023**, the `getReports` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {Array<string>} [reportTypes] 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. * @param {Array<'CANCELLED' | 'DONE' | 'FATAL' | 'IN_PROGRESS' | 'IN_QUEUE'>} [processingStatuses] A list of processing statuses used to filter reports. * @param {Array<string>} [marketplaceIds] A list of marketplace identifiers used to filter reports. The reports returned will match at least one of the marketplaces that you specify. * @param {number} [pageSize] The maximum number of reports to return in a single call. * @param {string} [createdSince] 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. * @param {string} [createdUntil] The latest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is now. * @param {string} [nextToken] 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. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReports: async (reportTypes, processingStatuses, marketplaceIds, pageSize, createdSince, createdUntil, nextToken, options = {}) => { const localVarPath = `/reports/2020-09-04/reports`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (reportTypes) { localVarQueryParameter['reportTypes'] = reportTypes.join(base_1.COLLECTION_FORMATS.csv); } if (processingStatuses) { localVarQueryParameter['processingStatuses'] = processingStatuses.join(base_1.COLLECTION_FORMATS.csv); } if (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (createdSince !== undefined) { localVarQueryParameter['createdSince'] = (createdSince instanceof Date) ? createdSince.toISOString() : createdSince; } if (createdUntil !== undefined) { localVarQueryParameter['createdUntil'] = (createdUntil instanceof Date) ? createdUntil.toISOString() : createdUntil; } if (nextToken !== undefined) { localVarQueryParameter['nextToken'] = nextToken; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.ReportsApiAxiosParamCreator = ReportsApiAxiosParamCreator; /** * ReportsApi - functional programming interface * @export */ const ReportsApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.ReportsApiAxiosParamCreator)(configuration); return { /** * Effective **June 27, 2023**, the `cancelReport` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportId The identifier for the report. This identifier is unique only in combination with a seller ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async cancelReport(reportId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.cancelReport(reportId, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * Effective **June 27, 2023**, the `cancelReportSchedule` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportScheduleId The identifier for the report schedule. This identifier is unique only in combination with a seller ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async cancelReportSchedule(reportScheduleId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.cancelReportSchedule(reportScheduleId, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * Effective **June 27, 2023**, the `createReport` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {CreateReportSpecification} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createReport(body, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.createReport(body, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * Effective **June 27, 2023**, the `createReportSchedule` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {CreateReportScheduleSpecification} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createReportSchedule(body, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.createReportSchedule(body, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * Effective **June 27, 2023**, the `getReport` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportId The identifier for the report. This identifier is unique only in combination with a seller ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getReport(reportId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getReport(reportId, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * Effective **June 27, 2023**, the `getReportDocument` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportDocumentId The identifier for the report document. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getReportDocument(reportDocumentId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getReportDocument(reportDocumentId, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * Effective **June 27, 2023**, the `getReportSchedule` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportScheduleId The identifier for the report schedule. This identifier is unique only in combination with a seller ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getReportSchedule(reportScheduleId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getReportSchedule(reportScheduleId, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * Effective **June 27, 2023**, the `getReportSchedules` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {Array<string>} reportTypes A list of report types used to filter report schedules. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getReportSchedules(reportTypes, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getReportSchedules(reportTypes, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * Effective **June 27, 2023**, the `getReports` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {Array<string>} [reportTypes] 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. * @param {Array<'CANCELLED' | 'DONE' | 'FATAL' | 'IN_PROGRESS' | 'IN_QUEUE'>} [processingStatuses] A list of processing statuses used to filter reports. * @param {Array<string>} [marketplaceIds] A list of marketplace identifiers used to filter reports. The reports returned will match at least one of the marketplaces that you specify. * @param {number} [pageSize] The maximum number of reports to return in a single call. * @param {string} [createdSince] 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. * @param {string} [createdUntil] The latest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is now. * @param {string} [nextToken] 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. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getReports(reportTypes, processingStatuses, marketplaceIds, pageSize, createdSince, createdUntil, nextToken, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getReports(reportTypes, processingStatuses, marketplaceIds, pageSize, createdSince, createdUntil, nextToken, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, }; }; exports.ReportsApiFp = ReportsApiFp; /** * ReportsApi - factory interface * @export */ const ReportsApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.ReportsApiFp)(configuration); return { /** * Effective **June 27, 2023**, the `cancelReport` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportId The identifier for the report. This identifier is unique only in combination with a seller ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ cancelReport(reportId, options) { return localVarFp.cancelReport(reportId, options).then((request) => request(axios, basePath)); }, /** * Effective **June 27, 2023**, the `cancelReportSchedule` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportScheduleId The identifier for the report schedule. This identifier is unique only in combination with a seller ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ cancelReportSchedule(reportScheduleId, options) { return localVarFp.cancelReportSchedule(reportScheduleId, options).then((request) => request(axios, basePath)); }, /** * Effective **June 27, 2023**, the `createReport` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {CreateReportSpecification} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ createReport(body, options) { return localVarFp.createReport(body, options).then((request) => request(axios, basePath)); }, /** * Effective **June 27, 2023**, the `createReportSchedule` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {CreateReportScheduleSpecification} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ createReportSchedule(body, options) { return localVarFp.createReportSchedule(body, options).then((request) => request(axios, basePath)); }, /** * Effective **June 27, 2023**, the `getReport` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportId The identifier for the report. This identifier is unique only in combination with a seller ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReport(reportId, options) { return localVarFp.getReport(reportId, options).then((request) => request(axios, basePath)); }, /** * Effective **June 27, 2023**, the `getReportDocument` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportDocumentId The identifier for the report document. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReportDocument(reportDocumentId, options) { return localVarFp.getReportDocument(reportDocumentId, options).then((request) => request(axios, basePath)); }, /** * Effective **June 27, 2023**, the `getReportSchedule` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {string} reportScheduleId The identifier for the report schedule. This identifier is unique only in combination with a seller ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReportSchedule(reportScheduleId, options) { return localVarFp.getReportSchedule(reportScheduleId, options).then((request) => request(axios, basePath)); }, /** * Effective **June 27, 2023**, the `getReportSchedules` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {Array<string>} reportTypes A list of report types used to filter report schedules. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReportSchedules(reportTypes, options) { return localVarFp.getReportSchedules(reportTypes, options).then((request) => request(axios, basePath)); }, /** * Effective **June 27, 2023**, the `getReports` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {Array<string>} [reportTypes] 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. * @param {Array<'CANCELLED' | 'DONE' | 'FATAL' | 'IN_PROGRESS' | 'IN_QUEUE'>} [processingStatuses] A list of processing statuses used to filter reports. * @param {Array<string>} [marketplaceIds] A list of marketplace identifiers used to filter reports. The reports returned will match at least one of the marketplaces that you specify. * @param {number} [pageSize] The maximum number of reports to return in a single call. * @param {string} [createdSince] 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. * @param {string} [createdUntil] The latest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is now. * @param {string} [nextToken] 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. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReports(reportTypes, processingStatuses, marketplaceIds, pageSize, createdSince, createdUntil, nextToken, options) { return localVarFp.getReports(reportTypes, processingStatuses, marketplaceIds, pageSize, createdSince, createdUntil, nextToken, options).then((request) => request(axios, basePath)); }, }; }; exports.ReportsApiFactory = ReportsApiFactory; /** * ReportsApi - object-oriented interface * @export * @class ReportsApi * @extends {BaseAPI} */ class ReportsApi extends base_1.BaseAPI { /** * Effective **June 27, 2023**, the `cancelReport` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {ReportsApiCancelReportRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReportsApi */ cancelReport(requestParameters, options) { return (0, exports.ReportsApiFp)(this.configuration).cancelReport(requestParameters.reportId, options).then((request) => request(this.axios, this.basePath)); } /** * Effective **June 27, 2023**, the `cancelReportSchedule` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {ReportsApiCancelReportScheduleRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReportsApi */ cancelReportSchedule(requestParameters, options) { return (0, exports.ReportsApiFp)(this.configuration).cancelReportSchedule(requestParameters.reportScheduleId, options).then((request) => request(this.axios, this.basePath)); } /** * Effective **June 27, 2023**, the `createReport` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {ReportsApiCreateReportRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReportsApi */ createReport(requestParameters, options) { return (0, exports.ReportsApiFp)(this.configuration).createReport(requestParameters.body, options).then((request) => request(this.axios, this.basePath)); } /** * Effective **June 27, 2023**, the `createReportSchedule` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {ReportsApiCreateReportScheduleRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReportsApi */ createReportSchedule(requestParameters, options) { return (0, exports.ReportsApiFp)(this.configuration).createReportSchedule(requestParameters.body, options).then((request) => request(this.axios, this.basePath)); } /** * Effective **June 27, 2023**, the `getReport` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {ReportsApiGetReportRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReportsApi */ getReport(requestParameters, options) { return (0, exports.ReportsApiFp)(this.configuration).getReport(requestParameters.reportId, options).then((request) => request(this.axios, this.basePath)); } /** * Effective **June 27, 2023**, the `getReportDocument` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {ReportsApiGetReportDocumentRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReportsApi */ getReportDocument(requestParameters, options) { return (0, exports.ReportsApiFp)(this.configuration).getReportDocument(requestParameters.reportDocumentId, options).then((request) => request(this.axios, this.basePath)); } /** * Effective **June 27, 2023**, the `getReportSchedule` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {ReportsApiGetReportScheduleRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReportsApi */ getReportSchedule(requestParameters, options) { return (0, exports.ReportsApiFp)(this.configuration).getReportSchedule(requestParameters.reportScheduleId, options).then((request) => request(this.axios, this.basePath)); } /** * Effective **June 27, 2023**, the `getReportSchedules` operation will no longer be available in the Selling Partner API for Reports v2020-09-04 and all calls to it will fail. Integrations that rely on this operation should migrate to [Reports v2021-06-30](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference) to avoid service disruption. * @param {ReportsApiGetReportSchedulesRequest} requestParameters Request parameters. * @param {*} [options]