/* tslint:disable */
/* eslint-disable */
/**
* Elastic Email REST API
* This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach. Every API call is established on which specific request type (GET, POST, PUT, DELETE) will be used. The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request. To start using this API, you will need your Access Token (available here). Remember to keep it safe. Required access levels are listed in the given request’s description. Downloadable library clients can be found in our Github repository here
*
* The version of the OpenAPI document: 4.0.0
* Contact: support@elasticemail.com
*
* 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 { CompressionFormat } from '../ee-api-models';
// @ts-ignore
import type { Contact } from '../ee-api-models';
// @ts-ignore
import type { ContactPayload } from '../ee-api-models';
// @ts-ignore
import type { ContactUpdatePayload } from '../ee-api-models';
// @ts-ignore
import type { EmailsPayload } from '../ee-api-models';
// @ts-ignore
import type { ExportFileFormats } from '../ee-api-models';
// @ts-ignore
import type { ExportLink } from '../ee-api-models';
// @ts-ignore
import type { ExportStatus } from '../ee-api-models';
/**
* ContactsApi - axios parameter creator
* @export
*/
export const ContactsApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Deletes the provided contact. Required Access Level: ModifyContacts
* @summary Delete Contact
* @param {string} email Proper email address.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsByEmailDelete: async (email: string, options: RawAxiosRequestConfig = {}): Promise => {
// verify required parameter 'email' is not null or undefined
assertParamExists('contactsByEmailDelete', 'email', email)
const localVarPath = `/contacts/{email}`
.replace(`{${"email"}}`, encodeURIComponent(String(email)));
// 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: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication apikey required
await setApiKeyToObject(localVarHeaderParameter, "X-ElasticEmail-ApiKey", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Load detailed contact information for specified email. Required Access Level: ViewContacts
* @summary Load Contact
* @param {string} email Proper email address.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsByEmailGet: async (email: string, options: RawAxiosRequestConfig = {}): Promise => {
// verify required parameter 'email' is not null or undefined
assertParamExists('contactsByEmailGet', 'email', email)
const localVarPath = `/contacts/{email}`
.replace(`{${"email"}}`, encodeURIComponent(String(email)));
// 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;
// authentication apikey required
await setApiKeyToObject(localVarHeaderParameter, "X-ElasticEmail-ApiKey", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Update selected contact. Omitted contact\'s fields will not be changed. Required Access Level: ModifyContacts
* @summary Update Contact
* @param {string} email Proper email address.
* @param {ContactUpdatePayload} contactUpdatePayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsByEmailPut: async (email: string, contactUpdatePayload: ContactUpdatePayload, options: RawAxiosRequestConfig = {}): Promise => {
// verify required parameter 'email' is not null or undefined
assertParamExists('contactsByEmailPut', 'email', email)
// verify required parameter 'contactUpdatePayload' is not null or undefined
assertParamExists('contactsByEmailPut', 'contactUpdatePayload', contactUpdatePayload)
const localVarPath = `/contacts/{email}`
.replace(`{${"email"}}`, encodeURIComponent(String(email)));
// 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: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication apikey required
await setApiKeyToObject(localVarHeaderParameter, "X-ElasticEmail-ApiKey", configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(contactUpdatePayload, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Deletes provided contacts in bulk. Required Access Level: ModifyContacts
* @summary Delete Contacts Bulk
* @param {EmailsPayload} emailsPayload Provide either rule or a list of emails, not both.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsDeletePost: async (emailsPayload: EmailsPayload, options: RawAxiosRequestConfig = {}): Promise => {
// verify required parameter 'emailsPayload' is not null or undefined
assertParamExists('contactsDeletePost', 'emailsPayload', emailsPayload)
const localVarPath = `/contacts/delete`;
// 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: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication apikey required
await setApiKeyToObject(localVarHeaderParameter, "X-ElasticEmail-ApiKey", configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(emailsPayload, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Check the current status of the export. Required Access Level: Export
* @summary Check Export Status
* @param {string} id ID of the exported file
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsExportByIdStatusGet: async (id: string, options: RawAxiosRequestConfig = {}): Promise => {
// verify required parameter 'id' is not null or undefined
assertParamExists('contactsExportByIdStatusGet', 'id', id)
const localVarPath = `/contacts/export/{id}/status`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// 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;
// authentication apikey required
await setApiKeyToObject(localVarHeaderParameter, "X-ElasticEmail-ApiKey", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Request an Export of specified Contacts. Required Access Level: Export
* @summary Export Contacts
* @param {ExportFileFormats} [fileFormat] Format of the exported file
* @param {string} [rule] Query used for filtering.
* @param {Array} [emails] Comma delimited list of contact emails
* @param {CompressionFormat} [compressionFormat] FileResponse compression format. None or Zip.
* @param {string} [fileName] Name of your file including extension.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsExportPost: async (fileFormat?: ExportFileFormats, rule?: string, emails?: Array, compressionFormat?: CompressionFormat, fileName?: string, options: RawAxiosRequestConfig = {}): Promise => {
const localVarPath = `/contacts/export`;
// 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: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication apikey required
await setApiKeyToObject(localVarHeaderParameter, "X-ElasticEmail-ApiKey", configuration)
if (fileFormat !== undefined) {
localVarQueryParameter['fileFormat'] = fileFormat;
}
if (rule !== undefined) {
localVarQueryParameter['rule'] = rule;
}
if (emails) {
localVarQueryParameter['emails'] = emails;
}
if (compressionFormat !== undefined) {
localVarQueryParameter['compressionFormat'] = compressionFormat;
}
if (fileName !== undefined) {
localVarQueryParameter['fileName'] = fileName;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Returns a list of contacts. Required Access Level: ViewContacts
* @summary Load Contacts
* @param {number} [limit] Maximum number of returned items.
* @param {number} [offset] How many items should be returned ahead.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsGet: async (limit?: number, offset?: number, options: RawAxiosRequestConfig = {}): Promise => {
const localVarPath = `/contacts`;
// 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;
// authentication apikey required
await setApiKeyToObject(localVarHeaderParameter, "X-ElasticEmail-ApiKey", configuration)
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (offset !== undefined) {
localVarQueryParameter['offset'] = offset;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Upload contacts from a file. Required Access Level: ModifyContacts
* @summary Upload Contacts
* @param {string} [listName] Name of an existing list to add these contacts to
* @param {string} [encodingName] In what encoding the file is uploaded
* @param {string} [fileUrl] Optional url of csv to import
* @param {File} [file]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsImportPost: async (listName?: string, encodingName?: string, fileUrl?: string, file?: File, options: RawAxiosRequestConfig = {}): Promise => {
const localVarPath = `/contacts/import`;
// 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: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
// authentication apikey required
await setApiKeyToObject(localVarHeaderParameter, "X-ElasticEmail-ApiKey", configuration)
if (listName !== undefined) {
localVarQueryParameter['listName'] = listName;
}
if (encodingName !== undefined) {
localVarQueryParameter['encodingName'] = encodingName;
}
if (fileUrl !== undefined) {
localVarQueryParameter['fileUrl'] = fileUrl;
}
if (file !== undefined) {
localVarFormParams.append('file', file as any);
}
localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = localVarFormParams;
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Add new Contacts to your Lists. Up to 1000 can be added (for more please refer to the import request). Required Access Level: ModifyContacts
* @summary Add Contact
* @param {Array} contactPayload
* @param {Array} [listnames] Names of lists to which the uploaded contacts should be added to
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsPost: async (contactPayload: Array, listnames?: Array, options: RawAxiosRequestConfig = {}): Promise => {
// verify required parameter 'contactPayload' is not null or undefined
assertParamExists('contactsPost', 'contactPayload', contactPayload)
const localVarPath = `/contacts`;
// 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: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication apikey required
await setApiKeyToObject(localVarHeaderParameter, "X-ElasticEmail-ApiKey", configuration)
if (listnames) {
localVarQueryParameter['listnames'] = listnames;
}
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(contactPayload, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* ContactsApi - functional programming interface
* @export
*/
export const ContactsApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = ContactsApiAxiosParamCreator(configuration)
return {
/**
* Deletes the provided contact. Required Access Level: ModifyContacts
* @summary Delete Contact
* @param {string} email Proper email address.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async contactsByEmailDelete(email: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
const localVarAxiosArgs = await localVarAxiosParamCreator.contactsByEmailDelete(email, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ContactsApi.contactsByEmailDelete']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Load detailed contact information for specified email. Required Access Level: ViewContacts
* @summary Load Contact
* @param {string} email Proper email address.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async contactsByEmailGet(email: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
const localVarAxiosArgs = await localVarAxiosParamCreator.contactsByEmailGet(email, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ContactsApi.contactsByEmailGet']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Update selected contact. Omitted contact\'s fields will not be changed. Required Access Level: ModifyContacts
* @summary Update Contact
* @param {string} email Proper email address.
* @param {ContactUpdatePayload} contactUpdatePayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async contactsByEmailPut(email: string, contactUpdatePayload: ContactUpdatePayload, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
const localVarAxiosArgs = await localVarAxiosParamCreator.contactsByEmailPut(email, contactUpdatePayload, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ContactsApi.contactsByEmailPut']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Deletes provided contacts in bulk. Required Access Level: ModifyContacts
* @summary Delete Contacts Bulk
* @param {EmailsPayload} emailsPayload Provide either rule or a list of emails, not both.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async contactsDeletePost(emailsPayload: EmailsPayload, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
const localVarAxiosArgs = await localVarAxiosParamCreator.contactsDeletePost(emailsPayload, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ContactsApi.contactsDeletePost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Check the current status of the export. Required Access Level: Export
* @summary Check Export Status
* @param {string} id ID of the exported file
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async contactsExportByIdStatusGet(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
const localVarAxiosArgs = await localVarAxiosParamCreator.contactsExportByIdStatusGet(id, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ContactsApi.contactsExportByIdStatusGet']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Request an Export of specified Contacts. Required Access Level: Export
* @summary Export Contacts
* @param {ExportFileFormats} [fileFormat] Format of the exported file
* @param {string} [rule] Query used for filtering.
* @param {Array} [emails] Comma delimited list of contact emails
* @param {CompressionFormat} [compressionFormat] FileResponse compression format. None or Zip.
* @param {string} [fileName] Name of your file including extension.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async contactsExportPost(fileFormat?: ExportFileFormats, rule?: string, emails?: Array, compressionFormat?: CompressionFormat, fileName?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
const localVarAxiosArgs = await localVarAxiosParamCreator.contactsExportPost(fileFormat, rule, emails, compressionFormat, fileName, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ContactsApi.contactsExportPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Returns a list of contacts. Required Access Level: ViewContacts
* @summary Load Contacts
* @param {number} [limit] Maximum number of returned items.
* @param {number} [offset] How many items should be returned ahead.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async contactsGet(limit?: number, offset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.contactsGet(limit, offset, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ContactsApi.contactsGet']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Upload contacts from a file. Required Access Level: ModifyContacts
* @summary Upload Contacts
* @param {string} [listName] Name of an existing list to add these contacts to
* @param {string} [encodingName] In what encoding the file is uploaded
* @param {string} [fileUrl] Optional url of csv to import
* @param {File} [file]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async contactsImportPost(listName?: string, encodingName?: string, fileUrl?: string, file?: File, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
const localVarAxiosArgs = await localVarAxiosParamCreator.contactsImportPost(listName, encodingName, fileUrl, file, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ContactsApi.contactsImportPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Add new Contacts to your Lists. Up to 1000 can be added (for more please refer to the import request). Required Access Level: ModifyContacts
* @summary Add Contact
* @param {Array} contactPayload
* @param {Array} [listnames] Names of lists to which the uploaded contacts should be added to
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async contactsPost(contactPayload: Array, listnames?: Array, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.contactsPost(contactPayload, listnames, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ContactsApi.contactsPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
/**
* ContactsApi - factory interface
* @export
*/
export const ContactsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = ContactsApiFp(configuration)
return {
/**
* Deletes the provided contact. Required Access Level: ModifyContacts
* @summary Delete Contact
* @param {string} email Proper email address.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsByEmailDelete(email: string, options?: RawAxiosRequestConfig): AxiosPromise {
return localVarFp.contactsByEmailDelete(email, options).then((request) => request(axios, basePath));
},
/**
* Load detailed contact information for specified email. Required Access Level: ViewContacts
* @summary Load Contact
* @param {string} email Proper email address.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsByEmailGet(email: string, options?: RawAxiosRequestConfig): AxiosPromise {
return localVarFp.contactsByEmailGet(email, options).then((request) => request(axios, basePath));
},
/**
* Update selected contact. Omitted contact\'s fields will not be changed. Required Access Level: ModifyContacts
* @summary Update Contact
* @param {string} email Proper email address.
* @param {ContactUpdatePayload} contactUpdatePayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsByEmailPut(email: string, contactUpdatePayload: ContactUpdatePayload, options?: RawAxiosRequestConfig): AxiosPromise {
return localVarFp.contactsByEmailPut(email, contactUpdatePayload, options).then((request) => request(axios, basePath));
},
/**
* Deletes provided contacts in bulk. Required Access Level: ModifyContacts
* @summary Delete Contacts Bulk
* @param {EmailsPayload} emailsPayload Provide either rule or a list of emails, not both.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsDeletePost(emailsPayload: EmailsPayload, options?: RawAxiosRequestConfig): AxiosPromise {
return localVarFp.contactsDeletePost(emailsPayload, options).then((request) => request(axios, basePath));
},
/**
* Check the current status of the export. Required Access Level: Export
* @summary Check Export Status
* @param {string} id ID of the exported file
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsExportByIdStatusGet(id: string, options?: RawAxiosRequestConfig): AxiosPromise {
return localVarFp.contactsExportByIdStatusGet(id, options).then((request) => request(axios, basePath));
},
/**
* Request an Export of specified Contacts. Required Access Level: Export
* @summary Export Contacts
* @param {ExportFileFormats} [fileFormat] Format of the exported file
* @param {string} [rule] Query used for filtering.
* @param {Array} [emails] Comma delimited list of contact emails
* @param {CompressionFormat} [compressionFormat] FileResponse compression format. None or Zip.
* @param {string} [fileName] Name of your file including extension.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsExportPost(fileFormat?: ExportFileFormats, rule?: string, emails?: Array, compressionFormat?: CompressionFormat, fileName?: string, options?: RawAxiosRequestConfig): AxiosPromise {
return localVarFp.contactsExportPost(fileFormat, rule, emails, compressionFormat, fileName, options).then((request) => request(axios, basePath));
},
/**
* Returns a list of contacts. Required Access Level: ViewContacts
* @summary Load Contacts
* @param {number} [limit] Maximum number of returned items.
* @param {number} [offset] How many items should be returned ahead.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsGet(limit?: number, offset?: number, options?: RawAxiosRequestConfig): AxiosPromise> {
return localVarFp.contactsGet(limit, offset, options).then((request) => request(axios, basePath));
},
/**
* Upload contacts from a file. Required Access Level: ModifyContacts
* @summary Upload Contacts
* @param {string} [listName] Name of an existing list to add these contacts to
* @param {string} [encodingName] In what encoding the file is uploaded
* @param {string} [fileUrl] Optional url of csv to import
* @param {File} [file]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsImportPost(listName?: string, encodingName?: string, fileUrl?: string, file?: File, options?: RawAxiosRequestConfig): AxiosPromise {
return localVarFp.contactsImportPost(listName, encodingName, fileUrl, file, options).then((request) => request(axios, basePath));
},
/**
* Add new Contacts to your Lists. Up to 1000 can be added (for more please refer to the import request). Required Access Level: ModifyContacts
* @summary Add Contact
* @param {Array} contactPayload
* @param {Array} [listnames] Names of lists to which the uploaded contacts should be added to
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
contactsPost(contactPayload: Array, listnames?: Array, options?: RawAxiosRequestConfig): AxiosPromise> {
return localVarFp.contactsPost(contactPayload, listnames, options).then((request) => request(axios, basePath));
},
};
};
/**
* ContactsApi - interface
* @export
* @interface ContactsApi
*/
export interface ContactsApiInterface {
/**
* Deletes the provided contact. Required Access Level: ModifyContacts
* @summary Delete Contact
* @param {string} email Proper email address.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApiInterface
*/
contactsByEmailDelete(email: string, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Load detailed contact information for specified email. Required Access Level: ViewContacts
* @summary Load Contact
* @param {string} email Proper email address.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApiInterface
*/
contactsByEmailGet(email: string, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Update selected contact. Omitted contact\'s fields will not be changed. Required Access Level: ModifyContacts
* @summary Update Contact
* @param {string} email Proper email address.
* @param {ContactUpdatePayload} contactUpdatePayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApiInterface
*/
contactsByEmailPut(email: string, contactUpdatePayload: ContactUpdatePayload, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Deletes provided contacts in bulk. Required Access Level: ModifyContacts
* @summary Delete Contacts Bulk
* @param {EmailsPayload} emailsPayload Provide either rule or a list of emails, not both.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApiInterface
*/
contactsDeletePost(emailsPayload: EmailsPayload, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Check the current status of the export. Required Access Level: Export
* @summary Check Export Status
* @param {string} id ID of the exported file
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApiInterface
*/
contactsExportByIdStatusGet(id: string, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Request an Export of specified Contacts. Required Access Level: Export
* @summary Export Contacts
* @param {ExportFileFormats} [fileFormat] Format of the exported file
* @param {string} [rule] Query used for filtering.
* @param {Array} [emails] Comma delimited list of contact emails
* @param {CompressionFormat} [compressionFormat] FileResponse compression format. None or Zip.
* @param {string} [fileName] Name of your file including extension.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApiInterface
*/
contactsExportPost(fileFormat?: ExportFileFormats, rule?: string, emails?: Array, compressionFormat?: CompressionFormat, fileName?: string, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Returns a list of contacts. Required Access Level: ViewContacts
* @summary Load Contacts
* @param {number} [limit] Maximum number of returned items.
* @param {number} [offset] How many items should be returned ahead.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApiInterface
*/
contactsGet(limit?: number, offset?: number, options?: RawAxiosRequestConfig): AxiosPromise>;
/**
* Upload contacts from a file. Required Access Level: ModifyContacts
* @summary Upload Contacts
* @param {string} [listName] Name of an existing list to add these contacts to
* @param {string} [encodingName] In what encoding the file is uploaded
* @param {string} [fileUrl] Optional url of csv to import
* @param {File} [file]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApiInterface
*/
contactsImportPost(listName?: string, encodingName?: string, fileUrl?: string, file?: File, options?: RawAxiosRequestConfig): AxiosPromise;
/**
* Add new Contacts to your Lists. Up to 1000 can be added (for more please refer to the import request). Required Access Level: ModifyContacts
* @summary Add Contact
* @param {Array} contactPayload
* @param {Array} [listnames] Names of lists to which the uploaded contacts should be added to
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApiInterface
*/
contactsPost(contactPayload: Array, listnames?: Array, options?: RawAxiosRequestConfig): AxiosPromise>;
}
/**
* ContactsApi - object-oriented interface
* @export
* @class ContactsApi
* @extends {BaseAPI}
*/
export class ContactsApi extends BaseAPI implements ContactsApiInterface {
/**
* Deletes the provided contact. Required Access Level: ModifyContacts
* @summary Delete Contact
* @param {string} email Proper email address.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApi
*/
public contactsByEmailDelete(email: string, options?: RawAxiosRequestConfig) {
return ContactsApiFp(this.configuration).contactsByEmailDelete(email, options).then((request) => request(this.axios, this.basePath));
}
/**
* Load detailed contact information for specified email. Required Access Level: ViewContacts
* @summary Load Contact
* @param {string} email Proper email address.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApi
*/
public contactsByEmailGet(email: string, options?: RawAxiosRequestConfig) {
return ContactsApiFp(this.configuration).contactsByEmailGet(email, options).then((request) => request(this.axios, this.basePath));
}
/**
* Update selected contact. Omitted contact\'s fields will not be changed. Required Access Level: ModifyContacts
* @summary Update Contact
* @param {string} email Proper email address.
* @param {ContactUpdatePayload} contactUpdatePayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApi
*/
public contactsByEmailPut(email: string, contactUpdatePayload: ContactUpdatePayload, options?: RawAxiosRequestConfig) {
return ContactsApiFp(this.configuration).contactsByEmailPut(email, contactUpdatePayload, options).then((request) => request(this.axios, this.basePath));
}
/**
* Deletes provided contacts in bulk. Required Access Level: ModifyContacts
* @summary Delete Contacts Bulk
* @param {EmailsPayload} emailsPayload Provide either rule or a list of emails, not both.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApi
*/
public contactsDeletePost(emailsPayload: EmailsPayload, options?: RawAxiosRequestConfig) {
return ContactsApiFp(this.configuration).contactsDeletePost(emailsPayload, options).then((request) => request(this.axios, this.basePath));
}
/**
* Check the current status of the export. Required Access Level: Export
* @summary Check Export Status
* @param {string} id ID of the exported file
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApi
*/
public contactsExportByIdStatusGet(id: string, options?: RawAxiosRequestConfig) {
return ContactsApiFp(this.configuration).contactsExportByIdStatusGet(id, options).then((request) => request(this.axios, this.basePath));
}
/**
* Request an Export of specified Contacts. Required Access Level: Export
* @summary Export Contacts
* @param {ExportFileFormats} [fileFormat] Format of the exported file
* @param {string} [rule] Query used for filtering.
* @param {Array} [emails] Comma delimited list of contact emails
* @param {CompressionFormat} [compressionFormat] FileResponse compression format. None or Zip.
* @param {string} [fileName] Name of your file including extension.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApi
*/
public contactsExportPost(fileFormat?: ExportFileFormats, rule?: string, emails?: Array, compressionFormat?: CompressionFormat, fileName?: string, options?: RawAxiosRequestConfig) {
return ContactsApiFp(this.configuration).contactsExportPost(fileFormat, rule, emails, compressionFormat, fileName, options).then((request) => request(this.axios, this.basePath));
}
/**
* Returns a list of contacts. Required Access Level: ViewContacts
* @summary Load Contacts
* @param {number} [limit] Maximum number of returned items.
* @param {number} [offset] How many items should be returned ahead.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApi
*/
public contactsGet(limit?: number, offset?: number, options?: RawAxiosRequestConfig) {
return ContactsApiFp(this.configuration).contactsGet(limit, offset, options).then((request) => request(this.axios, this.basePath));
}
/**
* Upload contacts from a file. Required Access Level: ModifyContacts
* @summary Upload Contacts
* @param {string} [listName] Name of an existing list to add these contacts to
* @param {string} [encodingName] In what encoding the file is uploaded
* @param {string} [fileUrl] Optional url of csv to import
* @param {File} [file]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApi
*/
public contactsImportPost(listName?: string, encodingName?: string, fileUrl?: string, file?: File, options?: RawAxiosRequestConfig) {
return ContactsApiFp(this.configuration).contactsImportPost(listName, encodingName, fileUrl, file, options).then((request) => request(this.axios, this.basePath));
}
/**
* Add new Contacts to your Lists. Up to 1000 can be added (for more please refer to the import request). Required Access Level: ModifyContacts
* @summary Add Contact
* @param {Array} contactPayload
* @param {Array} [listnames] Names of lists to which the uploaded contacts should be added to
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ContactsApi
*/
public contactsPost(contactPayload: Array, listnames?: Array, options?: RawAxiosRequestConfig) {
return ContactsApiFp(this.configuration).contactsPost(contactPayload, listnames, options).then((request) => request(this.axios, this.basePath));
}
}