UNPKG

@whitebox-co/walmart-marketplace-api

Version:

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

586 lines 60.5 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Notifications Management * Notifications Management API * * 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.NotificationsApi = exports.NotificationsApiFactory = exports.NotificationsApiFp = exports.NotificationsApiAxiosParamCreator = 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"); /** * NotificationsApi - axios parameter creator * @export */ const NotificationsApiAxiosParamCreator = function (configuration) { return { /** * This API is used to create subscription for notification of an event by selecting an event type, event version, resource name, and providing event URL. One or more than one events can be subscribed for notifications in one subscription request. Use Get Event Types API to get the list of event type, event version and resource name available for subscribing. Configure an event URL to receive the notifications. URL Authentication Options If authMethod is BASIC_AUTH, while making notification request to endpointUrl, Walmart system will pass authentication header with key as authHeaderName and value as BASE64 encoding of userName and password. If authMethod is HMAC, while making notification request to endpointUrl, Walmart system will pass authentication header with key as authHeaderName and value as HMACSHA256 of complete response, using clientSecret as key. If authMethod is OAUTH, Walmart system will make POST call to authUrl to generate token with request body as \"grant_type=client_credentials\" and headers as : Authorization header with key as authHeaderName and value as BASE64 encoding of clientId and clientSecret \"Accept\" :\"application/json; charset=UTF-8\" \"Content-type\":\"application/x-www-form-urlencoded; charset=ISO-8859-1\" Custom headers provided in headers field , if provided authURL should return HTTPS status 200 and response should have access_token and expires_in field. While making notification request to endpointUrl, Walmart system will pass access_token in headers with authHeaderName as key and value as Bearer <access_token> along with any other custom headers provided in headers field. * @summary Create subscription * @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 {InlineObject1} inlineObject1 * @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} */ createSubscription: async (authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject1, wMCONSUMERCHANNELTYPE, options = {}) => { // verify required parameter 'authorization' is not null or undefined (0, common_1.assertParamExists)('createSubscription', 'authorization', authorization); // verify required parameter 'wMSECACCESSTOKEN' is not null or undefined (0, common_1.assertParamExists)('createSubscription', 'wMSECACCESSTOKEN', wMSECACCESSTOKEN); // verify required parameter 'wMQOSCORRELATIONID' is not null or undefined (0, common_1.assertParamExists)('createSubscription', 'wMQOSCORRELATIONID', wMQOSCORRELATIONID); // verify required parameter 'wMSVCNAME' is not null or undefined (0, common_1.assertParamExists)('createSubscription', 'wMSVCNAME', wMSVCNAME); // verify required parameter 'inlineObject1' is not null or undefined (0, common_1.assertParamExists)('createSubscription', 'inlineObject1', inlineObject1); const localVarPath = `/v3/webhooks/subscriptions`; // 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 (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)(inlineObject1, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This API is used to delete the subscription. Once deleted, the subscription cannot be retrieved. * @summary Delete Subscription * @param {string} subscriptionId Unique ID for the subscription * @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} */ deleteSubscription: async (subscriptionId, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options = {}) => { // verify required parameter 'subscriptionId' is not null or undefined (0, common_1.assertParamExists)('deleteSubscription', 'subscriptionId', subscriptionId); // verify required parameter 'authorization' is not null or undefined (0, common_1.assertParamExists)('deleteSubscription', 'authorization', authorization); // verify required parameter 'wMSECACCESSTOKEN' is not null or undefined (0, common_1.assertParamExists)('deleteSubscription', 'wMSECACCESSTOKEN', wMSECACCESSTOKEN); // verify required parameter 'wMQOSCORRELATIONID' is not null or undefined (0, common_1.assertParamExists)('deleteSubscription', 'wMQOSCORRELATIONID', wMQOSCORRELATIONID); // verify required parameter 'wMSVCNAME' is not null or undefined (0, common_1.assertParamExists)('deleteSubscription', 'wMSVCNAME', wMSVCNAME); const localVarPath = `/v3/webhooks/subscriptions/{subscriptionId}` .replace(`{${"subscriptionId"}}`, encodeURIComponent(String(subscriptionId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // 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, }; }, /** * This API is used to retrieve the details of all subscriptions created using \"create subscription\" API. * @summary All subscriptions * @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} [subscriptionId] Use this to get details of a specific subscription * @param {string} [eventType] Use this to get list of all subscriptions for a specific event type. Refer to Events section for list of available eventType. * @param {string} [resourceName] Use this to get list of all subscriptions for a specific resource. Refer to Events section for list of available resourceName. * @param {string} [status] Use this to get list of all subscriptions in ACTIVE or INACTIVE status * @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} */ getAllSubscriptions: async (authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, subscriptionId, eventType, resourceName, status, wMCONSUMERCHANNELTYPE, options = {}) => { // verify required parameter 'authorization' is not null or undefined (0, common_1.assertParamExists)('getAllSubscriptions', 'authorization', authorization); // verify required parameter 'wMSECACCESSTOKEN' is not null or undefined (0, common_1.assertParamExists)('getAllSubscriptions', 'wMSECACCESSTOKEN', wMSECACCESSTOKEN); // verify required parameter 'wMQOSCORRELATIONID' is not null or undefined (0, common_1.assertParamExists)('getAllSubscriptions', 'wMQOSCORRELATIONID', wMQOSCORRELATIONID); // verify required parameter 'wMSVCNAME' is not null or undefined (0, common_1.assertParamExists)('getAllSubscriptions', 'wMSVCNAME', wMSVCNAME); const localVarPath = `/v3/webhooks/subscriptions`; // 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 (subscriptionId !== undefined) { localVarQueryParameter['subscriptionId'] = subscriptionId; } if (eventType !== undefined) { localVarQueryParameter['eventType'] = eventType; } if (resourceName !== undefined) { localVarQueryParameter['resourceName'] = resourceName; } if (status !== undefined) { localVarQueryParameter['status'] = status; } 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 provides the list of event types and resource names that you can subscribe to. Notifications will be triggered only for the event types that you subscribe to using Create Subscription API . Event Types are workflow events that are triggered when status or conditions change. Some examples are an offer moving from published to unpublished status, an order getting auto-cancelled by Walmart, a buy box price/winner change, etc. Resource Names are functional API categories that group similar event types. Resource Names can be Item, Price, Orders, Inventory, etc. The permissions to subscribe to an Event Type is defined by Resource Name which is mapped to permissions in Delegated Access. * @summary Event Types * @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} */ getEventTypes: async (authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options = {}) => { // verify required parameter 'authorization' is not null or undefined (0, common_1.assertParamExists)('getEventTypes', 'authorization', authorization); // verify required parameter 'wMSECACCESSTOKEN' is not null or undefined (0, common_1.assertParamExists)('getEventTypes', 'wMSECACCESSTOKEN', wMSECACCESSTOKEN); // verify required parameter 'wMQOSCORRELATIONID' is not null or undefined (0, common_1.assertParamExists)('getEventTypes', 'wMQOSCORRELATIONID', wMQOSCORRELATIONID); // verify required parameter 'wMSVCNAME' is not null or undefined (0, common_1.assertParamExists)('getEventTypes', 'wMSVCNAME', wMSVCNAME); const localVarPath = `/v3/webhooks/eventTypes`; // 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, }; }, /** * This API can be used to send a test notification to the destination URL with the sample payload. * @summary Test Notification * @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} */ testNotification: async (authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject, wMCONSUMERCHANNELTYPE, options = {}) => { // verify required parameter 'authorization' is not null or undefined (0, common_1.assertParamExists)('testNotification', 'authorization', authorization); // verify required parameter 'wMSECACCESSTOKEN' is not null or undefined (0, common_1.assertParamExists)('testNotification', 'wMSECACCESSTOKEN', wMSECACCESSTOKEN); // verify required parameter 'wMQOSCORRELATIONID' is not null or undefined (0, common_1.assertParamExists)('testNotification', 'wMQOSCORRELATIONID', wMQOSCORRELATIONID); // verify required parameter 'wMSVCNAME' is not null or undefined (0, common_1.assertParamExists)('testNotification', 'wMSVCNAME', wMSVCNAME); // verify required parameter 'inlineObject' is not null or undefined (0, common_1.assertParamExists)('testNotification', 'inlineObject', inlineObject); const localVarPath = `/v3/webhooks/test`; // 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 (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, }; }, /** * This API is used to update the details of subscriptions. You can update event version, event URL, headers, authentication details of a subscription using this API. You can also disable/enable the subscription by changing the status from ACTIVE to INACTIVE or vice versa . * @summary Update Subscription * @param {string} subscriptionId Unique ID for the subscription * @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 {InlineObject2} inlineObject2 * @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} */ updateSubscription: async (subscriptionId, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject2, wMCONSUMERCHANNELTYPE, options = {}) => { // verify required parameter 'subscriptionId' is not null or undefined (0, common_1.assertParamExists)('updateSubscription', 'subscriptionId', subscriptionId); // verify required parameter 'authorization' is not null or undefined (0, common_1.assertParamExists)('updateSubscription', 'authorization', authorization); // verify required parameter 'wMSECACCESSTOKEN' is not null or undefined (0, common_1.assertParamExists)('updateSubscription', 'wMSECACCESSTOKEN', wMSECACCESSTOKEN); // verify required parameter 'wMQOSCORRELATIONID' is not null or undefined (0, common_1.assertParamExists)('updateSubscription', 'wMQOSCORRELATIONID', wMQOSCORRELATIONID); // verify required parameter 'wMSVCNAME' is not null or undefined (0, common_1.assertParamExists)('updateSubscription', 'wMSVCNAME', wMSVCNAME); // verify required parameter 'inlineObject2' is not null or undefined (0, common_1.assertParamExists)('updateSubscription', 'inlineObject2', inlineObject2); const localVarPath = `/v3/webhooks/subscriptions/{subscriptionId}` .replace(`{${"subscriptionId"}}`, encodeURIComponent(String(subscriptionId))); // 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: 'PATCH', ...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); } 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)(inlineObject2, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.NotificationsApiAxiosParamCreator = NotificationsApiAxiosParamCreator; /** * NotificationsApi - functional programming interface * @export */ const NotificationsApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.NotificationsApiAxiosParamCreator)(configuration); return { /** * This API is used to create subscription for notification of an event by selecting an event type, event version, resource name, and providing event URL. One or more than one events can be subscribed for notifications in one subscription request. Use Get Event Types API to get the list of event type, event version and resource name available for subscribing. Configure an event URL to receive the notifications. URL Authentication Options If authMethod is BASIC_AUTH, while making notification request to endpointUrl, Walmart system will pass authentication header with key as authHeaderName and value as BASE64 encoding of userName and password. If authMethod is HMAC, while making notification request to endpointUrl, Walmart system will pass authentication header with key as authHeaderName and value as HMACSHA256 of complete response, using clientSecret as key. If authMethod is OAUTH, Walmart system will make POST call to authUrl to generate token with request body as \"grant_type=client_credentials\" and headers as : Authorization header with key as authHeaderName and value as BASE64 encoding of clientId and clientSecret \"Accept\" :\"application/json; charset=UTF-8\" \"Content-type\":\"application/x-www-form-urlencoded; charset=ISO-8859-1\" Custom headers provided in headers field , if provided authURL should return HTTPS status 200 and response should have access_token and expires_in field. While making notification request to endpointUrl, Walmart system will pass access_token in headers with authHeaderName as key and value as Bearer <access_token> along with any other custom headers provided in headers field. * @summary Create subscription * @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 {InlineObject1} inlineObject1 * @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 createSubscription(authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject1, wMCONSUMERCHANNELTYPE, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.createSubscription(authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject1, wMCONSUMERCHANNELTYPE, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * This API is used to delete the subscription. Once deleted, the subscription cannot be retrieved. * @summary Delete Subscription * @param {string} subscriptionId Unique ID for the subscription * @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 deleteSubscription(subscriptionId, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteSubscription(subscriptionId, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * This API is used to retrieve the details of all subscriptions created using \"create subscription\" API. * @summary All subscriptions * @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} [subscriptionId] Use this to get details of a specific subscription * @param {string} [eventType] Use this to get list of all subscriptions for a specific event type. Refer to Events section for list of available eventType. * @param {string} [resourceName] Use this to get list of all subscriptions for a specific resource. Refer to Events section for list of available resourceName. * @param {string} [status] Use this to get list of all subscriptions in ACTIVE or INACTIVE status * @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 getAllSubscriptions(authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, subscriptionId, eventType, resourceName, status, wMCONSUMERCHANNELTYPE, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getAllSubscriptions(authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, subscriptionId, eventType, resourceName, status, wMCONSUMERCHANNELTYPE, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * This API provides the list of event types and resource names that you can subscribe to. Notifications will be triggered only for the event types that you subscribe to using Create Subscription API . Event Types are workflow events that are triggered when status or conditions change. Some examples are an offer moving from published to unpublished status, an order getting auto-cancelled by Walmart, a buy box price/winner change, etc. Resource Names are functional API categories that group similar event types. Resource Names can be Item, Price, Orders, Inventory, etc. The permissions to subscribe to an Event Type is defined by Resource Name which is mapped to permissions in Delegated Access. * @summary Event Types * @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 getEventTypes(authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getEventTypes(authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * This API can be used to send a test notification to the destination URL with the sample payload. * @summary Test Notification * @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 testNotification(authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject, wMCONSUMERCHANNELTYPE, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.testNotification(authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject, wMCONSUMERCHANNELTYPE, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * This API is used to update the details of subscriptions. You can update event version, event URL, headers, authentication details of a subscription using this API. You can also disable/enable the subscription by changing the status from ACTIVE to INACTIVE or vice versa . * @summary Update Subscription * @param {string} subscriptionId Unique ID for the subscription * @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 {InlineObject2} inlineObject2 * @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 updateSubscription(subscriptionId, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject2, wMCONSUMERCHANNELTYPE, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateSubscription(subscriptionId, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject2, wMCONSUMERCHANNELTYPE, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, }; }; exports.NotificationsApiFp = NotificationsApiFp; /** * NotificationsApi - factory interface * @export */ const NotificationsApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.NotificationsApiFp)(configuration); return { /** * This API is used to create subscription for notification of an event by selecting an event type, event version, resource name, and providing event URL. One or more than one events can be subscribed for notifications in one subscription request. Use Get Event Types API to get the list of event type, event version and resource name available for subscribing. Configure an event URL to receive the notifications. URL Authentication Options If authMethod is BASIC_AUTH, while making notification request to endpointUrl, Walmart system will pass authentication header with key as authHeaderName and value as BASE64 encoding of userName and password. If authMethod is HMAC, while making notification request to endpointUrl, Walmart system will pass authentication header with key as authHeaderName and value as HMACSHA256 of complete response, using clientSecret as key. If authMethod is OAUTH, Walmart system will make POST call to authUrl to generate token with request body as \"grant_type=client_credentials\" and headers as : Authorization header with key as authHeaderName and value as BASE64 encoding of clientId and clientSecret \"Accept\" :\"application/json; charset=UTF-8\" \"Content-type\":\"application/x-www-form-urlencoded; charset=ISO-8859-1\" Custom headers provided in headers field , if provided authURL should return HTTPS status 200 and response should have access_token and expires_in field. While making notification request to endpointUrl, Walmart system will pass access_token in headers with authHeaderName as key and value as Bearer <access_token> along with any other custom headers provided in headers field. * @summary Create subscription * @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 {InlineObject1} inlineObject1 * @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} */ createSubscription(authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject1, wMCONSUMERCHANNELTYPE, options) { return localVarFp.createSubscription(authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, inlineObject1, wMCONSUMERCHANNELTYPE, options).then((request) => request(axios, basePath)); }, /** * This API is used to delete the subscription. Once deleted, the subscription cannot be retrieved. * @summary Delete Subscription * @param {string} subscriptionId Unique ID for the subscription * @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} */ deleteSubscription(subscriptionId, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options) { return localVarFp.deleteSubscription(subscriptionId, authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options).then((request) => request(axios, basePath)); }, /** * This API is used to retrieve the details of all subscriptions created using \"create subscription\" API. * @summary All subscriptions * @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} [subscriptionId] Use this to get details of a specific subscription * @param {string} [eventType] Use this to get list of all subscriptions for a specific event type. Refer to Events section for list of available eventType. * @param {string} [resourceName] Use this to get list of all subscriptions for a specific resource. Refer to Events section for list of available resourceName. * @param {string} [status] Use this to get list of all subscriptions in ACTIVE or INACTIVE status * @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} */ getAllSubscriptions(authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, subscriptionId, eventType, resourceName, status, wMCONSUMERCHANNELTYPE, options) { return localVarFp.getAllSubscriptions(authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, subscriptionId, eventType, resourceName, status, wMCONSUMERCHANNELTYPE, options).then((request) => request(axios, basePath)); }, /** * This API provides the list of event types and resource names that you can subscribe to. Notifications will be triggered only for the event types that you subscribe to using Create Subscription API . Event Types are workflow events that are triggered when status or conditions change. Some examples are an offer moving from published to unpublished status, an order getting auto-cancelled by Walmart, a buy box price/winner change, etc. Resource Names are functional API categories that group similar event types. Resource Names can be Item, Price, Orders, Inventory, etc. The permissions to subscribe to an Event Type is defined by Resource Name which is mapped to permissions in Delegated Access. * @summary Event Types * @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} */ getEventTypes(authorization, wMSECACCESSTOKEN, wMQOSCORRELATIONID, wMSVCNAME, wMCONSUMERCHANNELTYPE, options) { return localV