UNPKG

@whitebox-co/walmart-marketplace-api

Version:

A fully typed TypeScript, Javascript, and Node.js API library for the Walmart Marketplace API

279 lines 22.7 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Lag Time * This API allows the retrieval of Lag Time for an item with a given SKU. * * The version of the OpenAPI document: 1.0.0 * * * 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.LagTimeApi = exports.LagTimeApiFactory = exports.LagTimeApiFp = exports.LagTimeApiAxiosParamCreator = 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"); /** * LagTimeApi - axios parameter creator * @export */ const LagTimeApiAxiosParamCreator = function (configuration) { return { /** * This API allows the retrieval of Lag Time for an item with a given SKU. Lag Time is the number of days between when an item is ordered and when it is shipped. Lag time of two days or more requires approval at the item setup category level. Please refer to the Request Lag Time Exceptions article for more details on this process. Download the Lag Time Exception XSDs from the below directory: xsd/LagTimeException.zip. Download the Lag Time JSON schema from the below directory: xsd/LagTimeException.zip. * @summary Lag Time * @param {string} sku An arbitrary alphanumeric unique ID, specified by the seller, which identifies each item. This will be used by the seller in the XSD file to refer to each item. Special characters in the sku needing encoding are: \':\', \'/\', \'?\', \'#\', \'[\', \']\', \'@\', \'!\', \'$\', \'&\', \"\'\", \'(\', \')\', \'*\', \'+\', \',\', \';\', \'=\', ‘ ’, \'{\', \'}\' as well as \'%\' itself if it\'s a part of sku. Make sure to encode space with %20. Other characters don\'t need to be encoded. * @param {string} authorization Basic authorization header. Base 64 encodes the Client ID and Client Secret retrieved in step two of the integration steps. * @param {string} wMSECACCESSTOKEN The access token retrieved in the Token API call * @param {string} wMQOSCORRELATIONID A unique ID which identifies each API call and used to track and debug issues; use a random generated GUID for this ID * @param {string} wMSVCNAME Walmart Service Name * @param {string} [wMCONSUMERCHANNELTYPE] A unique ID to track the consumer request by channel. Use the Consumer Channel Type received during onboarding * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLagTime: async (sku, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options = {}) => { // verify required parameter 'sku' is not null or undefined (0, common_1.assertParamExists)('getLagTime', 'sku', sku); // verify required parameter 'authorization' is not null or undefined (0, common_1.assertParamExists)('getLagTime', 'authorization', authorization); // verify required parameter 'wMSECACCESSTOKEN' is not null or undefined (0, common_1.assertParamExists)('getLagTime', 'wMSECACCESSTOKEN', wMSECACCESSTOKEN); // verify required parameter 'wMQOSCORRELATIONID' is not null or undefined (0, common_1.assertParamExists)('getLagTime', 'wMQOSCORRELATIONID', wMQOSCORRELATIONID); // verify required parameter 'wMSVCNAME' is not null or undefined (0, common_1.assertParamExists)('getLagTime', 'wMSVCNAME', wMSVCNAME); const localVarPath = `/v3/lagtime`; // 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 = {}; // authentication basicScheme required // http basic authentication required (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); if (sku !== undefined) { localVarQueryParameter['sku'] = sku; } if (authorization !== undefined && authorization !== null) { localVarHeaderParameter['Authorization'] = String(authorization); } if (wMSECACCESSTOKEN !== undefined && wMSECACCESSTOKEN !== null) { localVarHeaderParameter['WM_SEC.ACCESS_TOKEN'] = String(wMSECACCESSTOKEN); } if (wMCONSUMERCHANNELTYPE !== undefined && wMCONSUMERCHANNELTYPE !== null) { localVarHeaderParameter['WM_CONSUMER.CHANNEL.TYPE'] = String(wMCONSUMERCHANNELTYPE); } if (wMQOSCORRELATIONID !== undefined && wMQOSCORRELATIONID !== null) { localVarHeaderParameter['WM_QOS.CORRELATION_ID'] = String(wMQOSCORRELATIONID); } if (wMSVCNAME !== undefined && wMSVCNAME !== null) { localVarHeaderParameter['WM_SVC.NAME'] = String(wMSVCNAME); } (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, }; }, /** * This API allows the update of lag time for items in bulk. Lag Time is the number of days between when an item is ordered and when it is shipped. Lag time of two days or more requires approval at the item setup category level. Please refer to the Request Lag Time Exceptions article for more details on this process. Download the Lag Time Exception XSDs from the below directory: xsd/LagTimeException.zip. * @summary Update lag time * @param {string} feedType Use \'lagtime\' * @param {string} authorization Basic authorization header. Base 64 encodes the Client ID and Client Secret retrieved in step two of the integration steps. * @param {string} wMSECACCESSTOKEN The access token retrieved in the Token API call * @param {string} wMQOSCORRELATIONID A unique ID which identifies each API call and used to track and debug issues; use a random generated GUID for this ID * @param {string} wMSVCNAME Walmart Service Name * @param {InlineObject} inlineObject * @param {string} [wMCONSUMERCHANNELTYPE] A unique ID to track the consumer request by channel. Use the Consumer Channel Type received during onboarding * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateLagTimeBulk: async (feedType, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject, wMCONSUMERCHANNELTYPE, options = {}) => { // verify required parameter 'feedType' is not null or undefined (0, common_1.assertParamExists)('updateLagTimeBulk', 'feedType', feedType); // verify required parameter 'authorization' is not null or undefined (0, common_1.assertParamExists)('updateLagTimeBulk', 'authorization', authorization); // verify required parameter 'wMSECACCESSTOKEN' is not null or undefined (0, common_1.assertParamExists)('updateLagTimeBulk', 'wMSECACCESSTOKEN', wMSECACCESSTOKEN); // verify required parameter 'wMQOSCORRELATIONID' is not null or undefined (0, common_1.assertParamExists)('updateLagTimeBulk', 'wMQOSCORRELATIONID', wMQOSCORRELATIONID); // verify required parameter 'wMSVCNAME' is not null or undefined (0, common_1.assertParamExists)('updateLagTimeBulk', 'wMSVCNAME', wMSVCNAME); // verify required parameter 'inlineObject' is not null or undefined (0, common_1.assertParamExists)('updateLagTimeBulk', 'inlineObject', inlineObject); const localVarPath = `/v3/feeds`; // 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 = {}; // authentication basicScheme required // http basic authentication required (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); if (feedType !== undefined) { localVarQueryParameter['feedType'] = feedType; } if (authorization !== undefined && authorization !== null) { localVarHeaderParameter['Authorization'] = String(authorization); } if (wMSECACCESSTOKEN !== undefined && wMSECACCESSTOKEN !== null) { localVarHeaderParameter['WM_SEC.ACCESS_TOKEN'] = String(wMSECACCESSTOKEN); } if (wMCONSUMERCHANNELTYPE !== undefined && wMCONSUMERCHANNELTYPE !== null) { localVarHeaderParameter['WM_CONSUMER.CHANNEL.TYPE'] = String(wMCONSUMERCHANNELTYPE); } if (wMQOSCORRELATIONID !== undefined && wMQOSCORRELATIONID !== null) { localVarHeaderParameter['WM_QOS.CORRELATION_ID'] = String(wMQOSCORRELATIONID); } if (wMSVCNAME !== undefined && wMSVCNAME !== null) { localVarHeaderParameter['WM_SVC.NAME'] = String(wMSVCNAME); } localVarHeaderParameter['Content-Type'] = 'application/xml'; (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)(inlineObject, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.LagTimeApiAxiosParamCreator = LagTimeApiAxiosParamCreator; /** * LagTimeApi - functional programming interface * @export */ const LagTimeApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.LagTimeApiAxiosParamCreator)(configuration); return { /** * This API allows the retrieval of Lag Time for an item with a given SKU. Lag Time is the number of days between when an item is ordered and when it is shipped. Lag time of two days or more requires approval at the item setup category level. Please refer to the Request Lag Time Exceptions article for more details on this process. Download the Lag Time Exception XSDs from the below directory: xsd/LagTimeException.zip. Download the Lag Time JSON schema from the below directory: xsd/LagTimeException.zip. * @summary Lag Time * @param {string} sku An arbitrary alphanumeric unique ID, specified by the seller, which identifies each item. This will be used by the seller in the XSD file to refer to each item. Special characters in the sku needing encoding are: \':\', \'/\', \'?\', \'#\', \'[\', \']\', \'@\', \'!\', \'$\', \'&\', \"\'\", \'(\', \')\', \'*\', \'+\', \',\', \';\', \'=\', ‘ ’, \'{\', \'}\' as well as \'%\' itself if it\'s a part of sku. Make sure to encode space with %20. Other characters don\'t need to be encoded. * @param {string} authorization Basic authorization header. Base 64 encodes the Client ID and Client Secret retrieved in step two of the integration steps. * @param {string} wMSECACCESSTOKEN The access token retrieved in the Token API call * @param {string} wMQOSCORRELATIONID A unique ID which identifies each API call and used to track and debug issues; use a random generated GUID for this ID * @param {string} wMSVCNAME Walmart Service Name * @param {string} [wMCONSUMERCHANNELTYPE] A unique ID to track the consumer request by channel. Use the Consumer Channel Type received during onboarding * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getLagTime(sku, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getLagTime(sku, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * This API allows the update of lag time for items in bulk. Lag Time is the number of days between when an item is ordered and when it is shipped. Lag time of two days or more requires approval at the item setup category level. Please refer to the Request Lag Time Exceptions article for more details on this process. Download the Lag Time Exception XSDs from the below directory: xsd/LagTimeException.zip. * @summary Update lag time * @param {string} feedType Use \'lagtime\' * @param {string} authorization Basic authorization header. Base 64 encodes the Client ID and Client Secret retrieved in step two of the integration steps. * @param {string} wMSECACCESSTOKEN The access token retrieved in the Token API call * @param {string} wMQOSCORRELATIONID A unique ID which identifies each API call and used to track and debug issues; use a random generated GUID for this ID * @param {string} wMSVCNAME Walmart Service Name * @param {InlineObject} inlineObject * @param {string} [wMCONSUMERCHANNELTYPE] A unique ID to track the consumer request by channel. Use the Consumer Channel Type received during onboarding * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateLagTimeBulk(feedType, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject, wMCONSUMERCHANNELTYPE, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateLagTimeBulk(feedType, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject, wMCONSUMERCHANNELTYPE, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, }; }; exports.LagTimeApiFp = LagTimeApiFp; /** * LagTimeApi - factory interface * @export */ const LagTimeApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.LagTimeApiFp)(configuration); return { /** * This API allows the retrieval of Lag Time for an item with a given SKU. Lag Time is the number of days between when an item is ordered and when it is shipped. Lag time of two days or more requires approval at the item setup category level. Please refer to the Request Lag Time Exceptions article for more details on this process. Download the Lag Time Exception XSDs from the below directory: xsd/LagTimeException.zip. Download the Lag Time JSON schema from the below directory: xsd/LagTimeException.zip. * @summary Lag Time * @param {string} sku An arbitrary alphanumeric unique ID, specified by the seller, which identifies each item. This will be used by the seller in the XSD file to refer to each item. Special characters in the sku needing encoding are: \':\', \'/\', \'?\', \'#\', \'[\', \']\', \'@\', \'!\', \'$\', \'&\', \"\'\", \'(\', \')\', \'*\', \'+\', \',\', \';\', \'=\', ‘ ’, \'{\', \'}\' as well as \'%\' itself if it\'s a part of sku. Make sure to encode space with %20. Other characters don\'t need to be encoded. * @param {string} authorization Basic authorization header. Base 64 encodes the Client ID and Client Secret retrieved in step two of the integration steps. * @param {string} wMSECACCESSTOKEN The access token retrieved in the Token API call * @param {string} wMQOSCORRELATIONID A unique ID which identifies each API call and used to track and debug issues; use a random generated GUID for this ID * @param {string} wMSVCNAME Walmart Service Name * @param {string} [wMCONSUMERCHANNELTYPE] A unique ID to track the consumer request by channel. Use the Consumer Channel Type received during onboarding * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLagTime(sku, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options) { return localVarFp.getLagTime(sku, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options).then((request) => request(axios, basePath)); }, /** * This API allows the update of lag time for items in bulk. Lag Time is the number of days between when an item is ordered and when it is shipped. Lag time of two days or more requires approval at the item setup category level. Please refer to the Request Lag Time Exceptions article for more details on this process. Download the Lag Time Exception XSDs from the below directory: xsd/LagTimeException.zip. * @summary Update lag time * @param {string} feedType Use \'lagtime\' * @param {string} authorization Basic authorization header. Base 64 encodes the Client ID and Client Secret retrieved in step two of the integration steps. * @param {string} wMSECACCESSTOKEN The access token retrieved in the Token API call * @param {string} wMQOSCORRELATIONID A unique ID which identifies each API call and used to track and debug issues; use a random generated GUID for this ID * @param {string} wMSVCNAME Walmart Service Name * @param {InlineObject} inlineObject * @param {string} [wMCONSUMERCHANNELTYPE] A unique ID to track the consumer request by channel. Use the Consumer Channel Type received during onboarding * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateLagTimeBulk(feedType, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject, wMCONSUMERCHANNELTYPE, options) { return localVarFp.updateLagTimeBulk(feedType, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject, wMCONSUMERCHANNELTYPE, options).then((request) => request(axios, basePath)); }, }; }; exports.LagTimeApiFactory = LagTimeApiFactory; /** * LagTimeApi - object-oriented interface * @export * @class LagTimeApi * @extends {BaseAPI} */ class LagTimeApi extends base_1.BaseAPI { /** * This API allows the retrieval of Lag Time for an item with a given SKU. Lag Time is the number of days between when an item is ordered and when it is shipped. Lag time of two days or more requires approval at the item setup category level. Please refer to the Request Lag Time Exceptions article for more details on this process. Download the Lag Time Exception XSDs from the below directory: xsd/LagTimeException.zip. Download the Lag Time JSON schema from the below directory: xsd/LagTimeException.zip. * @summary Lag Time * @param {LagTimeApiGetLagTimeRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LagTimeApi */ getLagTime(requestParameters, options) { return (0, exports.LagTimeApiFp)(this.configuration).getLagTime(requestParameters.sku, requestParameters.authorization, requestParameters.wMSECACCESSTOKEN, requestParameters.wMQOSCORRELATIONID, requestParameters.wMSVCNAME, requestParameters.wMCONSUMERCHANNELTYPE, options).then((request) => request(this.axios, this.basePath)); } /** * This API allows the update of lag time for items in bulk. Lag Time is the number of days between when an item is ordered and when it is shipped. Lag time of two days or more requires approval at the item setup category level. Please refer to the Request Lag Time Exceptions article for more details on this process. Download the Lag Time Exception XSDs from the below directory: xsd/LagTimeException.zip. * @summary Update lag time * @param {LagTimeApiUpdateLagTimeBulkRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LagTimeApi */ updateLagTimeBulk(requestParameters, options) { return (0, exports.LagTimeApiFp)(this.configuration).updateLagTimeBulk(requestParameters.feedType, requestParameters.authorization, requestParameters.wMSECACCESSTOKEN, requestParameters.wMQOSCORRELATIONID, requestParameters.wMSVCNAME, requestParameters.inlineObject, requestParameters.wMCONSUMERCHANNELTYPE, options).then((request) => request(this.axios, this.basePath)); } } exports.LagTimeApi = LagTimeApi; //# sourceMappingURL=lagtime.js.map