@elasticemail/elasticemail-client-ts-axios
Version:
Official ElasticEmail SDK. This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach.
942 lines (846 loc) • 47.6 kB
text/typescript
/* 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 <a target=\"_blank\" href=\"https://app.elasticemail.com/marketing/settings/new/manage-api\">here</a>). 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 <a target=\"_blank\" href=\"https://github.com/ElasticEmail?tab=repositories&q=%22rest+api%22+in%3Areadme\">here</a>
*
* 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, AxiosRequestConfig } 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, RequestArgs, BaseAPI, RequiredError } from '../base';
// @ts-ignore
import { ApiKey } from '../ee-api-models';
// @ts-ignore
import { ApiKeyPayload } from '../ee-api-models';
// @ts-ignore
import { NewApiKey } from '../ee-api-models';
// @ts-ignore
import { NewSmtpCredentials } from '../ee-api-models';
// @ts-ignore
import { SmtpCredentials } from '../ee-api-models';
// @ts-ignore
import { SmtpCredentialsPayload } from '../ee-api-models';
/**
* SecurityApi - axios parameter creator
* @export
*/
export const SecurityApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Delete your existing ApiKey. Required Access Level: Security
* @summary Delete ApiKey
* @param {string} name Name of the ApiKey
* @param {string} [subaccount] Email of the subaccount of which ApiKey should be deleted
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securityApikeysByNameDelete: async (name: string, subaccount?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('securityApikeysByNameDelete', 'name', name)
const localVarPath = `/security/apikeys/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// 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)
if (subaccount !== undefined) {
localVarQueryParameter['subaccount'] = subaccount;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Load your existing ApiKey info. Required Access Level: Security
* @summary Load ApiKey
* @param {string} name Name of the ApiKey
* @param {string} [subaccount] Email of the subaccount of which ApiKey should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securityApikeysByNameGet: async (name: string, subaccount?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('securityApikeysByNameGet', 'name', name)
const localVarPath = `/security/apikeys/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// 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 (subaccount !== undefined) {
localVarQueryParameter['subaccount'] = subaccount;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Update your existing ApiKey. Required Access Level: Security
* @summary Update ApiKey
* @param {string} name Name of the ApiKey
* @param {ApiKeyPayload} apiKeyPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securityApikeysByNamePut: async (name: string, apiKeyPayload: ApiKeyPayload, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('securityApikeysByNamePut', 'name', name)
// verify required parameter 'apiKeyPayload' is not null or undefined
assertParamExists('securityApikeysByNamePut', 'apiKeyPayload', apiKeyPayload)
const localVarPath = `/security/apikeys/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// 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(apiKeyPayload, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* List all your existing ApiKeys. Required Access Level: Security
* @summary List ApiKeys
* @param {string} [subaccount] Email of the subaccount of which ApiKeys should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securityApikeysGet: async (subaccount?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/security/apikeys`;
// 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 (subaccount !== undefined) {
localVarQueryParameter['subaccount'] = subaccount;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Add a new ApiKey. Required Access Level: Security
* @summary Add ApiKey
* @param {ApiKeyPayload} apiKeyPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securityApikeysPost: async (apiKeyPayload: ApiKeyPayload, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'apiKeyPayload' is not null or undefined
assertParamExists('securityApikeysPost', 'apiKeyPayload', apiKeyPayload)
const localVarPath = `/security/apikeys`;
// 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(apiKeyPayload, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Delete your existing SMTP Credentials. Required Access Level: Security
* @summary Delete SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {string} [subaccount] Email of the subaccount of which credential should be deleted
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securitySmtpByNameDelete: async (name: string, subaccount?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('securitySmtpByNameDelete', 'name', name)
const localVarPath = `/security/smtp/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// 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)
if (subaccount !== undefined) {
localVarQueryParameter['subaccount'] = subaccount;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Load your existing SMTP Credential info. Required Access Level: Security
* @summary Load SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {string} [subaccount] Email of the subaccount of which credential should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securitySmtpByNameGet: async (name: string, subaccount?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('securitySmtpByNameGet', 'name', name)
const localVarPath = `/security/smtp/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// 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 (subaccount !== undefined) {
localVarQueryParameter['subaccount'] = subaccount;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Update your existing SMTP Credentials. Required Access Level: Security
* @summary Update SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {SmtpCredentialsPayload} smtpCredentialsPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securitySmtpByNamePut: async (name: string, smtpCredentialsPayload: SmtpCredentialsPayload, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('securitySmtpByNamePut', 'name', name)
// verify required parameter 'smtpCredentialsPayload' is not null or undefined
assertParamExists('securitySmtpByNamePut', 'smtpCredentialsPayload', smtpCredentialsPayload)
const localVarPath = `/security/smtp/{name}`
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
// 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(smtpCredentialsPayload, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* List all your existing SMTP Credentials. Required Access Level: Security
* @summary List SMTP Credentials
* @param {string} [subaccount] Email of the subaccount of which credentials should be listed
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securitySmtpGet: async (subaccount?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/security/smtp`;
// 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 (subaccount !== undefined) {
localVarQueryParameter['subaccount'] = subaccount;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Add new SMTP Credential. Required Access Level: Security
* @summary Add SMTP Credential
* @param {SmtpCredentialsPayload} smtpCredentialsPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securitySmtpPost: async (smtpCredentialsPayload: SmtpCredentialsPayload, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'smtpCredentialsPayload' is not null or undefined
assertParamExists('securitySmtpPost', 'smtpCredentialsPayload', smtpCredentialsPayload)
const localVarPath = `/security/smtp`;
// 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(smtpCredentialsPayload, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* SecurityApi - functional programming interface
* @export
*/
export const SecurityApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = SecurityApiAxiosParamCreator(configuration)
return {
/**
* Delete your existing ApiKey. Required Access Level: Security
* @summary Delete ApiKey
* @param {string} name Name of the ApiKey
* @param {string} [subaccount] Email of the subaccount of which ApiKey should be deleted
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async securityApikeysByNameDelete(name: string, subaccount?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.securityApikeysByNameDelete(name, subaccount, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Load your existing ApiKey info. Required Access Level: Security
* @summary Load ApiKey
* @param {string} name Name of the ApiKey
* @param {string} [subaccount] Email of the subaccount of which ApiKey should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async securityApikeysByNameGet(name: string, subaccount?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiKey>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.securityApikeysByNameGet(name, subaccount, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Update your existing ApiKey. Required Access Level: Security
* @summary Update ApiKey
* @param {string} name Name of the ApiKey
* @param {ApiKeyPayload} apiKeyPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async securityApikeysByNamePut(name: string, apiKeyPayload: ApiKeyPayload, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiKey>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.securityApikeysByNamePut(name, apiKeyPayload, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* List all your existing ApiKeys. Required Access Level: Security
* @summary List ApiKeys
* @param {string} [subaccount] Email of the subaccount of which ApiKeys should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async securityApikeysGet(subaccount?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ApiKey>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.securityApikeysGet(subaccount, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Add a new ApiKey. Required Access Level: Security
* @summary Add ApiKey
* @param {ApiKeyPayload} apiKeyPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async securityApikeysPost(apiKeyPayload: ApiKeyPayload, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<NewApiKey>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.securityApikeysPost(apiKeyPayload, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Delete your existing SMTP Credentials. Required Access Level: Security
* @summary Delete SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {string} [subaccount] Email of the subaccount of which credential should be deleted
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async securitySmtpByNameDelete(name: string, subaccount?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.securitySmtpByNameDelete(name, subaccount, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Load your existing SMTP Credential info. Required Access Level: Security
* @summary Load SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {string} [subaccount] Email of the subaccount of which credential should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async securitySmtpByNameGet(name: string, subaccount?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SmtpCredentials>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.securitySmtpByNameGet(name, subaccount, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Update your existing SMTP Credentials. Required Access Level: Security
* @summary Update SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {SmtpCredentialsPayload} smtpCredentialsPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async securitySmtpByNamePut(name: string, smtpCredentialsPayload: SmtpCredentialsPayload, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SmtpCredentials>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.securitySmtpByNamePut(name, smtpCredentialsPayload, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* List all your existing SMTP Credentials. Required Access Level: Security
* @summary List SMTP Credentials
* @param {string} [subaccount] Email of the subaccount of which credentials should be listed
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async securitySmtpGet(subaccount?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<SmtpCredentials>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.securitySmtpGet(subaccount, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Add new SMTP Credential. Required Access Level: Security
* @summary Add SMTP Credential
* @param {SmtpCredentialsPayload} smtpCredentialsPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async securitySmtpPost(smtpCredentialsPayload: SmtpCredentialsPayload, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<NewSmtpCredentials>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.securitySmtpPost(smtpCredentialsPayload, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* SecurityApi - factory interface
* @export
*/
export const SecurityApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = SecurityApiFp(configuration)
return {
/**
* Delete your existing ApiKey. Required Access Level: Security
* @summary Delete ApiKey
* @param {string} name Name of the ApiKey
* @param {string} [subaccount] Email of the subaccount of which ApiKey should be deleted
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securityApikeysByNameDelete(name: string, subaccount?: string, options?: any): AxiosPromise<void> {
return localVarFp.securityApikeysByNameDelete(name, subaccount, options).then((request) => request(axios, basePath));
},
/**
* Load your existing ApiKey info. Required Access Level: Security
* @summary Load ApiKey
* @param {string} name Name of the ApiKey
* @param {string} [subaccount] Email of the subaccount of which ApiKey should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securityApikeysByNameGet(name: string, subaccount?: string, options?: any): AxiosPromise<ApiKey> {
return localVarFp.securityApikeysByNameGet(name, subaccount, options).then((request) => request(axios, basePath));
},
/**
* Update your existing ApiKey. Required Access Level: Security
* @summary Update ApiKey
* @param {string} name Name of the ApiKey
* @param {ApiKeyPayload} apiKeyPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securityApikeysByNamePut(name: string, apiKeyPayload: ApiKeyPayload, options?: any): AxiosPromise<ApiKey> {
return localVarFp.securityApikeysByNamePut(name, apiKeyPayload, options).then((request) => request(axios, basePath));
},
/**
* List all your existing ApiKeys. Required Access Level: Security
* @summary List ApiKeys
* @param {string} [subaccount] Email of the subaccount of which ApiKeys should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securityApikeysGet(subaccount?: string, options?: any): AxiosPromise<Array<ApiKey>> {
return localVarFp.securityApikeysGet(subaccount, options).then((request) => request(axios, basePath));
},
/**
* Add a new ApiKey. Required Access Level: Security
* @summary Add ApiKey
* @param {ApiKeyPayload} apiKeyPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securityApikeysPost(apiKeyPayload: ApiKeyPayload, options?: any): AxiosPromise<NewApiKey> {
return localVarFp.securityApikeysPost(apiKeyPayload, options).then((request) => request(axios, basePath));
},
/**
* Delete your existing SMTP Credentials. Required Access Level: Security
* @summary Delete SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {string} [subaccount] Email of the subaccount of which credential should be deleted
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securitySmtpByNameDelete(name: string, subaccount?: string, options?: any): AxiosPromise<void> {
return localVarFp.securitySmtpByNameDelete(name, subaccount, options).then((request) => request(axios, basePath));
},
/**
* Load your existing SMTP Credential info. Required Access Level: Security
* @summary Load SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {string} [subaccount] Email of the subaccount of which credential should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securitySmtpByNameGet(name: string, subaccount?: string, options?: any): AxiosPromise<SmtpCredentials> {
return localVarFp.securitySmtpByNameGet(name, subaccount, options).then((request) => request(axios, basePath));
},
/**
* Update your existing SMTP Credentials. Required Access Level: Security
* @summary Update SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {SmtpCredentialsPayload} smtpCredentialsPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securitySmtpByNamePut(name: string, smtpCredentialsPayload: SmtpCredentialsPayload, options?: any): AxiosPromise<SmtpCredentials> {
return localVarFp.securitySmtpByNamePut(name, smtpCredentialsPayload, options).then((request) => request(axios, basePath));
},
/**
* List all your existing SMTP Credentials. Required Access Level: Security
* @summary List SMTP Credentials
* @param {string} [subaccount] Email of the subaccount of which credentials should be listed
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securitySmtpGet(subaccount?: string, options?: any): AxiosPromise<Array<SmtpCredentials>> {
return localVarFp.securitySmtpGet(subaccount, options).then((request) => request(axios, basePath));
},
/**
* Add new SMTP Credential. Required Access Level: Security
* @summary Add SMTP Credential
* @param {SmtpCredentialsPayload} smtpCredentialsPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
securitySmtpPost(smtpCredentialsPayload: SmtpCredentialsPayload, options?: any): AxiosPromise<NewSmtpCredentials> {
return localVarFp.securitySmtpPost(smtpCredentialsPayload, options).then((request) => request(axios, basePath));
},
};
};
/**
* SecurityApi - interface
* @export
* @interface SecurityApi
*/
export interface SecurityApiInterface {
/**
* Delete your existing ApiKey. Required Access Level: Security
* @summary Delete ApiKey
* @param {string} name Name of the ApiKey
* @param {string} [subaccount] Email of the subaccount of which ApiKey should be deleted
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApiInterface
*/
securityApikeysByNameDelete(name: string, subaccount?: string, options?: AxiosRequestConfig): AxiosPromise<void>;
/**
* Load your existing ApiKey info. Required Access Level: Security
* @summary Load ApiKey
* @param {string} name Name of the ApiKey
* @param {string} [subaccount] Email of the subaccount of which ApiKey should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApiInterface
*/
securityApikeysByNameGet(name: string, subaccount?: string, options?: AxiosRequestConfig): AxiosPromise<ApiKey>;
/**
* Update your existing ApiKey. Required Access Level: Security
* @summary Update ApiKey
* @param {string} name Name of the ApiKey
* @param {ApiKeyPayload} apiKeyPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApiInterface
*/
securityApikeysByNamePut(name: string, apiKeyPayload: ApiKeyPayload, options?: AxiosRequestConfig): AxiosPromise<ApiKey>;
/**
* List all your existing ApiKeys. Required Access Level: Security
* @summary List ApiKeys
* @param {string} [subaccount] Email of the subaccount of which ApiKeys should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApiInterface
*/
securityApikeysGet(subaccount?: string, options?: AxiosRequestConfig): AxiosPromise<Array<ApiKey>>;
/**
* Add a new ApiKey. Required Access Level: Security
* @summary Add ApiKey
* @param {ApiKeyPayload} apiKeyPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApiInterface
*/
securityApikeysPost(apiKeyPayload: ApiKeyPayload, options?: AxiosRequestConfig): AxiosPromise<NewApiKey>;
/**
* Delete your existing SMTP Credentials. Required Access Level: Security
* @summary Delete SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {string} [subaccount] Email of the subaccount of which credential should be deleted
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApiInterface
*/
securitySmtpByNameDelete(name: string, subaccount?: string, options?: AxiosRequestConfig): AxiosPromise<void>;
/**
* Load your existing SMTP Credential info. Required Access Level: Security
* @summary Load SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {string} [subaccount] Email of the subaccount of which credential should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApiInterface
*/
securitySmtpByNameGet(name: string, subaccount?: string, options?: AxiosRequestConfig): AxiosPromise<SmtpCredentials>;
/**
* Update your existing SMTP Credentials. Required Access Level: Security
* @summary Update SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {SmtpCredentialsPayload} smtpCredentialsPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApiInterface
*/
securitySmtpByNamePut(name: string, smtpCredentialsPayload: SmtpCredentialsPayload, options?: AxiosRequestConfig): AxiosPromise<SmtpCredentials>;
/**
* List all your existing SMTP Credentials. Required Access Level: Security
* @summary List SMTP Credentials
* @param {string} [subaccount] Email of the subaccount of which credentials should be listed
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApiInterface
*/
securitySmtpGet(subaccount?: string, options?: AxiosRequestConfig): AxiosPromise<Array<SmtpCredentials>>;
/**
* Add new SMTP Credential. Required Access Level: Security
* @summary Add SMTP Credential
* @param {SmtpCredentialsPayload} smtpCredentialsPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApiInterface
*/
securitySmtpPost(smtpCredentialsPayload: SmtpCredentialsPayload, options?: AxiosRequestConfig): AxiosPromise<NewSmtpCredentials>;
}
/**
* SecurityApi - object-oriented interface
* @export
* @class SecurityApi
* @extends {BaseAPI}
*/
export class SecurityApi extends BaseAPI implements SecurityApiInterface {
/**
* Delete your existing ApiKey. Required Access Level: Security
* @summary Delete ApiKey
* @param {string} name Name of the ApiKey
* @param {string} [subaccount] Email of the subaccount of which ApiKey should be deleted
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApi
*/
public securityApikeysByNameDelete(name: string, subaccount?: string, options?: AxiosRequestConfig) {
return SecurityApiFp(this.configuration).securityApikeysByNameDelete(name, subaccount, options).then((request) => request(this.axios, this.basePath));
}
/**
* Load your existing ApiKey info. Required Access Level: Security
* @summary Load ApiKey
* @param {string} name Name of the ApiKey
* @param {string} [subaccount] Email of the subaccount of which ApiKey should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApi
*/
public securityApikeysByNameGet(name: string, subaccount?: string, options?: AxiosRequestConfig) {
return SecurityApiFp(this.configuration).securityApikeysByNameGet(name, subaccount, options).then((request) => request(this.axios, this.basePath));
}
/**
* Update your existing ApiKey. Required Access Level: Security
* @summary Update ApiKey
* @param {string} name Name of the ApiKey
* @param {ApiKeyPayload} apiKeyPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApi
*/
public securityApikeysByNamePut(name: string, apiKeyPayload: ApiKeyPayload, options?: AxiosRequestConfig) {
return SecurityApiFp(this.configuration).securityApikeysByNamePut(name, apiKeyPayload, options).then((request) => request(this.axios, this.basePath));
}
/**
* List all your existing ApiKeys. Required Access Level: Security
* @summary List ApiKeys
* @param {string} [subaccount] Email of the subaccount of which ApiKeys should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApi
*/
public securityApikeysGet(subaccount?: string, options?: AxiosRequestConfig) {
return SecurityApiFp(this.configuration).securityApikeysGet(subaccount, options).then((request) => request(this.axios, this.basePath));
}
/**
* Add a new ApiKey. Required Access Level: Security
* @summary Add ApiKey
* @param {ApiKeyPayload} apiKeyPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApi
*/
public securityApikeysPost(apiKeyPayload: ApiKeyPayload, options?: AxiosRequestConfig) {
return SecurityApiFp(this.configuration).securityApikeysPost(apiKeyPayload, options).then((request) => request(this.axios, this.basePath));
}
/**
* Delete your existing SMTP Credentials. Required Access Level: Security
* @summary Delete SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {string} [subaccount] Email of the subaccount of which credential should be deleted
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApi
*/
public securitySmtpByNameDelete(name: string, subaccount?: string, options?: AxiosRequestConfig) {
return SecurityApiFp(this.configuration).securitySmtpByNameDelete(name, subaccount, options).then((request) => request(this.axios, this.basePath));
}
/**
* Load your existing SMTP Credential info. Required Access Level: Security
* @summary Load SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {string} [subaccount] Email of the subaccount of which credential should be loaded
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApi
*/
public securitySmtpByNameGet(name: string, subaccount?: string, options?: AxiosRequestConfig) {
return SecurityApiFp(this.configuration).securitySmtpByNameGet(name, subaccount, options).then((request) => request(this.axios, this.basePath));
}
/**
* Update your existing SMTP Credentials. Required Access Level: Security
* @summary Update SMTP Credential
* @param {string} name Name of the SMTP Credential
* @param {SmtpCredentialsPayload} smtpCredentialsPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApi
*/
public securitySmtpByNamePut(name: string, smtpCredentialsPayload: SmtpCredentialsPayload, options?: AxiosRequestConfig) {
return SecurityApiFp(this.configuration).securitySmtpByNamePut(name, smtpCredentialsPayload, options).then((request) => request(this.axios, this.basePath));
}
/**
* List all your existing SMTP Credentials. Required Access Level: Security
* @summary List SMTP Credentials
* @param {string} [subaccount] Email of the subaccount of which credentials should be listed
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApi
*/
public securitySmtpGet(subaccount?: string, options?: AxiosRequestConfig) {
return SecurityApiFp(this.configuration).securitySmtpGet(subaccount, options).then((request) => request(this.axios, this.basePath));
}
/**
* Add new SMTP Credential. Required Access Level: Security
* @summary Add SMTP Credential
* @param {SmtpCredentialsPayload} smtpCredentialsPayload
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApi
*/
public securitySmtpPost(smtpCredentialsPayload: SmtpCredentialsPayload, options?: AxiosRequestConfig) {
return SecurityApiFp(this.configuration).securitySmtpPost(smtpCredentialsPayload, options).then((request) => request(this.axios, this.basePath));
}
}