@sp-api-sdk/vendor-direct-fulfillment-inventory-api-v1 1.6.16

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.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -0
  3. package/dist/cjs/index.js +6 -0
  4. package/dist/cjs/src/api-model/api/update-inventory-api.js +125 -0
  5. package/dist/cjs/src/api-model/api.js +17 -0
  6. package/dist/cjs/src/api-model/base.js +62 -0
  7. package/dist/cjs/src/api-model/common.js +137 -0
  8. package/dist/cjs/src/api-model/configuration.js +42 -0
  9. package/dist/cjs/src/api-model/index.js +19 -0
  10. package/dist/cjs/src/api-model/models/index.js +11 -0
  11. package/dist/cjs/src/api-model/models/inventory-update.js +15 -0
  12. package/dist/cjs/src/api-model/models/item-details.js +15 -0
  13. package/dist/cjs/src/api-model/models/item-quantity.js +15 -0
  14. package/dist/cjs/src/api-model/models/model-error.js +15 -0
  15. package/dist/cjs/src/api-model/models/party-identification.js +15 -0
  16. package/dist/cjs/src/api-model/models/submit-inventory-update-request.js +15 -0
  17. package/dist/cjs/src/api-model/models/submit-inventory-update-response.js +15 -0
  18. package/dist/cjs/src/api-model/models/transaction-reference.js +15 -0
  19. package/dist/cjs/src/client.js +35 -0
  20. package/dist/cjs/src/error.js +10 -0
  21. package/dist/es/index.js +3 -0
  22. package/dist/es/src/api-model/api/update-inventory-api.js +117 -0
  23. package/dist/es/src/api-model/api.js +14 -0
  24. package/dist/es/src/api-model/base.js +56 -0
  25. package/dist/es/src/api-model/common.js +125 -0
  26. package/dist/es/src/api-model/configuration.js +38 -0
  27. package/dist/es/src/api-model/index.js +16 -0
  28. package/dist/es/src/api-model/models/index.js +8 -0
  29. package/dist/es/src/api-model/models/inventory-update.js +14 -0
  30. package/dist/es/src/api-model/models/item-details.js +14 -0
  31. package/dist/es/src/api-model/models/item-quantity.js +14 -0
  32. package/dist/es/src/api-model/models/model-error.js +14 -0
  33. package/dist/es/src/api-model/models/party-identification.js +14 -0
  34. package/dist/es/src/api-model/models/submit-inventory-update-request.js +14 -0
  35. package/dist/es/src/api-model/models/submit-inventory-update-response.js +14 -0
  36. package/dist/es/src/api-model/models/transaction-reference.js +14 -0
  37. package/dist/es/src/client.js +31 -0
  38. package/dist/es/src/error.js +6 -0
  39. package/dist/types/index.d.ts +3 -0
  40. package/dist/types/src/api-model/api/update-inventory-api.d.ts +93 -0
  41. package/dist/types/src/api-model/api.d.ts +12 -0
  42. package/dist/types/src/api-model/base.d.ts +55 -0
  43. package/dist/types/src/api-model/common.d.ts +65 -0
  44. package/dist/types/src/api-model/configuration.d.ts +83 -0
  45. package/dist/types/src/api-model/index.d.ts +14 -0
  46. package/dist/types/src/api-model/models/index.d.ts +8 -0
  47. package/dist/types/src/api-model/models/inventory-update.d.ts +38 -0
  48. package/dist/types/src/api-model/models/item-details.d.ts +43 -0
  49. package/dist/types/src/api-model/models/item-quantity.d.ts +30 -0
  50. package/dist/types/src/api-model/models/model-error.d.ts +36 -0
  51. package/dist/types/src/api-model/models/party-identification.d.ts +24 -0
  52. package/dist/types/src/api-model/models/submit-inventory-update-request.d.ts +25 -0
  53. package/dist/types/src/api-model/models/submit-inventory-update-response.d.ts +31 -0
  54. package/dist/types/src/api-model/models/transaction-reference.d.ts +24 -0
  55. package/dist/types/src/client.d.ts +13 -0
  56. package/dist/types/src/error.d.ts +3 -0
  57. package/package.json +53 -0
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Direct Fulfillment Inventory Updates
6
+ * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates.
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ const tslib_1 = require("tslib");
17
+ (0, tslib_1.__exportStar)(require("./api"), exports);
18
+ (0, tslib_1.__exportStar)(require("./configuration"), exports);
19
+ (0, tslib_1.__exportStar)(require("./models"), exports);
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ (0, tslib_1.__exportStar)(require("./inventory-update"), exports);
5
+ (0, tslib_1.__exportStar)(require("./item-details"), exports);
6
+ (0, tslib_1.__exportStar)(require("./item-quantity"), exports);
7
+ (0, tslib_1.__exportStar)(require("./model-error"), exports);
8
+ (0, tslib_1.__exportStar)(require("./party-identification"), exports);
9
+ (0, tslib_1.__exportStar)(require("./submit-inventory-update-request"), exports);
10
+ (0, tslib_1.__exportStar)(require("./submit-inventory-update-response"), exports);
11
+ (0, tslib_1.__exportStar)(require("./transaction-reference"), exports);
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Direct Fulfillment Inventory Updates
6
+ * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates.
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Direct Fulfillment Inventory Updates
6
+ * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates.
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Direct Fulfillment Inventory Updates
6
+ * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates.
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Direct Fulfillment Inventory Updates
6
+ * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates.
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Direct Fulfillment Inventory Updates
6
+ * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates.
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Direct Fulfillment Inventory Updates
6
+ * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates.
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Direct Fulfillment Inventory Updates
6
+ * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates.
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Selling Partner API for Direct Fulfillment Inventory Updates
6
+ * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates.
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VendorDirectFulfillmentInventoryApiClient = exports.RATE_LIMITS = void 0;
4
+ /* eslint-disable prefer-regex-literals */
5
+ const common_1 = require("@sp-api-sdk/common");
6
+ const api_model_1 = require("./api-model");
7
+ const error_1 = require("./error");
8
+ exports.RATE_LIMITS = [
9
+ {
10
+ method: 'post',
11
+ urlRegex: new RegExp('^/vendor/directFulfillment/inventory/v1/warehouses/[^/]*/items$'),
12
+ rate: 10,
13
+ burst: 10,
14
+ },
15
+ ];
16
+ class VendorDirectFulfillmentInventoryApiClient extends api_model_1.UpdateInventoryApi {
17
+ constructor(parameters) {
18
+ const region = common_1.awsRegionByCode[parameters.region] ?? parameters.region;
19
+ const { rateLimiting, ...clientParameters } = parameters;
20
+ const axiosParameters = { ...clientParameters, region };
21
+ if (rateLimiting?.retry) {
22
+ axiosParameters.rateLimits = exports.RATE_LIMITS;
23
+ axiosParameters.onRetry = rateLimiting.onRetry;
24
+ }
25
+ const axiosInstance = (0, common_1.createAxiosInstance)(axiosParameters);
26
+ const configuration = new api_model_1.Configuration();
27
+ const environment = parameters.sandbox ? 'sandbox' : 'production';
28
+ const endpoint = common_1.endpoints[environment][region];
29
+ if (!endpoint) {
30
+ throw new error_1.VendorDirectFulfillmentInventoryApiError(`Unknown region : ${region}`);
31
+ }
32
+ super(configuration, endpoint, axiosInstance);
33
+ }
34
+ }
35
+ exports.VendorDirectFulfillmentInventoryApiClient = VendorDirectFulfillmentInventoryApiClient;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VendorDirectFulfillmentInventoryApiError = void 0;
4
+ class VendorDirectFulfillmentInventoryApiError extends Error {
5
+ constructor(message) {
6
+ super(message);
7
+ this.name = 'VendorDirectFulfillmentInventoryApiError';
8
+ }
9
+ }
10
+ exports.VendorDirectFulfillmentInventoryApiError = VendorDirectFulfillmentInventoryApiError;
@@ -0,0 +1,3 @@
1
+ export * from './src/client';
2
+ export * from './src/error';
3
+ export * from './src/api-model/models';
@@ -0,0 +1,117 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Selling Partner API for Direct Fulfillment Inventory Updates
5
+ * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates.
6
+ *
7
+ * The version of the OpenAPI document: v1
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
+ * UpdateInventoryApi - axios parameter creator
22
+ * @export
23
+ */
24
+ export const UpdateInventoryApiAxiosParamCreator = function (configuration) {
25
+ return {
26
+ /**
27
+ * Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
28
+ * @param {string} warehouseId Identifier for the warehouse for which to update inventory.
29
+ * @param {SubmitInventoryUpdateRequest} body
30
+ * @param {*} [options] Override http request option.
31
+ * @throws {RequiredError}
32
+ */
33
+ submitInventoryUpdate: async (warehouseId, body, options = {}) => {
34
+ // verify required parameter 'warehouseId' is not null or undefined
35
+ assertParamExists('submitInventoryUpdate', 'warehouseId', warehouseId);
36
+ // verify required parameter 'body' is not null or undefined
37
+ assertParamExists('submitInventoryUpdate', 'body', body);
38
+ const localVarPath = `/vendor/directFulfillment/inventory/v1/warehouses/{warehouseId}/items`
39
+ .replace(`{${"warehouseId"}}`, encodeURIComponent(String(warehouseId)));
40
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
41
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
42
+ let baseOptions;
43
+ if (configuration) {
44
+ baseOptions = configuration.baseOptions;
45
+ }
46
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
47
+ const localVarHeaderParameter = {};
48
+ const localVarQueryParameter = {};
49
+ localVarHeaderParameter['Content-Type'] = 'application/json';
50
+ setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
51
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
52
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
53
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
54
+ return {
55
+ url: toPathString(localVarUrlObj),
56
+ options: localVarRequestOptions,
57
+ };
58
+ },
59
+ };
60
+ };
61
+ /**
62
+ * UpdateInventoryApi - functional programming interface
63
+ * @export
64
+ */
65
+ export const UpdateInventoryApiFp = function (configuration) {
66
+ const localVarAxiosParamCreator = UpdateInventoryApiAxiosParamCreator(configuration);
67
+ return {
68
+ /**
69
+ * Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
70
+ * @param {string} warehouseId Identifier for the warehouse for which to update inventory.
71
+ * @param {SubmitInventoryUpdateRequest} body
72
+ * @param {*} [options] Override http request option.
73
+ * @throws {RequiredError}
74
+ */
75
+ async submitInventoryUpdate(warehouseId, body, options) {
76
+ const localVarAxiosArgs = await localVarAxiosParamCreator.submitInventoryUpdate(warehouseId, body, options);
77
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
78
+ },
79
+ };
80
+ };
81
+ /**
82
+ * UpdateInventoryApi - factory interface
83
+ * @export
84
+ */
85
+ export const UpdateInventoryApiFactory = function (configuration, basePath, axios) {
86
+ const localVarFp = UpdateInventoryApiFp(configuration);
87
+ return {
88
+ /**
89
+ * Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
90
+ * @param {string} warehouseId Identifier for the warehouse for which to update inventory.
91
+ * @param {SubmitInventoryUpdateRequest} body
92
+ * @param {*} [options] Override http request option.
93
+ * @throws {RequiredError}
94
+ */
95
+ submitInventoryUpdate(warehouseId, body, options) {
96
+ return localVarFp.submitInventoryUpdate(warehouseId, body, options).then((request) => request(axios, basePath));
97
+ },
98
+ };
99
+ };
100
+ /**
101
+ * UpdateInventoryApi - object-oriented interface
102
+ * @export
103
+ * @class UpdateInventoryApi
104
+ * @extends {BaseAPI}
105
+ */
106
+ export class UpdateInventoryApi extends BaseAPI {
107
+ /**
108
+ * Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 10 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
109
+ * @param {UpdateInventoryApiSubmitInventoryUpdateRequest} requestParameters Request parameters.
110
+ * @param {*} [options] Override http request option.
111
+ * @throws {RequiredError}
112
+ * @memberof UpdateInventoryApi
113
+ */
114
+ submitInventoryUpdate(requestParameters, options) {
115
+ return UpdateInventoryApiFp(this.configuration).submitInventoryUpdate(requestParameters.warehouseId, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
116
+ }
117
+ }
@@ -0,0 +1,14 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Selling Partner API for Direct Fulfillment Inventory Updates
5
+ * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates.
6
+ *
7
+ * The version of the OpenAPI document: v1
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/update-inventory-api';
@@ -0,0 +1,56 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Selling Partner API for Direct Fulfillment Inventory Updates
5
+ * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates.
6
+ *
7
+ * The version of the OpenAPI document: v1
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
+ // Some imports not used depending on template conditions
15
+ // @ts-ignore
16
+ import globalAxios from 'axios';
17
+ export const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
18
+ /**
19
+ *
20
+ * @export
21
+ */
22
+ export const COLLECTION_FORMATS = {
23
+ csv: ",",
24
+ ssv: " ",
25
+ tsv: "\t",
26
+ pipes: "|",
27
+ };
28
+ /**
29
+ *
30
+ * @export
31
+ * @class BaseAPI
32
+ */
33
+ export class BaseAPI {
34
+ constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
35
+ this.basePath = basePath;
36
+ this.axios = axios;
37
+ if (configuration) {
38
+ this.configuration = configuration;
39
+ this.basePath = configuration.basePath || this.basePath;
40
+ }
41
+ }
42
+ }
43
+ ;
44
+ /**
45
+ *
46
+ * @export
47
+ * @class RequiredError
48
+ * @extends {Error}
49
+ */
50
+ export class RequiredError extends Error {
51
+ constructor(field, msg) {
52
+ super(msg);
53
+ this.field = field;
54
+ this.name = "RequiredError";
55
+ }
56
+ }
@@ -0,0 +1,125 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Selling Partner API for Direct Fulfillment Inventory Updates
5
+ * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates.
6
+ *
7
+ * The version of the OpenAPI document: v1
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
+ /**
76
+ *
77
+ * @export
78
+ */
79
+ export const setSearchParams = function (url, ...objects) {
80
+ const searchParams = new URLSearchParams(url.search);
81
+ for (const object of objects) {
82
+ for (const key in object) {
83
+ if (Array.isArray(object[key])) {
84
+ searchParams.delete(key);
85
+ for (const item of object[key]) {
86
+ searchParams.append(key, item);
87
+ }
88
+ }
89
+ else {
90
+ searchParams.set(key, object[key]);
91
+ }
92
+ }
93
+ }
94
+ url.search = searchParams.toString();
95
+ };
96
+ /**
97
+ *
98
+ * @export
99
+ */
100
+ export const serializeDataIfNeeded = function (value, requestOptions, configuration) {
101
+ const nonString = typeof value !== 'string';
102
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
103
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
104
+ : nonString;
105
+ return needsSerialization
106
+ ? JSON.stringify(value !== undefined ? value : {})
107
+ : (value || "");
108
+ };
109
+ /**
110
+ *
111
+ * @export
112
+ */
113
+ export const toPathString = function (url) {
114
+ return url.pathname + url.search + url.hash;
115
+ };
116
+ /**
117
+ *
118
+ * @export
119
+ */
120
+ export const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
121
+ return (axios = globalAxios, basePath = BASE_PATH) => {
122
+ const axiosRequestArgs = { ...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url };
123
+ return axios.request(axiosRequestArgs);
124
+ };
125
+ };