@whitebox-co/walmart-marketplace-api
Version:
A fully typed TypeScript, Javascript, and Node.js API library for the Walmart Marketplace API
672 lines • 44.2 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Promotion Management
* Sellers can set regular or promotional prices for their items. Setting the Promotional prices is an option to create unique pricing for events such as clearance sales or to call out a comparison price
*
* 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.PromotionsApi = exports.PromotionsApiFactory = exports.PromotionsApiFp = exports.PromotionsApiAxiosParamCreator = exports.V3PricePricingPriceDisplayCodesEnum = exports.V3PricePricingComparisonPriceTypeEnum = exports.V3PricePricingCurrentPriceTypeEnum = exports.V3PricePricingProcessModeEnum = exports.V3PriceCurrentPriceCurrencyEnum = exports.V3PriceComparisonPriceCurrencyEnum = exports.RebateRebateTypeEnum = exports.PricingTypeProcessModeEnum = exports.PricingTypeComparisonPriceTypeEnum = exports.PricingTypeCurrentPriceTypeEnum = exports.PricingPriceDisplayCodesEnum = exports.PricingComparisonPriceTypeEnum = exports.PricingCurrentPriceTypeEnum = exports.PricingProcessModeEnum = exports.PriceReplaceAllEnum = exports.InlineResponse200ErrorsGatewayErrorCategoryEnum = exports.InlineResponse200ErrorsCategoryEnum = exports.InlineResponse200ErrorsSeverityEnum = exports.InlineResponse2002PayloadRebateRebateTypeEnum = exports.InlineResponse2002PayloadPricingListPricingProcessModeEnum = exports.InlineResponse2002PayloadPricingListPricingComparisonPriceTypeEnum = exports.InlineResponse2002PayloadPricingListPricingCurrentPriceTypeEnum = exports.InlineObjectReplaceAllEnum = exports.GatewayErrorGatewayErrorCategoryEnum = exports.GatewayErrorCategoryEnum = exports.GatewayErrorSeverityEnum = exports.CurrentPriceCurrencyEnum = exports.ComparisonPriceCurrencyEnum = 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 ComparisonPriceCurrencyEnum;
(function (ComparisonPriceCurrencyEnum) {
ComparisonPriceCurrencyEnum["Usd"] = "USD";
ComparisonPriceCurrencyEnum["Cad"] = "CAD";
})(ComparisonPriceCurrencyEnum = exports.ComparisonPriceCurrencyEnum || (exports.ComparisonPriceCurrencyEnum = {}));
/**
* @export
* @enum {string}
*/
var CurrentPriceCurrencyEnum;
(function (CurrentPriceCurrencyEnum) {
CurrentPriceCurrencyEnum["Usd"] = "USD";
CurrentPriceCurrencyEnum["Cad"] = "CAD";
})(CurrentPriceCurrencyEnum = exports.CurrentPriceCurrencyEnum || (exports.CurrentPriceCurrencyEnum = {}));
/**
* @export
* @enum {string}
*/
var GatewayErrorSeverityEnum;
(function (GatewayErrorSeverityEnum) {
GatewayErrorSeverityEnum["Info"] = "INFO";
GatewayErrorSeverityEnum["Warn"] = "WARN";
GatewayErrorSeverityEnum["Error"] = "ERROR";
})(GatewayErrorSeverityEnum = exports.GatewayErrorSeverityEnum || (exports.GatewayErrorSeverityEnum = {}));
/**
* @export
* @enum {string}
*/
var GatewayErrorCategoryEnum;
(function (GatewayErrorCategoryEnum) {
GatewayErrorCategoryEnum["Application"] = "APPLICATION";
GatewayErrorCategoryEnum["System"] = "SYSTEM";
GatewayErrorCategoryEnum["Request"] = "REQUEST";
GatewayErrorCategoryEnum["Data"] = "DATA";
})(GatewayErrorCategoryEnum = exports.GatewayErrorCategoryEnum || (exports.GatewayErrorCategoryEnum = {}));
/**
* @export
* @enum {string}
*/
var GatewayErrorGatewayErrorCategoryEnum;
(function (GatewayErrorGatewayErrorCategoryEnum) {
GatewayErrorGatewayErrorCategoryEnum["InternalDataError"] = "INTERNAL_DATA_ERROR";
GatewayErrorGatewayErrorCategoryEnum["ExternalDataError"] = "EXTERNAL_DATA_ERROR";
GatewayErrorGatewayErrorCategoryEnum["SystemError"] = "SYSTEM_ERROR";
})(GatewayErrorGatewayErrorCategoryEnum = exports.GatewayErrorGatewayErrorCategoryEnum || (exports.GatewayErrorGatewayErrorCategoryEnum = {}));
/**
* @export
* @enum {string}
*/
var InlineObjectReplaceAllEnum;
(function (InlineObjectReplaceAllEnum) {
InlineObjectReplaceAllEnum["True"] = "true";
InlineObjectReplaceAllEnum["False"] = "false";
})(InlineObjectReplaceAllEnum = exports.InlineObjectReplaceAllEnum || (exports.InlineObjectReplaceAllEnum = {}));
/**
* @export
* @enum {string}
*/
var InlineResponse2002PayloadPricingListPricingCurrentPriceTypeEnum;
(function (InlineResponse2002PayloadPricingListPricingCurrentPriceTypeEnum) {
InlineResponse2002PayloadPricingListPricingCurrentPriceTypeEnum["Base"] = "BASE";
InlineResponse2002PayloadPricingListPricingCurrentPriceTypeEnum["Reduced"] = "REDUCED";
InlineResponse2002PayloadPricingListPricingCurrentPriceTypeEnum["SavingsAmt"] = "SAVINGS_AMT";
InlineResponse2002PayloadPricingListPricingCurrentPriceTypeEnum["SavingsPct"] = "SAVINGS_PCT";
InlineResponse2002PayloadPricingListPricingCurrentPriceTypeEnum["Rollback"] = "ROLLBACK";
InlineResponse2002PayloadPricingListPricingCurrentPriceTypeEnum["Clearance"] = "CLEARANCE";
InlineResponse2002PayloadPricingListPricingCurrentPriceTypeEnum["ListPrice"] = "LIST_PRICE";
})(InlineResponse2002PayloadPricingListPricingCurrentPriceTypeEnum = exports.InlineResponse2002PayloadPricingListPricingCurrentPriceTypeEnum || (exports.InlineResponse2002PayloadPricingListPricingCurrentPriceTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var InlineResponse2002PayloadPricingListPricingComparisonPriceTypeEnum;
(function (InlineResponse2002PayloadPricingListPricingComparisonPriceTypeEnum) {
InlineResponse2002PayloadPricingListPricingComparisonPriceTypeEnum["Base"] = "BASE";
InlineResponse2002PayloadPricingListPricingComparisonPriceTypeEnum["Reduced"] = "REDUCED";
InlineResponse2002PayloadPricingListPricingComparisonPriceTypeEnum["SavingsAmt"] = "SAVINGS_AMT";
InlineResponse2002PayloadPricingListPricingComparisonPriceTypeEnum["SavingsPct"] = "SAVINGS_PCT";
InlineResponse2002PayloadPricingListPricingComparisonPriceTypeEnum["Rollback"] = "ROLLBACK";
InlineResponse2002PayloadPricingListPricingComparisonPriceTypeEnum["Clearance"] = "CLEARANCE";
InlineResponse2002PayloadPricingListPricingComparisonPriceTypeEnum["ListPrice"] = "LIST_PRICE";
})(InlineResponse2002PayloadPricingListPricingComparisonPriceTypeEnum = exports.InlineResponse2002PayloadPricingListPricingComparisonPriceTypeEnum || (exports.InlineResponse2002PayloadPricingListPricingComparisonPriceTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var InlineResponse2002PayloadPricingListPricingProcessModeEnum;
(function (InlineResponse2002PayloadPricingListPricingProcessModeEnum) {
InlineResponse2002PayloadPricingListPricingProcessModeEnum["Upsert"] = "UPSERT";
InlineResponse2002PayloadPricingListPricingProcessModeEnum["Delete"] = "DELETE";
})(InlineResponse2002PayloadPricingListPricingProcessModeEnum = exports.InlineResponse2002PayloadPricingListPricingProcessModeEnum || (exports.InlineResponse2002PayloadPricingListPricingProcessModeEnum = {}));
/**
* @export
* @enum {string}
*/
var InlineResponse2002PayloadRebateRebateTypeEnum;
(function (InlineResponse2002PayloadRebateRebateTypeEnum) {
InlineResponse2002PayloadRebateRebateTypeEnum["Amount"] = "AMOUNT";
InlineResponse2002PayloadRebateRebateTypeEnum["Product"] = "PRODUCT";
})(InlineResponse2002PayloadRebateRebateTypeEnum = exports.InlineResponse2002PayloadRebateRebateTypeEnum || (exports.InlineResponse2002PayloadRebateRebateTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var InlineResponse200ErrorsSeverityEnum;
(function (InlineResponse200ErrorsSeverityEnum) {
InlineResponse200ErrorsSeverityEnum["Info"] = "INFO";
InlineResponse200ErrorsSeverityEnum["Warn"] = "WARN";
InlineResponse200ErrorsSeverityEnum["Error"] = "ERROR";
})(InlineResponse200ErrorsSeverityEnum = exports.InlineResponse200ErrorsSeverityEnum || (exports.InlineResponse200ErrorsSeverityEnum = {}));
/**
* @export
* @enum {string}
*/
var InlineResponse200ErrorsCategoryEnum;
(function (InlineResponse200ErrorsCategoryEnum) {
InlineResponse200ErrorsCategoryEnum["Application"] = "APPLICATION";
InlineResponse200ErrorsCategoryEnum["System"] = "SYSTEM";
InlineResponse200ErrorsCategoryEnum["Request"] = "REQUEST";
InlineResponse200ErrorsCategoryEnum["Data"] = "DATA";
})(InlineResponse200ErrorsCategoryEnum = exports.InlineResponse200ErrorsCategoryEnum || (exports.InlineResponse200ErrorsCategoryEnum = {}));
/**
* @export
* @enum {string}
*/
var InlineResponse200ErrorsGatewayErrorCategoryEnum;
(function (InlineResponse200ErrorsGatewayErrorCategoryEnum) {
InlineResponse200ErrorsGatewayErrorCategoryEnum["InternalDataError"] = "INTERNAL_DATA_ERROR";
InlineResponse200ErrorsGatewayErrorCategoryEnum["ExternalDataError"] = "EXTERNAL_DATA_ERROR";
InlineResponse200ErrorsGatewayErrorCategoryEnum["SystemError"] = "SYSTEM_ERROR";
})(InlineResponse200ErrorsGatewayErrorCategoryEnum = exports.InlineResponse200ErrorsGatewayErrorCategoryEnum || (exports.InlineResponse200ErrorsGatewayErrorCategoryEnum = {}));
/**
* @export
* @enum {string}
*/
var PriceReplaceAllEnum;
(function (PriceReplaceAllEnum) {
PriceReplaceAllEnum["True"] = "true";
PriceReplaceAllEnum["False"] = "false";
})(PriceReplaceAllEnum = exports.PriceReplaceAllEnum || (exports.PriceReplaceAllEnum = {}));
/**
* @export
* @enum {string}
*/
var PricingProcessModeEnum;
(function (PricingProcessModeEnum) {
PricingProcessModeEnum["Upsert"] = "UPSERT";
PricingProcessModeEnum["Delete"] = "DELETE";
})(PricingProcessModeEnum = exports.PricingProcessModeEnum || (exports.PricingProcessModeEnum = {}));
/**
* @export
* @enum {string}
*/
var PricingCurrentPriceTypeEnum;
(function (PricingCurrentPriceTypeEnum) {
PricingCurrentPriceTypeEnum["Base"] = "BASE";
PricingCurrentPriceTypeEnum["Reduced"] = "REDUCED";
PricingCurrentPriceTypeEnum["Clearance"] = "CLEARANCE";
})(PricingCurrentPriceTypeEnum = exports.PricingCurrentPriceTypeEnum || (exports.PricingCurrentPriceTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var PricingComparisonPriceTypeEnum;
(function (PricingComparisonPriceTypeEnum) {
PricingComparisonPriceTypeEnum["Base"] = "BASE";
})(PricingComparisonPriceTypeEnum = exports.PricingComparisonPriceTypeEnum || (exports.PricingComparisonPriceTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var PricingPriceDisplayCodesEnum;
(function (PricingPriceDisplayCodesEnum) {
PricingPriceDisplayCodesEnum["Cart"] = "CART";
PricingPriceDisplayCodesEnum["Checkout"] = "CHECKOUT";
})(PricingPriceDisplayCodesEnum = exports.PricingPriceDisplayCodesEnum || (exports.PricingPriceDisplayCodesEnum = {}));
/**
* @export
* @enum {string}
*/
var PricingTypeCurrentPriceTypeEnum;
(function (PricingTypeCurrentPriceTypeEnum) {
PricingTypeCurrentPriceTypeEnum["Base"] = "BASE";
PricingTypeCurrentPriceTypeEnum["Reduced"] = "REDUCED";
PricingTypeCurrentPriceTypeEnum["SavingsAmt"] = "SAVINGS_AMT";
PricingTypeCurrentPriceTypeEnum["SavingsPct"] = "SAVINGS_PCT";
PricingTypeCurrentPriceTypeEnum["Rollback"] = "ROLLBACK";
PricingTypeCurrentPriceTypeEnum["Clearance"] = "CLEARANCE";
PricingTypeCurrentPriceTypeEnum["ListPrice"] = "LIST_PRICE";
})(PricingTypeCurrentPriceTypeEnum = exports.PricingTypeCurrentPriceTypeEnum || (exports.PricingTypeCurrentPriceTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var PricingTypeComparisonPriceTypeEnum;
(function (PricingTypeComparisonPriceTypeEnum) {
PricingTypeComparisonPriceTypeEnum["Base"] = "BASE";
PricingTypeComparisonPriceTypeEnum["Reduced"] = "REDUCED";
PricingTypeComparisonPriceTypeEnum["SavingsAmt"] = "SAVINGS_AMT";
PricingTypeComparisonPriceTypeEnum["SavingsPct"] = "SAVINGS_PCT";
PricingTypeComparisonPriceTypeEnum["Rollback"] = "ROLLBACK";
PricingTypeComparisonPriceTypeEnum["Clearance"] = "CLEARANCE";
PricingTypeComparisonPriceTypeEnum["ListPrice"] = "LIST_PRICE";
})(PricingTypeComparisonPriceTypeEnum = exports.PricingTypeComparisonPriceTypeEnum || (exports.PricingTypeComparisonPriceTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var PricingTypeProcessModeEnum;
(function (PricingTypeProcessModeEnum) {
PricingTypeProcessModeEnum["Upsert"] = "UPSERT";
PricingTypeProcessModeEnum["Delete"] = "DELETE";
})(PricingTypeProcessModeEnum = exports.PricingTypeProcessModeEnum || (exports.PricingTypeProcessModeEnum = {}));
/**
* @export
* @enum {string}
*/
var RebateRebateTypeEnum;
(function (RebateRebateTypeEnum) {
RebateRebateTypeEnum["Amount"] = "AMOUNT";
RebateRebateTypeEnum["Product"] = "PRODUCT";
})(RebateRebateTypeEnum = exports.RebateRebateTypeEnum || (exports.RebateRebateTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var V3PriceComparisonPriceCurrencyEnum;
(function (V3PriceComparisonPriceCurrencyEnum) {
V3PriceComparisonPriceCurrencyEnum["Usd"] = "USD";
V3PriceComparisonPriceCurrencyEnum["Cad"] = "CAD";
})(V3PriceComparisonPriceCurrencyEnum = exports.V3PriceComparisonPriceCurrencyEnum || (exports.V3PriceComparisonPriceCurrencyEnum = {}));
/**
* @export
* @enum {string}
*/
var V3PriceCurrentPriceCurrencyEnum;
(function (V3PriceCurrentPriceCurrencyEnum) {
V3PriceCurrentPriceCurrencyEnum["Usd"] = "USD";
V3PriceCurrentPriceCurrencyEnum["Cad"] = "CAD";
})(V3PriceCurrentPriceCurrencyEnum = exports.V3PriceCurrentPriceCurrencyEnum || (exports.V3PriceCurrentPriceCurrencyEnum = {}));
/**
* @export
* @enum {string}
*/
var V3PricePricingProcessModeEnum;
(function (V3PricePricingProcessModeEnum) {
V3PricePricingProcessModeEnum["Upsert"] = "UPSERT";
V3PricePricingProcessModeEnum["Delete"] = "DELETE";
})(V3PricePricingProcessModeEnum = exports.V3PricePricingProcessModeEnum || (exports.V3PricePricingProcessModeEnum = {}));
/**
* @export
* @enum {string}
*/
var V3PricePricingCurrentPriceTypeEnum;
(function (V3PricePricingCurrentPriceTypeEnum) {
V3PricePricingCurrentPriceTypeEnum["Base"] = "BASE";
V3PricePricingCurrentPriceTypeEnum["Reduced"] = "REDUCED";
V3PricePricingCurrentPriceTypeEnum["Clearance"] = "CLEARANCE";
})(V3PricePricingCurrentPriceTypeEnum = exports.V3PricePricingCurrentPriceTypeEnum || (exports.V3PricePricingCurrentPriceTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var V3PricePricingComparisonPriceTypeEnum;
(function (V3PricePricingComparisonPriceTypeEnum) {
V3PricePricingComparisonPriceTypeEnum["Base"] = "BASE";
})(V3PricePricingComparisonPriceTypeEnum = exports.V3PricePricingComparisonPriceTypeEnum || (exports.V3PricePricingComparisonPriceTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var V3PricePricingPriceDisplayCodesEnum;
(function (V3PricePricingPriceDisplayCodesEnum) {
V3PricePricingPriceDisplayCodesEnum["Cart"] = "CART";
V3PricePricingPriceDisplayCodesEnum["Checkout"] = "CHECKOUT";
})(V3PricePricingPriceDisplayCodesEnum = exports.V3PricePricingPriceDisplayCodesEnum || (exports.V3PricePricingPriceDisplayCodesEnum = {}));
/**
* PromotionsApi - axios parameter creator
* @export
*/
const PromotionsApiAxiosParamCreator = function (configuration) {
return {
/**
* Retrieves a list of promotional prices for a single SKU.
* @summary Promotional prices
* @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. 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}
*/
getPromotionalPrices: async (sku, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options = {}) => {
// verify required parameter 'sku' is not null or undefined
(0, common_1.assertParamExists)('getPromotionalPrices', 'sku', sku);
// verify required parameter 'authorization' is not null or undefined
(0, common_1.assertParamExists)('getPromotionalPrices', 'authorization', authorization);
// verify required parameter 'wMSECACCESSTOKEN' is not null or undefined
(0, common_1.assertParamExists)('getPromotionalPrices', 'wMSECACCESSTOKEN', wMSECACCESSTOKEN);
// verify required parameter 'wMQOSCORRELATIONID' is not null or undefined
(0, common_1.assertParamExists)('getPromotionalPrices', 'wMQOSCORRELATIONID', wMQOSCORRELATIONID);
// verify required parameter 'wMSVCNAME' is not null or undefined
(0, common_1.assertParamExists)('getPromotionalPrices', 'wMSVCNAME', wMSVCNAME);
const localVarPath = `/v3/promo/sku/{sku}`
.replace(`{${"sku"}}`, encodeURIComponent(String(sku)));
// 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 (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,
};
},
/**
* Updates or creates promotional prices for multiple specified SKUs
* @summary Updates bulk promotional prices
* @param {string} feedType Feed Type
* @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 {any} file Feed file to upload
* @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}
*/
updateBulkPromotionalPrice: async (feedType, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, file, wMCONSUMERCHANNELTYPE, options = {}) => {
// verify required parameter 'feedType' is not null or undefined
(0, common_1.assertParamExists)('updateBulkPromotionalPrice', 'feedType', feedType);
// verify required parameter 'authorization' is not null or undefined
(0, common_1.assertParamExists)('updateBulkPromotionalPrice', 'authorization', authorization);
// verify required parameter 'wMSECACCESSTOKEN' is not null or undefined
(0, common_1.assertParamExists)('updateBulkPromotionalPrice', 'wMSECACCESSTOKEN', wMSECACCESSTOKEN);
// verify required parameter 'wMQOSCORRELATIONID' is not null or undefined
(0, common_1.assertParamExists)('updateBulkPromotionalPrice', 'wMQOSCORRELATIONID', wMQOSCORRELATIONID);
// verify required parameter 'wMSVCNAME' is not null or undefined
(0, common_1.assertParamExists)('updateBulkPromotionalPrice', 'wMSVCNAME', wMSVCNAME);
// verify required parameter 'file' is not null or undefined
(0, common_1.assertParamExists)('updateBulkPromotionalPrice', 'file', file);
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 = {};
const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
// 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);
}
if (file !== undefined) {
localVarFormParams.append('file', file);
}
localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = localVarFormParams;
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Updates the promotional price. Sellers can update or delete an existing promotional price as well as set up a new promotional price. To set a new promotional price or update an existing one, set the XML pricing attribute processMode to UPSERT. To delete a promotional price, set the XML pricing attribute processMode to DELETE. To delete all promotions for a SKU, set replaceAll to an empty payload.
* @summary Update a promotional price
* @param {boolean} promo The promotional price. Set to \'true\' in order to retrieve promotional prices
* @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}
*/
updatePromotionalPrices: async (promo, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject, wMCONSUMERCHANNELTYPE, options = {}) => {
// verify required parameter 'promo' is not null or undefined
(0, common_1.assertParamExists)('updatePromotionalPrices', 'promo', promo);
// verify required parameter 'authorization' is not null or undefined
(0, common_1.assertParamExists)('updatePromotionalPrices', 'authorization', authorization);
// verify required parameter 'wMSECACCESSTOKEN' is not null or undefined
(0, common_1.assertParamExists)('updatePromotionalPrices', 'wMSECACCESSTOKEN', wMSECACCESSTOKEN);
// verify required parameter 'wMQOSCORRELATIONID' is not null or undefined
(0, common_1.assertParamExists)('updatePromotionalPrices', 'wMQOSCORRELATIONID', wMQOSCORRELATIONID);
// verify required parameter 'wMSVCNAME' is not null or undefined
(0, common_1.assertParamExists)('updatePromotionalPrices', 'wMSVCNAME', wMSVCNAME);
// verify required parameter 'inlineObject' is not null or undefined
(0, common_1.assertParamExists)('updatePromotionalPrices', 'inlineObject', inlineObject);
const localVarPath = `/v3/price`;
// 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: 'PUT', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication basicScheme required
// http basic authentication required
(0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration);
if (promo !== undefined) {
localVarQueryParameter['promo'] = promo;
}
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/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)(inlineObject, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.PromotionsApiAxiosParamCreator = PromotionsApiAxiosParamCreator;
/**
* PromotionsApi - functional programming interface
* @export
*/
const PromotionsApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.PromotionsApiAxiosParamCreator)(configuration);
return {
/**
* Retrieves a list of promotional prices for a single SKU.
* @summary Promotional prices
* @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. 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 getPromotionalPrices(sku, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPromotionalPrices(sku, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Updates or creates promotional prices for multiple specified SKUs
* @summary Updates bulk promotional prices
* @param {string} feedType Feed Type
* @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 {any} file Feed file to upload
* @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 updateBulkPromotionalPrice(feedType, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, file, wMCONSUMERCHANNELTYPE, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateBulkPromotionalPrice(feedType, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, file, wMCONSUMERCHANNELTYPE, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Updates the promotional price. Sellers can update or delete an existing promotional price as well as set up a new promotional price. To set a new promotional price or update an existing one, set the XML pricing attribute processMode to UPSERT. To delete a promotional price, set the XML pricing attribute processMode to DELETE. To delete all promotions for a SKU, set replaceAll to an empty payload.
* @summary Update a promotional price
* @param {boolean} promo The promotional price. Set to \'true\' in order to retrieve promotional prices
* @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 updatePromotionalPrices(promo, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject, wMCONSUMERCHANNELTYPE, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.updatePromotionalPrices(promo, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject, wMCONSUMERCHANNELTYPE, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.PromotionsApiFp = PromotionsApiFp;
/**
* PromotionsApi - factory interface
* @export
*/
const PromotionsApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.PromotionsApiFp)(configuration);
return {
/**
* Retrieves a list of promotional prices for a single SKU.
* @summary Promotional prices
* @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. 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}
*/
getPromotionalPrices(sku, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options) {
return localVarFp.getPromotionalPrices(sku, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options).then((request) => request(axios, basePath));
},
/**
* Updates or creates promotional prices for multiple specified SKUs
* @summary Updates bulk promotional prices
* @param {string} feedType Feed Type
* @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 {any} file Feed file to upload
* @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}
*/
updateBulkPromotionalPrice(feedType, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, file, wMCONSUMERCHANNELTYPE, options) {
return localVarFp.updateBulkPromotionalPrice(feedType, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, file, wMCONSUMERCHANNELTYPE, options).then((request) => request(axios, basePath));
},
/**
* Updates the promotional price. Sellers can update or delete an existing promotional price as well as set up a new promotional price. To set a new promotional price or update an existing one, set the XML pricing attribute processMode to UPSERT. To delete a promotional price, set the XML pricing attribute processMode to DELETE. To delete all promotions for a SKU, set replaceAll to an empty payload.
* @summary Update a promotional price
* @param {boolean} promo The promotional price. Set to \'true\' in order to retrieve promotional prices
* @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}
*/
updatePromotionalPrices(promo, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject, wMCONSUMERCHANNELTYPE, options) {
return localVarFp.updatePromotionalPrices(promo, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject, wMCONSUMERCHANNELTYPE, options).then((request) => request(axios, basePath));
},
};
};
exports.PromotionsApiFactory = PromotionsApiFactory;
/**
* PromotionsApi - object-oriented interface
* @export
* @class PromotionsApi
* @extends {BaseAPI}
*/
class PromotionsApi extends base_1.BaseAPI {
/**
* Retrieves a list of promotional prices for a single SKU.
* @summary Promotional prices
* @param {PromotionsApiGetPromotionalPricesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PromotionsApi
*/
getPromotionalPrices(requestParameters, options) {
return (0, exports.PromotionsApiFp)(this.configuration).getPromotionalPrices(requestParameters.sku, requestParameters.authorization, requestParameters.wMSECACCESSTOKEN, requestParameters.wMQOSCORRELATIONID, requestParameters.wMSVCNAME, requestParameters.wMCONSUMERCHANNELTYPE, options).then((request) => request(this.axios, this.basePath));
}
/**
* Updates or creates promotional prices for multiple specified SKUs
* @summary Updates bulk promotional prices
* @param {PromotionsApiUpdateBulkPromotionalPriceRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PromotionsApi
*/
updateBulkPromotionalPrice(requestParameters, options) {
return (0, exports.PromotionsApiFp)(this.configuration).updateBulkPromotionalPrice(requestParameters.feedType, requestParameters.authorization, requestParameters.wMSECACCESSTOKEN, requestParameters.wMQOSCORRELATIONID, requestParameters.wMSVCNAME, requestParameters.file, requestParameters.wMCONSUMERCHANNELTYPE, options).then((request) => request(this.axios, this.basePath));
}
/**
* Updates the promotional price. Sellers can update or delete an existing promotional price as well as set up a new promotional price. To set a new promotional price or update an existing one, set the XML pricing attribute processMode to UPSERT. To delete a promotional price, set the XML pricing attribute processMode to DELETE. To delete all promotions for a SKU, set replaceAll to an empty payload.
* @summary Update a promotional price
* @param {PromotionsApiUpdatePromotionalPricesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PromotionsApi
*/
updatePromotionalPrices(requestParameters, options) {
return (0, exports.PromotionsApiFp)(this.configuration).updatePromotionalPrices(requestParameters.promo, requestParameters.authorization, requestParameters.wMSECACCESSTOKEN, requestParameters.wMQOSCORRELATIONID, requestParameters.wMSVCNAME, requestParameters.inlineObject, requestParameters.wMCONSUMERCHANNELTYPE, options).then((request) => request(this.axios, this.basePath));
}
}
exports.PromotionsApi = PromotionsApi;
//# sourceMappingURL=promotion.js.map