@sp-api-sdk/supply-sources-api-2020-07-01 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +97 -0
- package/dist/cjs/index.js +18 -0
- package/dist/cjs/src/api-model/api/supply-sources-api.js +419 -0
- package/dist/cjs/src/api-model/api.js +30 -0
- package/dist/cjs/src/api-model/base.js +66 -0
- package/dist/cjs/src/api-model/common.js +145 -0
- package/dist/cjs/src/api-model/configuration.js +91 -0
- package/dist/cjs/src/api-model/index.js +32 -0
- package/dist/cjs/src/api-model/models/address-with-contact.js +15 -0
- package/dist/cjs/src/api-model/models/address.js +15 -0
- package/dist/cjs/src/api-model/models/contact-details-primary.js +15 -0
- package/dist/cjs/src/api-model/models/contact-details.js +15 -0
- package/dist/cjs/src/api-model/models/create-supply-source-request.js +15 -0
- package/dist/cjs/src/api-model/models/create-supply-source-response.js +15 -0
- package/dist/cjs/src/api-model/models/curbside-pickup-configuration.js +15 -0
- package/dist/cjs/src/api-model/models/delivery-channel.js +15 -0
- package/dist/cjs/src/api-model/models/duration.js +15 -0
- package/dist/cjs/src/api-model/models/error-list.js +15 -0
- package/dist/cjs/src/api-model/models/get-supply-sources-response.js +15 -0
- package/dist/cjs/src/api-model/models/in-store-pickup-configuration.js +15 -0
- package/dist/cjs/src/api-model/models/index.js +53 -0
- package/dist/cjs/src/api-model/models/model-error.js +15 -0
- package/dist/cjs/src/api-model/models/operating-hour.js +15 -0
- package/dist/cjs/src/api-model/models/operating-hours-by-day.js +15 -0
- package/dist/cjs/src/api-model/models/operational-configuration.js +15 -0
- package/dist/cjs/src/api-model/models/outbound-capability.js +15 -0
- package/dist/cjs/src/api-model/models/parking-configuration.js +15 -0
- package/dist/cjs/src/api-model/models/parking-cost-type.js +25 -0
- package/dist/cjs/src/api-model/models/parking-spot-identification-type.js +25 -0
- package/dist/cjs/src/api-model/models/parking-with-address-configuration-all-of.js +15 -0
- package/dist/cjs/src/api-model/models/parking-with-address-configuration.js +15 -0
- package/dist/cjs/src/api-model/models/pickup-channel.js +15 -0
- package/dist/cjs/src/api-model/models/return-location.js +15 -0
- package/dist/cjs/src/api-model/models/services-capability.js +15 -0
- package/dist/cjs/src/api-model/models/supply-source-capabilities.js +15 -0
- package/dist/cjs/src/api-model/models/supply-source-configuration.js +15 -0
- package/dist/cjs/src/api-model/models/supply-source-list-inner.js +15 -0
- package/dist/cjs/src/api-model/models/supply-source-status-read-only.js +26 -0
- package/dist/cjs/src/api-model/models/supply-source-status.js +25 -0
- package/dist/cjs/src/api-model/models/supply-source.js +15 -0
- package/dist/cjs/src/api-model/models/throughput-cap.js +15 -0
- package/dist/cjs/src/api-model/models/throughput-config.js +15 -0
- package/dist/cjs/src/api-model/models/throughput-unit.js +24 -0
- package/dist/cjs/src/api-model/models/time-unit.js +26 -0
- package/dist/cjs/src/api-model/models/update-supply-source-request.js +15 -0
- package/dist/cjs/src/api-model/models/update-supply-source-status-request.js +15 -0
- package/dist/cjs/src/client.js +13 -0
- package/dist/es/index.js +2 -0
- package/dist/es/src/api-model/api/supply-sources-api.js +409 -0
- package/dist/es/src/api-model/api.js +14 -0
- package/dist/es/src/api-model/base.js +58 -0
- package/dist/es/src/api-model/common.js +133 -0
- package/dist/es/src/api-model/configuration.js +87 -0
- package/dist/es/src/api-model/index.js +16 -0
- package/dist/es/src/api-model/models/address-with-contact.js +14 -0
- package/dist/es/src/api-model/models/address.js +14 -0
- package/dist/es/src/api-model/models/contact-details-primary.js +14 -0
- package/dist/es/src/api-model/models/contact-details.js +14 -0
- package/dist/es/src/api-model/models/create-supply-source-request.js +14 -0
- package/dist/es/src/api-model/models/create-supply-source-response.js +14 -0
- package/dist/es/src/api-model/models/curbside-pickup-configuration.js +14 -0
- package/dist/es/src/api-model/models/delivery-channel.js +14 -0
- package/dist/es/src/api-model/models/duration.js +14 -0
- package/dist/es/src/api-model/models/error-list.js +14 -0
- package/dist/es/src/api-model/models/get-supply-sources-response.js +14 -0
- package/dist/es/src/api-model/models/in-store-pickup-configuration.js +14 -0
- package/dist/es/src/api-model/models/index.js +37 -0
- package/dist/es/src/api-model/models/model-error.js +14 -0
- package/dist/es/src/api-model/models/operating-hour.js +14 -0
- package/dist/es/src/api-model/models/operating-hours-by-day.js +14 -0
- package/dist/es/src/api-model/models/operational-configuration.js +14 -0
- package/dist/es/src/api-model/models/outbound-capability.js +14 -0
- package/dist/es/src/api-model/models/parking-configuration.js +14 -0
- package/dist/es/src/api-model/models/parking-cost-type.js +22 -0
- package/dist/es/src/api-model/models/parking-spot-identification-type.js +22 -0
- package/dist/es/src/api-model/models/parking-with-address-configuration-all-of.js +14 -0
- package/dist/es/src/api-model/models/parking-with-address-configuration.js +14 -0
- package/dist/es/src/api-model/models/pickup-channel.js +14 -0
- package/dist/es/src/api-model/models/return-location.js +14 -0
- package/dist/es/src/api-model/models/services-capability.js +14 -0
- package/dist/es/src/api-model/models/supply-source-capabilities.js +14 -0
- package/dist/es/src/api-model/models/supply-source-configuration.js +14 -0
- package/dist/es/src/api-model/models/supply-source-list-inner.js +14 -0
- package/dist/es/src/api-model/models/supply-source-status-read-only.js +23 -0
- package/dist/es/src/api-model/models/supply-source-status.js +22 -0
- package/dist/es/src/api-model/models/supply-source.js +14 -0
- package/dist/es/src/api-model/models/throughput-cap.js +14 -0
- package/dist/es/src/api-model/models/throughput-config.js +14 -0
- package/dist/es/src/api-model/models/throughput-unit.js +21 -0
- package/dist/es/src/api-model/models/time-unit.js +23 -0
- package/dist/es/src/api-model/models/update-supply-source-request.js +14 -0
- package/dist/es/src/api-model/models/update-supply-source-status-request.js +14 -0
- package/dist/es/src/client.js +9 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/src/api-model/api/supply-sources-api.d.ts +323 -0
- package/dist/types/src/api-model/api.d.ts +12 -0
- package/dist/types/src/api-model/base.d.ts +54 -0
- package/dist/types/src/api-model/common.d.ts +66 -0
- package/dist/types/src/api-model/configuration.d.ts +83 -0
- package/dist/types/src/api-model/index.d.ts +14 -0
- package/dist/types/src/api-model/models/address-with-contact.d.ts +32 -0
- package/dist/types/src/api-model/models/address.d.ts +84 -0
- package/dist/types/src/api-model/models/contact-details-primary.d.ts +30 -0
- package/dist/types/src/api-model/models/contact-details.d.ts +25 -0
- package/dist/types/src/api-model/models/create-supply-source-request.d.ts +37 -0
- package/dist/types/src/api-model/models/create-supply-source-response.d.ts +30 -0
- package/dist/types/src/api-model/models/curbside-pickup-configuration.d.ts +38 -0
- package/dist/types/src/api-model/models/delivery-channel.d.ts +31 -0
- package/dist/types/src/api-model/models/duration.d.ts +31 -0
- package/dist/types/src/api-model/models/error-list.d.ts +24 -0
- package/dist/types/src/api-model/models/get-supply-sources-response.d.ts +31 -0
- package/dist/types/src/api-model/models/in-store-pickup-configuration.d.ts +31 -0
- package/dist/types/src/api-model/models/index.d.ts +37 -0
- package/dist/types/src/api-model/models/model-error.d.ts +36 -0
- package/dist/types/src/api-model/models/operating-hour.d.ts +30 -0
- package/dist/types/src/api-model/models/operating-hours-by-day.d.ts +61 -0
- package/dist/types/src/api-model/models/operational-configuration.d.ts +46 -0
- package/dist/types/src/api-model/models/outbound-capability.d.ts +52 -0
- package/dist/types/src/api-model/models/parking-configuration.d.ts +38 -0
- package/dist/types/src/api-model/models/parking-cost-type.d.ts +21 -0
- package/dist/types/src/api-model/models/parking-spot-identification-type.d.ts +21 -0
- package/dist/types/src/api-model/models/parking-with-address-configuration-all-of.d.ts +25 -0
- package/dist/types/src/api-model/models/parking-with-address-configuration.d.ts +19 -0
- package/dist/types/src/api-model/models/pickup-channel.d.ts +52 -0
- package/dist/types/src/api-model/models/return-location.d.ts +31 -0
- package/dist/types/src/api-model/models/services-capability.d.ts +31 -0
- package/dist/types/src/api-model/models/supply-source-capabilities.d.ts +32 -0
- package/dist/types/src/api-model/models/supply-source-configuration.d.ts +31 -0
- package/dist/types/src/api-model/models/supply-source-list-inner.d.ts +43 -0
- package/dist/types/src/api-model/models/supply-source-status-read-only.d.ts +22 -0
- package/dist/types/src/api-model/models/supply-source-status.d.ts +21 -0
- package/dist/types/src/api-model/models/supply-source.d.ts +76 -0
- package/dist/types/src/api-model/models/throughput-cap.d.ts +31 -0
- package/dist/types/src/api-model/models/throughput-config.d.ts +32 -0
- package/dist/types/src/api-model/models/throughput-unit.d.ts +20 -0
- package/dist/types/src/api-model/models/time-unit.d.ts +22 -0
- package/dist/types/src/api-model/models/update-supply-source-request.d.ts +38 -0
- package/dist/types/src/api-model/models/update-supply-source-status-request.d.ts +25 -0
- package/dist/types/src/client.d.ts +6 -0
- package/package.json +44 -0
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Selling Partner API for Supply Sources
|
|
5
|
+
* Manage configurations and capabilities of seller supply sources.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 2020-07-01
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
import globalAxios from 'axios';
|
|
15
|
+
// Some imports not used depending on template conditions
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
import { DUMMY_BASE_URL, assertParamExists, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
import { BASE_PATH, BaseAPI } from '../base';
|
|
20
|
+
/**
|
|
21
|
+
* SupplySourcesApi - axios parameter creator
|
|
22
|
+
* @export
|
|
23
|
+
*/
|
|
24
|
+
export const SupplySourcesApiAxiosParamCreator = function (configuration) {
|
|
25
|
+
return {
|
|
26
|
+
/**
|
|
27
|
+
* Archive a supply source, making it inactive. Cannot be undone.
|
|
28
|
+
* @param {string} supplySourceId The unique identifier of a supply source.
|
|
29
|
+
* @param {*} [options] Override http request option.
|
|
30
|
+
* @throws {RequiredError}
|
|
31
|
+
*/
|
|
32
|
+
archiveSupplySource: async (supplySourceId, options = {}) => {
|
|
33
|
+
// verify required parameter 'supplySourceId' is not null or undefined
|
|
34
|
+
assertParamExists('archiveSupplySource', 'supplySourceId', supplySourceId);
|
|
35
|
+
const localVarPath = `/supplySources/2020-07-01/supplySources/{supplySourceId}`
|
|
36
|
+
.replace(`{${"supplySourceId"}}`, encodeURIComponent(String(supplySourceId)));
|
|
37
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
38
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
39
|
+
let baseOptions;
|
|
40
|
+
if (configuration) {
|
|
41
|
+
baseOptions = configuration.baseOptions;
|
|
42
|
+
}
|
|
43
|
+
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
|
|
44
|
+
const localVarHeaderParameter = {};
|
|
45
|
+
const localVarQueryParameter = {};
|
|
46
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
47
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
48
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
49
|
+
return {
|
|
50
|
+
url: toPathString(localVarUrlObj),
|
|
51
|
+
options: localVarRequestOptions,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Create a new supply source.
|
|
56
|
+
* @param {CreateSupplySourceRequest} payload A request to create a supply source.
|
|
57
|
+
* @param {*} [options] Override http request option.
|
|
58
|
+
* @throws {RequiredError}
|
|
59
|
+
*/
|
|
60
|
+
createSupplySource: async (payload, options = {}) => {
|
|
61
|
+
// verify required parameter 'payload' is not null or undefined
|
|
62
|
+
assertParamExists('createSupplySource', 'payload', payload);
|
|
63
|
+
const localVarPath = `/supplySources/2020-07-01/supplySources`;
|
|
64
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
65
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
66
|
+
let baseOptions;
|
|
67
|
+
if (configuration) {
|
|
68
|
+
baseOptions = configuration.baseOptions;
|
|
69
|
+
}
|
|
70
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
|
|
71
|
+
const localVarHeaderParameter = {};
|
|
72
|
+
const localVarQueryParameter = {};
|
|
73
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
74
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
75
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
76
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
77
|
+
localVarRequestOptions.data = serializeDataIfNeeded(payload, localVarRequestOptions, configuration);
|
|
78
|
+
return {
|
|
79
|
+
url: toPathString(localVarUrlObj),
|
|
80
|
+
options: localVarRequestOptions,
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
/**
|
|
84
|
+
* Retrieve a supply source.
|
|
85
|
+
* @param {string} supplySourceId The unique identifier of a supply source.
|
|
86
|
+
* @param {*} [options] Override http request option.
|
|
87
|
+
* @throws {RequiredError}
|
|
88
|
+
*/
|
|
89
|
+
getSupplySource: async (supplySourceId, options = {}) => {
|
|
90
|
+
// verify required parameter 'supplySourceId' is not null or undefined
|
|
91
|
+
assertParamExists('getSupplySource', 'supplySourceId', supplySourceId);
|
|
92
|
+
const localVarPath = `/supplySources/2020-07-01/supplySources/{supplySourceId}`
|
|
93
|
+
.replace(`{${"supplySourceId"}}`, encodeURIComponent(String(supplySourceId)));
|
|
94
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
95
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
96
|
+
let baseOptions;
|
|
97
|
+
if (configuration) {
|
|
98
|
+
baseOptions = configuration.baseOptions;
|
|
99
|
+
}
|
|
100
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
101
|
+
const localVarHeaderParameter = {};
|
|
102
|
+
const localVarQueryParameter = {};
|
|
103
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
104
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
105
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
106
|
+
return {
|
|
107
|
+
url: toPathString(localVarUrlObj),
|
|
108
|
+
options: localVarRequestOptions,
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* The path to retrieve paginated supply sources.
|
|
113
|
+
* @param {string} [nextPageToken] The pagination token to retrieve a specific page of results.
|
|
114
|
+
* @param {number} [pageSize] The number of supply sources to return per paginated request.
|
|
115
|
+
* @param {*} [options] Override http request option.
|
|
116
|
+
* @throws {RequiredError}
|
|
117
|
+
*/
|
|
118
|
+
getSupplySources: async (nextPageToken, pageSize, options = {}) => {
|
|
119
|
+
const localVarPath = `/supplySources/2020-07-01/supplySources`;
|
|
120
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
121
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
122
|
+
let baseOptions;
|
|
123
|
+
if (configuration) {
|
|
124
|
+
baseOptions = configuration.baseOptions;
|
|
125
|
+
}
|
|
126
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
127
|
+
const localVarHeaderParameter = {};
|
|
128
|
+
const localVarQueryParameter = {};
|
|
129
|
+
if (nextPageToken !== undefined) {
|
|
130
|
+
localVarQueryParameter['nextPageToken'] = nextPageToken;
|
|
131
|
+
}
|
|
132
|
+
if (pageSize !== undefined) {
|
|
133
|
+
localVarQueryParameter['pageSize'] = pageSize;
|
|
134
|
+
}
|
|
135
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
136
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
137
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
138
|
+
return {
|
|
139
|
+
url: toPathString(localVarUrlObj),
|
|
140
|
+
options: localVarRequestOptions,
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
/**
|
|
144
|
+
* Update the configuration and capabilities of a supply source.
|
|
145
|
+
* @param {string} supplySourceId The unique identitier of a supply source.
|
|
146
|
+
* @param {UpdateSupplySourceRequest} [payload]
|
|
147
|
+
* @param {*} [options] Override http request option.
|
|
148
|
+
* @throws {RequiredError}
|
|
149
|
+
*/
|
|
150
|
+
updateSupplySource: async (supplySourceId, payload, options = {}) => {
|
|
151
|
+
// verify required parameter 'supplySourceId' is not null or undefined
|
|
152
|
+
assertParamExists('updateSupplySource', 'supplySourceId', supplySourceId);
|
|
153
|
+
const localVarPath = `/supplySources/2020-07-01/supplySources/{supplySourceId}`
|
|
154
|
+
.replace(`{${"supplySourceId"}}`, encodeURIComponent(String(supplySourceId)));
|
|
155
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
156
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
157
|
+
let baseOptions;
|
|
158
|
+
if (configuration) {
|
|
159
|
+
baseOptions = configuration.baseOptions;
|
|
160
|
+
}
|
|
161
|
+
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options };
|
|
162
|
+
const localVarHeaderParameter = {};
|
|
163
|
+
const localVarQueryParameter = {};
|
|
164
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
165
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
166
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
167
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
168
|
+
localVarRequestOptions.data = serializeDataIfNeeded(payload, localVarRequestOptions, configuration);
|
|
169
|
+
return {
|
|
170
|
+
url: toPathString(localVarUrlObj),
|
|
171
|
+
options: localVarRequestOptions,
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
/**
|
|
175
|
+
* Update the status of a supply source.
|
|
176
|
+
* @param {string} supplySourceId The unique identifier of a supply source.
|
|
177
|
+
* @param {UpdateSupplySourceStatusRequest} [payload]
|
|
178
|
+
* @param {*} [options] Override http request option.
|
|
179
|
+
* @throws {RequiredError}
|
|
180
|
+
*/
|
|
181
|
+
updateSupplySourceStatus: async (supplySourceId, payload, options = {}) => {
|
|
182
|
+
// verify required parameter 'supplySourceId' is not null or undefined
|
|
183
|
+
assertParamExists('updateSupplySourceStatus', 'supplySourceId', supplySourceId);
|
|
184
|
+
const localVarPath = `/supplySources/2020-07-01/supplySources/{supplySourceId}/status`
|
|
185
|
+
.replace(`{${"supplySourceId"}}`, encodeURIComponent(String(supplySourceId)));
|
|
186
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
187
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
188
|
+
let baseOptions;
|
|
189
|
+
if (configuration) {
|
|
190
|
+
baseOptions = configuration.baseOptions;
|
|
191
|
+
}
|
|
192
|
+
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options };
|
|
193
|
+
const localVarHeaderParameter = {};
|
|
194
|
+
const localVarQueryParameter = {};
|
|
195
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
196
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
197
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
198
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
199
|
+
localVarRequestOptions.data = serializeDataIfNeeded(payload, localVarRequestOptions, configuration);
|
|
200
|
+
return {
|
|
201
|
+
url: toPathString(localVarUrlObj),
|
|
202
|
+
options: localVarRequestOptions,
|
|
203
|
+
};
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* SupplySourcesApi - functional programming interface
|
|
209
|
+
* @export
|
|
210
|
+
*/
|
|
211
|
+
export const SupplySourcesApiFp = function (configuration) {
|
|
212
|
+
const localVarAxiosParamCreator = SupplySourcesApiAxiosParamCreator(configuration);
|
|
213
|
+
return {
|
|
214
|
+
/**
|
|
215
|
+
* Archive a supply source, making it inactive. Cannot be undone.
|
|
216
|
+
* @param {string} supplySourceId The unique identifier of a supply source.
|
|
217
|
+
* @param {*} [options] Override http request option.
|
|
218
|
+
* @throws {RequiredError}
|
|
219
|
+
*/
|
|
220
|
+
async archiveSupplySource(supplySourceId, options) {
|
|
221
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.archiveSupplySource(supplySourceId, options);
|
|
222
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
223
|
+
},
|
|
224
|
+
/**
|
|
225
|
+
* Create a new supply source.
|
|
226
|
+
* @param {CreateSupplySourceRequest} payload A request to create a supply source.
|
|
227
|
+
* @param {*} [options] Override http request option.
|
|
228
|
+
* @throws {RequiredError}
|
|
229
|
+
*/
|
|
230
|
+
async createSupplySource(payload, options) {
|
|
231
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createSupplySource(payload, options);
|
|
232
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
233
|
+
},
|
|
234
|
+
/**
|
|
235
|
+
* Retrieve a supply source.
|
|
236
|
+
* @param {string} supplySourceId The unique identifier of a supply source.
|
|
237
|
+
* @param {*} [options] Override http request option.
|
|
238
|
+
* @throws {RequiredError}
|
|
239
|
+
*/
|
|
240
|
+
async getSupplySource(supplySourceId, options) {
|
|
241
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getSupplySource(supplySourceId, options);
|
|
242
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
243
|
+
},
|
|
244
|
+
/**
|
|
245
|
+
* The path to retrieve paginated supply sources.
|
|
246
|
+
* @param {string} [nextPageToken] The pagination token to retrieve a specific page of results.
|
|
247
|
+
* @param {number} [pageSize] The number of supply sources to return per paginated request.
|
|
248
|
+
* @param {*} [options] Override http request option.
|
|
249
|
+
* @throws {RequiredError}
|
|
250
|
+
*/
|
|
251
|
+
async getSupplySources(nextPageToken, pageSize, options) {
|
|
252
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getSupplySources(nextPageToken, pageSize, options);
|
|
253
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
254
|
+
},
|
|
255
|
+
/**
|
|
256
|
+
* Update the configuration and capabilities of a supply source.
|
|
257
|
+
* @param {string} supplySourceId The unique identitier of a supply source.
|
|
258
|
+
* @param {UpdateSupplySourceRequest} [payload]
|
|
259
|
+
* @param {*} [options] Override http request option.
|
|
260
|
+
* @throws {RequiredError}
|
|
261
|
+
*/
|
|
262
|
+
async updateSupplySource(supplySourceId, payload, options) {
|
|
263
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.updateSupplySource(supplySourceId, payload, options);
|
|
264
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
265
|
+
},
|
|
266
|
+
/**
|
|
267
|
+
* Update the status of a supply source.
|
|
268
|
+
* @param {string} supplySourceId The unique identifier of a supply source.
|
|
269
|
+
* @param {UpdateSupplySourceStatusRequest} [payload]
|
|
270
|
+
* @param {*} [options] Override http request option.
|
|
271
|
+
* @throws {RequiredError}
|
|
272
|
+
*/
|
|
273
|
+
async updateSupplySourceStatus(supplySourceId, payload, options) {
|
|
274
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.updateSupplySourceStatus(supplySourceId, payload, options);
|
|
275
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* SupplySourcesApi - factory interface
|
|
281
|
+
* @export
|
|
282
|
+
*/
|
|
283
|
+
export const SupplySourcesApiFactory = function (configuration, basePath, axios) {
|
|
284
|
+
const localVarFp = SupplySourcesApiFp(configuration);
|
|
285
|
+
return {
|
|
286
|
+
/**
|
|
287
|
+
* Archive a supply source, making it inactive. Cannot be undone.
|
|
288
|
+
* @param {SupplySourcesApiArchiveSupplySourceRequest} requestParameters Request parameters.
|
|
289
|
+
* @param {*} [options] Override http request option.
|
|
290
|
+
* @throws {RequiredError}
|
|
291
|
+
*/
|
|
292
|
+
archiveSupplySource(requestParameters, options) {
|
|
293
|
+
return localVarFp.archiveSupplySource(requestParameters.supplySourceId, options).then((request) => request(axios, basePath));
|
|
294
|
+
},
|
|
295
|
+
/**
|
|
296
|
+
* Create a new supply source.
|
|
297
|
+
* @param {SupplySourcesApiCreateSupplySourceRequest} requestParameters Request parameters.
|
|
298
|
+
* @param {*} [options] Override http request option.
|
|
299
|
+
* @throws {RequiredError}
|
|
300
|
+
*/
|
|
301
|
+
createSupplySource(requestParameters, options) {
|
|
302
|
+
return localVarFp.createSupplySource(requestParameters.payload, options).then((request) => request(axios, basePath));
|
|
303
|
+
},
|
|
304
|
+
/**
|
|
305
|
+
* Retrieve a supply source.
|
|
306
|
+
* @param {SupplySourcesApiGetSupplySourceRequest} requestParameters Request parameters.
|
|
307
|
+
* @param {*} [options] Override http request option.
|
|
308
|
+
* @throws {RequiredError}
|
|
309
|
+
*/
|
|
310
|
+
getSupplySource(requestParameters, options) {
|
|
311
|
+
return localVarFp.getSupplySource(requestParameters.supplySourceId, options).then((request) => request(axios, basePath));
|
|
312
|
+
},
|
|
313
|
+
/**
|
|
314
|
+
* The path to retrieve paginated supply sources.
|
|
315
|
+
* @param {SupplySourcesApiGetSupplySourcesRequest} requestParameters Request parameters.
|
|
316
|
+
* @param {*} [options] Override http request option.
|
|
317
|
+
* @throws {RequiredError}
|
|
318
|
+
*/
|
|
319
|
+
getSupplySources(requestParameters = {}, options) {
|
|
320
|
+
return localVarFp.getSupplySources(requestParameters.nextPageToken, requestParameters.pageSize, options).then((request) => request(axios, basePath));
|
|
321
|
+
},
|
|
322
|
+
/**
|
|
323
|
+
* Update the configuration and capabilities of a supply source.
|
|
324
|
+
* @param {SupplySourcesApiUpdateSupplySourceRequest} requestParameters Request parameters.
|
|
325
|
+
* @param {*} [options] Override http request option.
|
|
326
|
+
* @throws {RequiredError}
|
|
327
|
+
*/
|
|
328
|
+
updateSupplySource(requestParameters, options) {
|
|
329
|
+
return localVarFp.updateSupplySource(requestParameters.supplySourceId, requestParameters.payload, options).then((request) => request(axios, basePath));
|
|
330
|
+
},
|
|
331
|
+
/**
|
|
332
|
+
* Update the status of a supply source.
|
|
333
|
+
* @param {SupplySourcesApiUpdateSupplySourceStatusRequest} requestParameters Request parameters.
|
|
334
|
+
* @param {*} [options] Override http request option.
|
|
335
|
+
* @throws {RequiredError}
|
|
336
|
+
*/
|
|
337
|
+
updateSupplySourceStatus(requestParameters, options) {
|
|
338
|
+
return localVarFp.updateSupplySourceStatus(requestParameters.supplySourceId, requestParameters.payload, options).then((request) => request(axios, basePath));
|
|
339
|
+
},
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* SupplySourcesApi - object-oriented interface
|
|
344
|
+
* @export
|
|
345
|
+
* @class SupplySourcesApi
|
|
346
|
+
* @extends {BaseAPI}
|
|
347
|
+
*/
|
|
348
|
+
export class SupplySourcesApi extends BaseAPI {
|
|
349
|
+
/**
|
|
350
|
+
* Archive a supply source, making it inactive. Cannot be undone.
|
|
351
|
+
* @param {SupplySourcesApiArchiveSupplySourceRequest} requestParameters Request parameters.
|
|
352
|
+
* @param {*} [options] Override http request option.
|
|
353
|
+
* @throws {RequiredError}
|
|
354
|
+
* @memberof SupplySourcesApi
|
|
355
|
+
*/
|
|
356
|
+
archiveSupplySource(requestParameters, options) {
|
|
357
|
+
return SupplySourcesApiFp(this.configuration).archiveSupplySource(requestParameters.supplySourceId, options).then((request) => request(this.axios, this.basePath));
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Create a new supply source.
|
|
361
|
+
* @param {SupplySourcesApiCreateSupplySourceRequest} requestParameters Request parameters.
|
|
362
|
+
* @param {*} [options] Override http request option.
|
|
363
|
+
* @throws {RequiredError}
|
|
364
|
+
* @memberof SupplySourcesApi
|
|
365
|
+
*/
|
|
366
|
+
createSupplySource(requestParameters, options) {
|
|
367
|
+
return SupplySourcesApiFp(this.configuration).createSupplySource(requestParameters.payload, options).then((request) => request(this.axios, this.basePath));
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Retrieve a supply source.
|
|
371
|
+
* @param {SupplySourcesApiGetSupplySourceRequest} requestParameters Request parameters.
|
|
372
|
+
* @param {*} [options] Override http request option.
|
|
373
|
+
* @throws {RequiredError}
|
|
374
|
+
* @memberof SupplySourcesApi
|
|
375
|
+
*/
|
|
376
|
+
getSupplySource(requestParameters, options) {
|
|
377
|
+
return SupplySourcesApiFp(this.configuration).getSupplySource(requestParameters.supplySourceId, options).then((request) => request(this.axios, this.basePath));
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* The path to retrieve paginated supply sources.
|
|
381
|
+
* @param {SupplySourcesApiGetSupplySourcesRequest} requestParameters Request parameters.
|
|
382
|
+
* @param {*} [options] Override http request option.
|
|
383
|
+
* @throws {RequiredError}
|
|
384
|
+
* @memberof SupplySourcesApi
|
|
385
|
+
*/
|
|
386
|
+
getSupplySources(requestParameters = {}, options) {
|
|
387
|
+
return SupplySourcesApiFp(this.configuration).getSupplySources(requestParameters.nextPageToken, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Update the configuration and capabilities of a supply source.
|
|
391
|
+
* @param {SupplySourcesApiUpdateSupplySourceRequest} requestParameters Request parameters.
|
|
392
|
+
* @param {*} [options] Override http request option.
|
|
393
|
+
* @throws {RequiredError}
|
|
394
|
+
* @memberof SupplySourcesApi
|
|
395
|
+
*/
|
|
396
|
+
updateSupplySource(requestParameters, options) {
|
|
397
|
+
return SupplySourcesApiFp(this.configuration).updateSupplySource(requestParameters.supplySourceId, requestParameters.payload, options).then((request) => request(this.axios, this.basePath));
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Update the status of a supply source.
|
|
401
|
+
* @param {SupplySourcesApiUpdateSupplySourceStatusRequest} requestParameters Request parameters.
|
|
402
|
+
* @param {*} [options] Override http request option.
|
|
403
|
+
* @throws {RequiredError}
|
|
404
|
+
* @memberof SupplySourcesApi
|
|
405
|
+
*/
|
|
406
|
+
updateSupplySourceStatus(requestParameters, options) {
|
|
407
|
+
return SupplySourcesApiFp(this.configuration).updateSupplySourceStatus(requestParameters.supplySourceId, requestParameters.payload, options).then((request) => request(this.axios, this.basePath));
|
|
408
|
+
}
|
|
409
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Selling Partner API for Supply Sources
|
|
5
|
+
* Manage configurations and capabilities of seller supply sources.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 2020-07-01
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
export * from './api/supply-sources-api';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Selling Partner API for Supply Sources
|
|
5
|
+
* Manage configurations and capabilities of seller supply sources.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 2020-07-01
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
import globalAxios from 'axios';
|
|
15
|
+
export const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
*/
|
|
20
|
+
export const COLLECTION_FORMATS = {
|
|
21
|
+
csv: ",",
|
|
22
|
+
ssv: " ",
|
|
23
|
+
tsv: "\t",
|
|
24
|
+
pipes: "|",
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @export
|
|
29
|
+
* @class BaseAPI
|
|
30
|
+
*/
|
|
31
|
+
export class BaseAPI {
|
|
32
|
+
basePath;
|
|
33
|
+
axios;
|
|
34
|
+
configuration;
|
|
35
|
+
constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
|
|
36
|
+
this.basePath = basePath;
|
|
37
|
+
this.axios = axios;
|
|
38
|
+
if (configuration) {
|
|
39
|
+
this.configuration = configuration;
|
|
40
|
+
this.basePath = configuration.basePath || this.basePath;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
;
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @export
|
|
48
|
+
* @class RequiredError
|
|
49
|
+
* @extends {Error}
|
|
50
|
+
*/
|
|
51
|
+
export class RequiredError extends Error {
|
|
52
|
+
field;
|
|
53
|
+
constructor(field, msg) {
|
|
54
|
+
super(msg);
|
|
55
|
+
this.field = field;
|
|
56
|
+
this.name = "RequiredError";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Selling Partner API for Supply Sources
|
|
5
|
+
* Manage configurations and capabilities of seller supply sources.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 2020-07-01
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
import { RequiredError } from "./base";
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
*/
|
|
19
|
+
export const DUMMY_BASE_URL = 'https://example.com';
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @throws {RequiredError}
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
export const assertParamExists = function (functionName, paramName, paramValue) {
|
|
26
|
+
if (paramValue === null || paramValue === undefined) {
|
|
27
|
+
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @export
|
|
33
|
+
*/
|
|
34
|
+
export const setApiKeyToObject = async function (object, keyParamName, configuration) {
|
|
35
|
+
if (configuration && configuration.apiKey) {
|
|
36
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
37
|
+
? await configuration.apiKey(keyParamName)
|
|
38
|
+
: await configuration.apiKey;
|
|
39
|
+
object[keyParamName] = localVarApiKeyValue;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @export
|
|
45
|
+
*/
|
|
46
|
+
export const setBasicAuthToObject = function (object, configuration) {
|
|
47
|
+
if (configuration && (configuration.username || configuration.password)) {
|
|
48
|
+
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @export
|
|
54
|
+
*/
|
|
55
|
+
export const setBearerAuthToObject = async function (object, configuration) {
|
|
56
|
+
if (configuration && configuration.accessToken) {
|
|
57
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
58
|
+
? await configuration.accessToken()
|
|
59
|
+
: await configuration.accessToken;
|
|
60
|
+
object["Authorization"] = "Bearer " + accessToken;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @export
|
|
66
|
+
*/
|
|
67
|
+
export const setOAuthToObject = async function (object, name, scopes, configuration) {
|
|
68
|
+
if (configuration && configuration.accessToken) {
|
|
69
|
+
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
70
|
+
? await configuration.accessToken(name, scopes)
|
|
71
|
+
: await configuration.accessToken;
|
|
72
|
+
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
76
|
+
if (parameter == null)
|
|
77
|
+
return;
|
|
78
|
+
if (typeof parameter === "object") {
|
|
79
|
+
if (Array.isArray(parameter)) {
|
|
80
|
+
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
if (urlSearchParams.has(key)) {
|
|
88
|
+
urlSearchParams.append(key, parameter);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
urlSearchParams.set(key, parameter);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* @export
|
|
98
|
+
*/
|
|
99
|
+
export const setSearchParams = function (url, ...objects) {
|
|
100
|
+
const searchParams = new URLSearchParams(url.search);
|
|
101
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
102
|
+
url.search = searchParams.toString();
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
*
|
|
106
|
+
* @export
|
|
107
|
+
*/
|
|
108
|
+
export const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
109
|
+
const nonString = typeof value !== 'string';
|
|
110
|
+
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
111
|
+
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
112
|
+
: nonString;
|
|
113
|
+
return needsSerialization
|
|
114
|
+
? JSON.stringify(value !== undefined ? value : {})
|
|
115
|
+
: (value || "");
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
*
|
|
119
|
+
* @export
|
|
120
|
+
*/
|
|
121
|
+
export const toPathString = function (url) {
|
|
122
|
+
return url.pathname + url.search + url.hash;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
*
|
|
126
|
+
* @export
|
|
127
|
+
*/
|
|
128
|
+
export const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
129
|
+
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
130
|
+
const axiosRequestArgs = { ...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url };
|
|
131
|
+
return axios.request(axiosRequestArgs);
|
|
132
|
+
};
|
|
133
|
+
};
|