whalecloud-dxp-api-react-native
Version:
This section explains how to use the SDK and illustrates it with an example: - This chapter is essential to learn - For specific business development, see [Bussiness Scenario](https://www.digchan.info/en-US/dxp/user-sso/sign-up) - The Business Scenario pr
184 lines (166 loc) • 9.7 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* DXP API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import type { QueryPromotionsResp } from '../models';
/**
* PromotionManagementApi - axios parameter creator
* @export
*/
export const PromotionManagementApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Query the marketing activities that the current subscriber can participate in based on subscriber ID, participation channel, and advertisement position. The API returns basic activity information, associated recommended scripts, and recommended offers.
* @summary Query Promotions
* @param {number} subsId The unique identifier for the subscriber.
* @param {string} channel Unique identifier for the channel.
* @param {string} adSlot Advertisement slot.
* @param {string} [serviceNumber] The service number associated with the subscriber.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
dxpPromotionManagementV1PromotionsGet: async (subsId: number, channel: string, adSlot: string, serviceNumber?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'subsId' is not null or undefined
assertParamExists('dxpPromotionManagementV1PromotionsGet', 'subsId', subsId)
// verify required parameter 'channel' is not null or undefined
assertParamExists('dxpPromotionManagementV1PromotionsGet', 'channel', channel)
// verify required parameter 'adSlot' is not null or undefined
assertParamExists('dxpPromotionManagementV1PromotionsGet', 'adSlot', adSlot)
const localVarPath = `/dxp/promotion-management/v1/promotions`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (subsId !== undefined) {
localVarQueryParameter['subsId'] = subsId;
}
if (serviceNumber !== undefined) {
localVarQueryParameter['serviceNumber'] = serviceNumber;
}
if (channel !== undefined) {
localVarQueryParameter['channel'] = channel;
}
if (adSlot !== undefined) {
localVarQueryParameter['adSlot'] = adSlot;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* PromotionManagementApi - functional programming interface
* @export
*/
export const PromotionManagementApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = PromotionManagementApiAxiosParamCreator(configuration)
return {
/**
* Query the marketing activities that the current subscriber can participate in based on subscriber ID, participation channel, and advertisement position. The API returns basic activity information, associated recommended scripts, and recommended offers.
* @summary Query Promotions
* @param {number} subsId The unique identifier for the subscriber.
* @param {string} channel Unique identifier for the channel.
* @param {string} adSlot Advertisement slot.
* @param {string} [serviceNumber] The service number associated with the subscriber.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async dxpPromotionManagementV1PromotionsGet(subsId: number, channel: string, adSlot: string, serviceNumber?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<QueryPromotionsResp>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.dxpPromotionManagementV1PromotionsGet(subsId, channel, adSlot, serviceNumber, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['PromotionManagementApi.dxpPromotionManagementV1PromotionsGet']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
/**
* PromotionManagementApi - factory interface
* @export
*/
export const PromotionManagementApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = PromotionManagementApiFp(configuration)
return {
/**
* Query the marketing activities that the current subscriber can participate in based on subscriber ID, participation channel, and advertisement position. The API returns basic activity information, associated recommended scripts, and recommended offers.
* @summary Query Promotions
* @param {number} subsId The unique identifier for the subscriber.
* @param {string} channel Unique identifier for the channel.
* @param {string} adSlot Advertisement slot.
* @param {string} [serviceNumber] The service number associated with the subscriber.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
dxpPromotionManagementV1PromotionsGet(subsId: number, channel: string, adSlot: string, serviceNumber?: string, options?: any): AxiosPromise<QueryPromotionsResp> {
return localVarFp.dxpPromotionManagementV1PromotionsGet(subsId, channel, adSlot, serviceNumber, options).then((request) => request(axios, basePath));
},
};
};
/**
* PromotionManagementApi - interface
* @export
* @interface PromotionManagementApi
*/
export interface PromotionManagementApiInterface {
/**
* Query the marketing activities that the current subscriber can participate in based on subscriber ID, participation channel, and advertisement position. The API returns basic activity information, associated recommended scripts, and recommended offers.
* @summary Query Promotions
* @param {number} subsId The unique identifier for the subscriber.
* @param {string} channel Unique identifier for the channel.
* @param {string} adSlot Advertisement slot.
* @param {string} [serviceNumber] The service number associated with the subscriber.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PromotionManagementApiInterface
*/
dxpPromotionManagementV1PromotionsGet(subsId: number, channel: string, adSlot: string, serviceNumber?: string, options?: RawAxiosRequestConfig): AxiosPromise<QueryPromotionsResp>;
}
/**
* PromotionManagementApi - object-oriented interface
* @export
* @class PromotionManagementApi
* @extends {BaseAPI}
*/
export class PromotionManagementApi extends BaseAPI implements PromotionManagementApiInterface {
/**
* Query the marketing activities that the current subscriber can participate in based on subscriber ID, participation channel, and advertisement position. The API returns basic activity information, associated recommended scripts, and recommended offers.
* @summary Query Promotions
* @param {number} subsId The unique identifier for the subscriber.
* @param {string} channel Unique identifier for the channel.
* @param {string} adSlot Advertisement slot.
* @param {string} [serviceNumber] The service number associated with the subscriber.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PromotionManagementApi
*/
public dxpPromotionManagementV1PromotionsGet(subsId: number, channel: string, adSlot: string, serviceNumber?: string, options?: RawAxiosRequestConfig) {
return PromotionManagementApiFp(this.configuration).dxpPromotionManagementV1PromotionsGet(subsId, channel, adSlot, serviceNumber, options).then((request) => request(this.axios, this.basePath));
}
}