UNPKG

@elasticapi/wpengine-typescript-sdk

Version:
843 lines 179 kB
"use strict"; /* 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. */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.SwaggerApi = exports.SwaggerApiFactory = exports.SwaggerApiFp = exports.SwaggerApiAxiosParamCreator = exports.StatusApi = exports.StatusApiFactory = exports.StatusApiFp = exports.StatusApiAxiosParamCreator = exports.SshKeyApi = exports.SshKeyApiFactory = exports.SshKeyApiFp = exports.SshKeyApiAxiosParamCreator = exports.SiteApi = exports.SiteApiFactory = exports.SiteApiFp = exports.SiteApiAxiosParamCreator = exports.InstallApi = exports.InstallApiFactory = exports.InstallApiFp = exports.InstallApiAxiosParamCreator = exports.DomainApi = exports.DomainApiFactory = exports.DomainApiFp = exports.DomainApiAxiosParamCreator = exports.CdnApi = exports.CdnApiFactory = exports.CdnApiFp = exports.CdnApiAxiosParamCreator = exports.CacheApi = exports.CacheApiFactory = exports.CacheApiFp = exports.CacheApiAxiosParamCreator = exports.BackupApi = exports.BackupApiFactory = exports.BackupApiFp = exports.BackupApiAxiosParamCreator = exports.AccountUserApi = exports.AccountUserApiFactory = exports.AccountUserApiFp = exports.AccountUserApiAxiosParamCreator = exports.AccountApi = exports.AccountApiFactory = exports.AccountApiFp = exports.AccountApiAxiosParamCreator = exports.UpdateInstallRequestEnvironmentEnum = exports.SiteInstallsInnerEnvironmentEnum = exports.PurgeCacheRequestTypeEnum = exports.InstallationEnvironmentEnum = exports.InstallationStatusEnum = exports.CreateInstallRequestEnvironmentEnum = void 0; exports.UserApi = exports.UserApiFactory = exports.UserApiFp = exports.UserApiAxiosParamCreator = void 0; const axios_1 = __importDefault(require("axios")); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("./common"); // @ts-ignore const base_1 = require("./base"); exports.CreateInstallRequestEnvironmentEnum = { Production: 'production', Staging: 'staging', Development: 'development' }; exports.InstallationStatusEnum = { Active: 'active', Pending: 'pending' }; exports.InstallationEnvironmentEnum = { Production: 'production', Staging: 'staging', Development: 'development' }; exports.PurgeCacheRequestTypeEnum = { Object: 'object', Page: 'page', Cdn: 'cdn' }; exports.SiteInstallsInnerEnvironmentEnum = { Production: 'production', Staging: 'staging', Development: 'development' }; exports.UpdateInstallRequestEnvironmentEnum = { Production: 'production', Staging: 'staging', Development: 'development' }; /** * AccountApi - axios parameter creator * @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 (0, common_1.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, common_1.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 (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); if (authorization != null) { localVarHeaderParameter['Authorization'] = String(authorization); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.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, common_1.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 (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (authorization != null) { localVarHeaderParameter['Authorization'] = String(authorization); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.AccountApiAxiosParamCreator = AccountApiAxiosParamCreator; /** * AccountApi - functional programming interface * @export */ const AccountApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.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 = base_1.operationServerMap['AccountApi.getAccount']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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 = base_1.operationServerMap['AccountApi.listAccounts']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; exports.AccountApiFp = AccountApiFp; /** * AccountApi - factory interface * @export */ const AccountApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.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)); }, }; }; exports.AccountApiFactory = AccountApiFactory; /** * AccountApi - object-oriented interface * @export * @class AccountApi * @extends {BaseAPI} */ class AccountApi extends base_1.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 (0, exports.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 (0, exports.AccountApiFp)(this.configuration).listAccounts(authorization, limit, offset, options).then((request) => request(this.axios, this.basePath)); } } exports.AccountApi = AccountApi; /** * AccountUserApi - axios parameter creator * @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 (0, common_1.assertParamExists)('createAccountUser', 'accountId', accountId); // verify required parameter 'body' is not null or undefined (0, common_1.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, common_1.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 (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; if (authorization != null) { localVarHeaderParameter['Authorization'] = String(authorization); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration); return { url: (0, common_1.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 (0, common_1.assertParamExists)('deleteAccountUser', 'accountId', accountId); // verify required parameter 'userId' is not null or undefined (0, common_1.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, common_1.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 (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); if (authorization != null) { localVarHeaderParameter['Authorization'] = String(authorization); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.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 (0, common_1.assertParamExists)('getAccountUser', 'accountId', accountId); // verify required parameter 'userId' is not null or undefined (0, common_1.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, common_1.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 (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); if (authorization != null) { localVarHeaderParameter['Authorization'] = String(authorization); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.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 (0, common_1.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, common_1.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 (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); if (authorization != null) { localVarHeaderParameter['Authorization'] = String(authorization); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.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 (0, common_1.assertParamExists)('updateAccountUser', 'accountId', accountId); // verify required parameter 'userId' is not null or undefined (0, common_1.assertParamExists)('updateAccountUser', 'userId', userId); // verify required parameter 'body' is not null or undefined (0, common_1.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, common_1.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 (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; if (authorization != null) { localVarHeaderParameter['Authorization'] = String(authorization); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.AccountUserApiAxiosParamCreator = AccountUserApiAxiosParamCreator; /** * AccountUserApi - functional programming interface * @export */ const AccountUserApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.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 = base_1.operationServerMap['AccountUserApi.createAccountUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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 = base_1.operationServerMap['AccountUserApi.deleteAccountUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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 = base_1.operationServerMap['AccountUserApi.getAccountUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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 = base_1.operationServerMap['AccountUserApi.listAccountUsers']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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 = base_1.operationServerMap['AccountUserApi.updateAccountUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; exports.AccountUserApiFp = AccountUserApiFp; /** * AccountUserApi - factory interface * @export */ const AccountUserApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.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)); }, }; }; exports.AccountUserApiFactory = AccountUserApiFactory; /** * AccountUserApi - object-oriented interface * @export * @class AccountUserApi * @extends {BaseAPI} */ class AccountUserApi extends base_1.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 (0, exports.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 (0, exports.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 (0, exports.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 (0, exports.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 (0, exports.AccountUserApiFp)(this.configuration).updateAccountUser(accountId, userId, body, authorization, options).then((request) => request(this.axios, this.basePath)); } } exports.AccountUserApi = AccountUserApi; /** * BackupApi - axios parameter creator * @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 (0, common_1.assertParamExists)('createBackup', 'installId', installId); // verify required parameter 'body' is not null or undefined (0, common_1.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, common_1.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 (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; if (authorization != null) { localVarHeaderParameter['Authorization'] = String(authorization); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration); return { url: (0, common_1.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 (0, common_1.assertParamExists)('showBackup', 'installId', installId); // verify required parameter 'backupId' is not null or undefined (0, common_1.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, common_1.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 (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration); if (authorization != null) { localVarHeaderParameter['Authorization'] = String(authorization); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.BackupApiAxiosParamCreator = BackupApiAxiosParamCreator; /** * BackupApi - functional programming interface * @export */ const BackupApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.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 = base_1.operationServerMap['BackupApi.createBackup']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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 = base_1.operationServerMap['BackupApi.showBackup']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; exports.BackupApiFp = BackupApiFp; /** * BackupApi - factory interface * @export */ const BackupApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.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 local