@elasticapi/wpengine-typescript-sdk
Version:
Unofficial TypeScript SDK for the WP Engine API
894 lines • 172 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* WP Engine API
* The API described in this document is subject to change.
*
* The version of the OpenAPI document: 1.6.7
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setBasicAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
// @ts-ignore
import { BASE_PATH, BaseAPI, operationServerMap } from './base';
export const CreateInstallRequestEnvironmentEnum = {
Production: 'production',
Staging: 'staging',
Development: 'development'
};
export const InstallationStatusEnum = {
Active: 'active',
Pending: 'pending'
};
export const InstallationEnvironmentEnum = {
Production: 'production',
Staging: 'staging',
Development: 'development'
};
export const PurgeCacheRequestTypeEnum = {
Object: 'object',
Page: 'page',
Cdn: 'cdn'
};
export const SiteInstallsInnerEnvironmentEnum = {
Production: 'production',
Staging: 'staging',
Development: 'development'
};
export const UpdateInstallRequestEnvironmentEnum = {
Production: 'production',
Staging: 'staging',
Development: 'development'
};
/**
* AccountApi - axios parameter creator
* @export
*/
export const AccountApiAxiosParamCreator = function (configuration) {
return {
/**
* Returns a single Account
* @summary Get an account by ID
* @param {string} accountId ID of account
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAccount: async (accountId, authorization, options = {}) => {
// verify required parameter 'accountId' is not null or undefined
assertParamExists('getAccount', 'accountId', accountId);
const localVarPath = `/accounts/{account_id}`
.replace(`{${"account_id"}}`, encodeURIComponent(String(accountId)));
// 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 = {};
const localVarQueryParameter = {};
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration);
if (authorization != null) {
localVarHeaderParameter['Authorization'] = String(authorization);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* # Description Use this to list your WP Engine accounts.
* @summary List your WP Engine accounts
* @param {string} [authorization]
* @param {number} [limit] (Optional) The number of records to return
* @param {number} [offset] (Optional) The first record of the result set to be retrieved
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listAccounts: async (authorization, limit, offset, options = {}) => {
const localVarPath = `/accounts`;
// 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 = {};
const localVarQueryParameter = {};
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration);
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (offset !== undefined) {
localVarQueryParameter['offset'] = offset;
}
if (authorization != null) {
localVarHeaderParameter['Authorization'] = String(authorization);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
/**
* AccountApi - functional programming interface
* @export
*/
export const AccountApiFp = function (configuration) {
const localVarAxiosParamCreator = AccountApiAxiosParamCreator(configuration);
return {
/**
* Returns a single Account
* @summary Get an account by ID
* @param {string} accountId ID of account
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAccount(accountId, authorization, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.getAccount(accountId, authorization, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['AccountApi.getAccount']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* # Description Use this to list your WP Engine accounts.
* @summary List your WP Engine accounts
* @param {string} [authorization]
* @param {number} [limit] (Optional) The number of records to return
* @param {number} [offset] (Optional) The first record of the result set to be retrieved
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listAccounts(authorization, limit, offset, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.listAccounts(authorization, limit, offset, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['AccountApi.listAccounts']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
};
};
/**
* AccountApi - factory interface
* @export
*/
export const AccountApiFactory = function (configuration, basePath, axios) {
const localVarFp = AccountApiFp(configuration);
return {
/**
* Returns a single Account
* @summary Get an account by ID
* @param {string} accountId ID of account
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAccount(accountId, authorization, options) {
return localVarFp.getAccount(accountId, authorization, options).then((request) => request(axios, basePath));
},
/**
* # Description Use this to list your WP Engine accounts.
* @summary List your WP Engine accounts
* @param {string} [authorization]
* @param {number} [limit] (Optional) The number of records to return
* @param {number} [offset] (Optional) The first record of the result set to be retrieved
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listAccounts(authorization, limit, offset, options) {
return localVarFp.listAccounts(authorization, limit, offset, options).then((request) => request(axios, basePath));
},
};
};
/**
* AccountApi - object-oriented interface
* @export
* @class AccountApi
* @extends {BaseAPI}
*/
export class AccountApi extends BaseAPI {
/**
* Returns a single Account
* @summary Get an account by ID
* @param {string} accountId ID of account
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AccountApi
*/
getAccount(accountId, authorization, options) {
return AccountApiFp(this.configuration).getAccount(accountId, authorization, options).then((request) => request(this.axios, this.basePath));
}
/**
* # Description Use this to list your WP Engine accounts.
* @summary List your WP Engine accounts
* @param {string} [authorization]
* @param {number} [limit] (Optional) The number of records to return
* @param {number} [offset] (Optional) The first record of the result set to be retrieved
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AccountApi
*/
listAccounts(authorization, limit, offset, options) {
return AccountApiFp(this.configuration).listAccounts(authorization, limit, offset, options).then((request) => request(this.axios, this.basePath));
}
}
/**
* AccountUserApi - axios parameter creator
* @export
*/
export const AccountUserApiAxiosParamCreator = function (configuration) {
return {
/**
*
* @summary Create a new account user
* @param {string} accountId ID of account
* @param {CreateAccountUserRequest} body ##### Properties * user - **required** - The user that will be created * account_id - **required** - The ID of the account that the account_user will belong to * first_name - **required** - The first name of the user * last_name - **required** - The last name of the user * email - **required** - The email of the user * roles -- **required** - The roles the user is allowed. The following roles are valid * owner * full * full,billing * partial * partial,billing * install_ids - **optional** - Used with partial role selection. The ids of the installs the user will have access to.
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAccountUser: async (accountId, body, authorization, options = {}) => {
// verify required parameter 'accountId' is not null or undefined
assertParamExists('createAccountUser', 'accountId', accountId);
// verify required parameter 'body' is not null or undefined
assertParamExists('createAccountUser', 'body', body);
const localVarPath = `/accounts/{account_id}/account_users`
.replace(`{${"account_id"}}`, encodeURIComponent(String(accountId)));
// 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 = {};
const localVarQueryParameter = {};
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
if (authorization != null) {
localVarHeaderParameter['Authorization'] = String(authorization);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* This will remove the association this user has to this account. This delete is permanent and there is no confirmation prompt.
* @summary Delete an account user
* @param {string} accountId ID of account
* @param {string} userId ID of the user
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteAccountUser: async (accountId, userId, authorization, options = {}) => {
// verify required parameter 'accountId' is not null or undefined
assertParamExists('deleteAccountUser', 'accountId', accountId);
// verify required parameter 'userId' is not null or undefined
assertParamExists('deleteAccountUser', 'userId', userId);
const localVarPath = `/accounts/{account_id}/account_users/{user_id}`
.replace(`{${"account_id"}}`, encodeURIComponent(String(accountId)))
.replace(`{${"user_id"}}`, encodeURIComponent(String(userId)));
// 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 = {};
const localVarQueryParameter = {};
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration);
if (authorization != null) {
localVarHeaderParameter['Authorization'] = String(authorization);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Returns a single account user
* @summary Get an account user by ID
* @param {string} accountId ID of account
* @param {string} userId ID of the user
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAccountUser: async (accountId, userId, authorization, options = {}) => {
// verify required parameter 'accountId' is not null or undefined
assertParamExists('getAccountUser', 'accountId', accountId);
// verify required parameter 'userId' is not null or undefined
assertParamExists('getAccountUser', 'userId', userId);
const localVarPath = `/accounts/{account_id}/account_users/{user_id}`
.replace(`{${"account_id"}}`, encodeURIComponent(String(accountId)))
.replace(`{${"user_id"}}`, encodeURIComponent(String(userId)));
// 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 = {};
const localVarQueryParameter = {};
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration);
if (authorization != null) {
localVarHeaderParameter['Authorization'] = String(authorization);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary List your account users
* @param {string} accountId ID of account
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listAccountUsers: async (accountId, authorization, options = {}) => {
// verify required parameter 'accountId' is not null or undefined
assertParamExists('listAccountUsers', 'accountId', accountId);
const localVarPath = `/accounts/{account_id}/account_users`
.replace(`{${"account_id"}}`, encodeURIComponent(String(accountId)));
// 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 = {};
const localVarQueryParameter = {};
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration);
if (authorization != null) {
localVarHeaderParameter['Authorization'] = String(authorization);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Update an account user
* @param {string} accountId ID of account
* @param {string} userId ID of the user
* @param {UpdateAccountUserRequest} body ##### Properties * roles -- **required** - The roles the user is allowed. The following roles are valid * owner * full * full,billing * partial * partial,billing * install_ids - **optional** - Used with partial role selection. The ids of the installs the user will have access to.
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateAccountUser: async (accountId, userId, body, authorization, options = {}) => {
// verify required parameter 'accountId' is not null or undefined
assertParamExists('updateAccountUser', 'accountId', accountId);
// verify required parameter 'userId' is not null or undefined
assertParamExists('updateAccountUser', 'userId', userId);
// verify required parameter 'body' is not null or undefined
assertParamExists('updateAccountUser', 'body', body);
const localVarPath = `/accounts/{account_id}/account_users/{user_id}`
.replace(`{${"account_id"}}`, encodeURIComponent(String(accountId)))
.replace(`{${"user_id"}}`, encodeURIComponent(String(userId)));
// 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: 'PATCH', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
if (authorization != null) {
localVarHeaderParameter['Authorization'] = String(authorization);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
/**
* AccountUserApi - functional programming interface
* @export
*/
export const AccountUserApiFp = function (configuration) {
const localVarAxiosParamCreator = AccountUserApiAxiosParamCreator(configuration);
return {
/**
*
* @summary Create a new account user
* @param {string} accountId ID of account
* @param {CreateAccountUserRequest} body ##### Properties * user - **required** - The user that will be created * account_id - **required** - The ID of the account that the account_user will belong to * first_name - **required** - The first name of the user * last_name - **required** - The last name of the user * email - **required** - The email of the user * roles -- **required** - The roles the user is allowed. The following roles are valid * owner * full * full,billing * partial * partial,billing * install_ids - **optional** - Used with partial role selection. The ids of the installs the user will have access to.
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createAccountUser(accountId, body, authorization, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.createAccountUser(accountId, body, authorization, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['AccountUserApi.createAccountUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* This will remove the association this user has to this account. This delete is permanent and there is no confirmation prompt.
* @summary Delete an account user
* @param {string} accountId ID of account
* @param {string} userId ID of the user
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteAccountUser(accountId, userId, authorization, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAccountUser(accountId, userId, authorization, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['AccountUserApi.deleteAccountUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Returns a single account user
* @summary Get an account user by ID
* @param {string} accountId ID of account
* @param {string} userId ID of the user
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAccountUser(accountId, userId, authorization, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountUser(accountId, userId, authorization, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['AccountUserApi.getAccountUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary List your account users
* @param {string} accountId ID of account
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listAccountUsers(accountId, authorization, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.listAccountUsers(accountId, authorization, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['AccountUserApi.listAccountUsers']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Update an account user
* @param {string} accountId ID of account
* @param {string} userId ID of the user
* @param {UpdateAccountUserRequest} body ##### Properties * roles -- **required** - The roles the user is allowed. The following roles are valid * owner * full * full,billing * partial * partial,billing * install_ids - **optional** - Used with partial role selection. The ids of the installs the user will have access to.
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateAccountUser(accountId, userId, body, authorization, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.updateAccountUser(accountId, userId, body, authorization, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['AccountUserApi.updateAccountUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
};
};
/**
* AccountUserApi - factory interface
* @export
*/
export const AccountUserApiFactory = function (configuration, basePath, axios) {
const localVarFp = AccountUserApiFp(configuration);
return {
/**
*
* @summary Create a new account user
* @param {string} accountId ID of account
* @param {CreateAccountUserRequest} body ##### Properties * user - **required** - The user that will be created * account_id - **required** - The ID of the account that the account_user will belong to * first_name - **required** - The first name of the user * last_name - **required** - The last name of the user * email - **required** - The email of the user * roles -- **required** - The roles the user is allowed. The following roles are valid * owner * full * full,billing * partial * partial,billing * install_ids - **optional** - Used with partial role selection. The ids of the installs the user will have access to.
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAccountUser(accountId, body, authorization, options) {
return localVarFp.createAccountUser(accountId, body, authorization, options).then((request) => request(axios, basePath));
},
/**
* This will remove the association this user has to this account. This delete is permanent and there is no confirmation prompt.
* @summary Delete an account user
* @param {string} accountId ID of account
* @param {string} userId ID of the user
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteAccountUser(accountId, userId, authorization, options) {
return localVarFp.deleteAccountUser(accountId, userId, authorization, options).then((request) => request(axios, basePath));
},
/**
* Returns a single account user
* @summary Get an account user by ID
* @param {string} accountId ID of account
* @param {string} userId ID of the user
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAccountUser(accountId, userId, authorization, options) {
return localVarFp.getAccountUser(accountId, userId, authorization, options).then((request) => request(axios, basePath));
},
/**
*
* @summary List your account users
* @param {string} accountId ID of account
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listAccountUsers(accountId, authorization, options) {
return localVarFp.listAccountUsers(accountId, authorization, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Update an account user
* @param {string} accountId ID of account
* @param {string} userId ID of the user
* @param {UpdateAccountUserRequest} body ##### Properties * roles -- **required** - The roles the user is allowed. The following roles are valid * owner * full * full,billing * partial * partial,billing * install_ids - **optional** - Used with partial role selection. The ids of the installs the user will have access to.
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateAccountUser(accountId, userId, body, authorization, options) {
return localVarFp.updateAccountUser(accountId, userId, body, authorization, options).then((request) => request(axios, basePath));
},
};
};
/**
* AccountUserApi - object-oriented interface
* @export
* @class AccountUserApi
* @extends {BaseAPI}
*/
export class AccountUserApi extends BaseAPI {
/**
*
* @summary Create a new account user
* @param {string} accountId ID of account
* @param {CreateAccountUserRequest} body ##### Properties * user - **required** - The user that will be created * account_id - **required** - The ID of the account that the account_user will belong to * first_name - **required** - The first name of the user * last_name - **required** - The last name of the user * email - **required** - The email of the user * roles -- **required** - The roles the user is allowed. The following roles are valid * owner * full * full,billing * partial * partial,billing * install_ids - **optional** - Used with partial role selection. The ids of the installs the user will have access to.
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AccountUserApi
*/
createAccountUser(accountId, body, authorization, options) {
return AccountUserApiFp(this.configuration).createAccountUser(accountId, body, authorization, options).then((request) => request(this.axios, this.basePath));
}
/**
* This will remove the association this user has to this account. This delete is permanent and there is no confirmation prompt.
* @summary Delete an account user
* @param {string} accountId ID of account
* @param {string} userId ID of the user
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AccountUserApi
*/
deleteAccountUser(accountId, userId, authorization, options) {
return AccountUserApiFp(this.configuration).deleteAccountUser(accountId, userId, authorization, options).then((request) => request(this.axios, this.basePath));
}
/**
* Returns a single account user
* @summary Get an account user by ID
* @param {string} accountId ID of account
* @param {string} userId ID of the user
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AccountUserApi
*/
getAccountUser(accountId, userId, authorization, options) {
return AccountUserApiFp(this.configuration).getAccountUser(accountId, userId, authorization, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary List your account users
* @param {string} accountId ID of account
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AccountUserApi
*/
listAccountUsers(accountId, authorization, options) {
return AccountUserApiFp(this.configuration).listAccountUsers(accountId, authorization, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Update an account user
* @param {string} accountId ID of account
* @param {string} userId ID of the user
* @param {UpdateAccountUserRequest} body ##### Properties * roles -- **required** - The roles the user is allowed. The following roles are valid * owner * full * full,billing * partial * partial,billing * install_ids - **optional** - Used with partial role selection. The ids of the installs the user will have access to.
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AccountUserApi
*/
updateAccountUser(accountId, userId, body, authorization, options) {
return AccountUserApiFp(this.configuration).updateAccountUser(accountId, userId, body, authorization, options).then((request) => request(this.axios, this.basePath));
}
}
/**
* BackupApi - axios parameter creator
* @export
*/
export const BackupApiAxiosParamCreator = function (configuration) {
return {
/**
* Kicks off a backup of a WordPress installation.
* @summary Requests a new backup of a WordPress installation
* @param {string} installId ID of install
* @param {CreateBackupRequest} body ##### Properties * description - **required** - A description of this backup. * notification_emails - **required** - The email address(es) that will receive an email once the backup has completed.
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createBackup: async (installId, body, authorization, options = {}) => {
// verify required parameter 'installId' is not null or undefined
assertParamExists('createBackup', 'installId', installId);
// verify required parameter 'body' is not null or undefined
assertParamExists('createBackup', 'body', body);
const localVarPath = `/installs/{install_id}/backups`
.replace(`{${"install_id"}}`, encodeURIComponent(String(installId)));
// 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 = {};
const localVarQueryParameter = {};
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
if (authorization != null) {
localVarHeaderParameter['Authorization'] = String(authorization);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Retrieves the status of a backup of a WordPress installation.
* @summary Retreives the status of a backup of a WordPress installation
* @param {string} installId ID of install
* @param {string} backupId ID of backup
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
showBackup: async (installId, backupId, authorization, options = {}) => {
// verify required parameter 'installId' is not null or undefined
assertParamExists('showBackup', 'installId', installId);
// verify required parameter 'backupId' is not null or undefined
assertParamExists('showBackup', 'backupId', backupId);
const localVarPath = `/installs/{install_id}/backups/{backup_id}`
.replace(`{${"install_id"}}`, encodeURIComponent(String(installId)))
.replace(`{${"backup_id"}}`, encodeURIComponent(String(backupId)));
// 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 = {};
const localVarQueryParameter = {};
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration);
if (authorization != null) {
localVarHeaderParameter['Authorization'] = String(authorization);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
/**
* BackupApi - functional programming interface
* @export
*/
export const BackupApiFp = function (configuration) {
const localVarAxiosParamCreator = BackupApiAxiosParamCreator(configuration);
return {
/**
* Kicks off a backup of a WordPress installation.
* @summary Requests a new backup of a WordPress installation
* @param {string} installId ID of install
* @param {CreateBackupRequest} body ##### Properties * description - **required** - A description of this backup. * notification_emails - **required** - The email address(es) that will receive an email once the backup has completed.
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createBackup(installId, body, authorization, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.createBackup(installId, body, authorization, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['BackupApi.createBackup']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Retrieves the status of a backup of a WordPress installation.
* @summary Retreives the status of a backup of a WordPress installation
* @param {string} installId ID of install
* @param {string} backupId ID of backup
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async showBackup(installId, backupId, authorization, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.showBackup(installId, backupId, authorization, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['BackupApi.showBackup']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
};
};
/**
* BackupApi - factory interface
* @export
*/
export const BackupApiFactory = function (configuration, basePath, axios) {
const localVarFp = BackupApiFp(configuration);
return {
/**
* Kicks off a backup of a WordPress installation.
* @summary Requests a new backup of a WordPress installation
* @param {string} installId ID of install
* @param {CreateBackupRequest} body ##### Properties * description - **required** - A description of this backup. * notification_emails - **required** - The email address(es) that will receive an email once the backup has completed.
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createBackup(installId, body, authorization, options) {
return localVarFp.createBackup(installId, body, authorization, options).then((request) => request(axios, basePath));
},
/**
* Retrieves the status of a backup of a WordPress installation.
* @summary Retreives the status of a backup of a WordPress installation
* @param {string} installId ID of install
* @param {string} backupId ID of backup
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
showBackup(installId, backupId, authorization, options) {
return localVarFp.showBackup(installId, backupId, authorization, options).then((request) => request(axios, basePath));
},
};
};
/**
* BackupApi - object-oriented interface
* @export
* @class BackupApi
* @extends {BaseAPI}
*/
export class BackupApi extends BaseAPI {
/**
* Kicks off a backup of a WordPress installation.
* @summary Requests a new backup of a WordPress installation
* @param {string} installId ID of install
* @param {CreateBackupRequest} body ##### Properties * description - **required** - A description of this backup. * notification_emails - **required** - The email address(es) that will receive an email once the backup has completed.
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof BackupApi
*/
createBackup(installId, body, authorization, options) {
return BackupApiFp(this.configuration).createBackup(installId, body, authorization, options).then((request) => request(this.axios, this.basePath));
}
/**
* Retrieves the status of a backup of a WordPress installation.
* @summary Retreives the status of a backup of a WordPress installation
* @param {string} installId ID of install
* @param {string} backupId ID of backup
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof BackupApi
*/
showBackup(installId, backupId, authorization, options) {
return BackupApiFp(this.configuration).showBackup(installId, backupId, authorization, options).then((request) => request(this.axios, this.basePath));
}
}
/**
* CacheApi - axios parameter creator
* @export
*/
export const CacheApiAxiosParamCreator = function (configuration) {
return {
/**
* This will purge the specified cache associated with the install
* @summary Purge an install\'s cache
* @param {string} installId ID of install
* @param {PurgeCacheRequest} body ##### Properties * type - **required** - The type of cache to be purged
* @param {string} [authorization]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
purgeCache: async (installId, body, authorization, options = {}) => {
// verify required parameter 'installId' is not null or undefined
assertParamExists('purgeCache', 'installId', installId);
// verify required paramet