@elasticapi/wpengine-typescript-sdk
Version:
Unofficial TypeScript SDK for the WP Engine API
1,678 lines (1,604 loc) • 201 kB
text/typescript
/* 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 type { Configuration } from './configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
import type { RequestArgs } from './base';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
/**
*
* @export
* @interface Account
*/
export interface Account {
/**
*
* @type {string}
* @memberof Account
*/
'id': string;
/**
* The account name
* @type {string}
* @memberof Account
*/
'name': string;
}
/**
*
* @export
* @interface AccountUser
*/
export interface AccountUser {
/**
* The user ID
* @type {string}
* @memberof AccountUser
*/
'user_id': string;
/**
* The account ID
* @type {string}
* @memberof AccountUser
*/
'account_id': string;
/**
* The first name of the user
* @type {string}
* @memberof AccountUser
*/
'first_name': string;
/**
* The last name of the user
* @type {string}
* @memberof AccountUser
*/
'last_name': string;
/**
* The email of the user
* @type {string}
* @memberof AccountUser
*/
'email': string;
/**
* The phone number of the user
* @type {string}
* @memberof AccountUser
*/
'phone': string | null;
/**
* Whether or not the user has accepted their invitation
* @type {boolean}
* @memberof AccountUser
*/
'invite_accepted': boolean;
/**
* Whether or not the user has multi-factor authentication enabled
* @type {boolean}
* @memberof AccountUser
*/
'mfa_enabled': boolean;
/**
* The user roles
* @type {string}
* @memberof AccountUser
*/
'roles': string;
/**
* Whether or not this owner is the last on the account. Only shows with users that have owner level roles.
* @type {boolean}
* @memberof AccountUser
*/
'last_owner'?: boolean | null;
/**
* An array of installs tied to a partial user.
* @type {Array<AccountUserInstallsInner>}
* @memberof AccountUser
*/
'installs'?: Array<AccountUserInstallsInner> | null;
}
/**
*
* @export
* @interface AccountUserInstallsInner
*/
export interface AccountUserInstallsInner {
/**
* The ID of the install
* @type {string}
* @memberof AccountUserInstallsInner
*/
'id'?: string;
/**
* The name of the install
* @type {string}
* @memberof AccountUserInstallsInner
*/
'name'?: string;
}
/**
*
* @export
* @interface AuthenticationErrorResponse
*/
export interface AuthenticationErrorResponse {
/**
* A message regarding the error that occurred on the server
* @type {string}
* @memberof AuthenticationErrorResponse
*/
'message': string;
/**
* (Optional) A URL where documentation regarding this specific error can be found
* @type {string}
* @memberof AuthenticationErrorResponse
*/
'documentation_url'?: string;
}
/**
*
* @export
* @interface Backup
*/
export interface Backup {
/**
*
* @type {string}
* @memberof Backup
*/
'id'?: string;
/**
*
* @type {string}
* @memberof Backup
*/
'status'?: string;
}
/**
*
* @export
* @interface BadRequestErrorResponse
*/
export interface BadRequestErrorResponse {
/**
* A message regarding the error that occurred on the server
* @type {string}
* @memberof BadRequestErrorResponse
*/
'message': string;
/**
* (Optional) A URL where documentation regarding this specific error can be found
* @type {string}
* @memberof BadRequestErrorResponse
*/
'documentation_url'?: string;
/**
* An array of error objects describing specific errors that arose when servicing the request
* @type {Array<ResourceError>}
* @memberof BadRequestErrorResponse
*/
'errors'?: Array<ResourceError>;
}
/**
*
* @export
* @interface CheckStatus429Response
*/
export interface CheckStatus429Response {
/**
* A message regarding the error that occurred on the server
* @type {string}
* @memberof CheckStatus429Response
*/
'message': string;
}
/**
*
* @export
* @interface CreateAccountUser201Response
*/
export interface CreateAccountUser201Response {
/**
*
* @type {string}
* @memberof CreateAccountUser201Response
*/
'message'?: string;
/**
*
* @type {AccountUser}
* @memberof CreateAccountUser201Response
*/
'account_user'?: AccountUser;
}
/**
*
* @export
* @interface CreateAccountUserRequest
*/
export interface CreateAccountUserRequest {
/**
*
* @type {CreateAccountUserRequestUser}
* @memberof CreateAccountUserRequest
*/
'user': CreateAccountUserRequestUser;
}
/**
* The user that will be created
* @export
* @interface CreateAccountUserRequestUser
*/
export interface CreateAccountUserRequestUser {
/**
* The account ID
* @type {string}
* @memberof CreateAccountUserRequestUser
*/
'account_id': string;
/**
*
* @type {string}
* @memberof CreateAccountUserRequestUser
*/
'first_name': string;
/**
*
* @type {string}
* @memberof CreateAccountUserRequestUser
*/
'last_name': string;
/**
*
* @type {string}
* @memberof CreateAccountUserRequestUser
*/
'email': string;
/**
* choose from \'owner\', \'full,billing\', \'full\', \'partial,billing\', and \'partial\'
* @type {string}
* @memberof CreateAccountUserRequestUser
*/
'roles': string;
/**
*
* @type {Array<string>}
* @memberof CreateAccountUserRequestUser
*/
'install_ids'?: Array<string>;
}
/**
*
* @export
* @interface CreateBackupRequest
*/
export interface CreateBackupRequest {
/**
* A description of this backup.
* @type {string}
* @memberof CreateBackupRequest
*/
'description': string;
/**
* The email address(es) that will receive an email once the backup has completed.
* @type {Array<string>}
* @memberof CreateBackupRequest
*/
'notification_emails': Array<string>;
}
/**
*
* @export
* @interface CreateBulkDomainsRequest
*/
export interface CreateBulkDomainsRequest {
/**
*
* @type {Array<CreateBulkDomainsRequestDomainsInner>}
* @memberof CreateBulkDomainsRequest
*/
'domains': Array<CreateBulkDomainsRequestDomainsInner>;
}
/**
*
* @export
* @interface CreateBulkDomainsRequestDomainsInner
*/
export interface CreateBulkDomainsRequestDomainsInner {
/**
*
* @type {string}
* @memberof CreateBulkDomainsRequestDomainsInner
*/
'name': string;
/**
*
* @type {string}
* @memberof CreateBulkDomainsRequestDomainsInner
*/
'redirect_to'?: string;
}
/**
*
* @export
* @interface CreateDomainRequest
*/
export interface CreateDomainRequest {
/**
*
* @type {string}
* @memberof CreateDomainRequest
*/
'name': string;
/**
*
* @type {boolean}
* @memberof CreateDomainRequest
*/
'primary'?: boolean;
/**
*
* @type {string}
* @memberof CreateDomainRequest
*/
'redirect_to'?: string;
}
/**
*
* @export
* @interface CreateInstallRequest
*/
export interface CreateInstallRequest {
/**
* The name of the install
* @type {string}
* @memberof CreateInstallRequest
*/
'name': string;
/**
* The ID of the account that the install will belong to
* @type {string}
* @memberof CreateInstallRequest
*/
'account_id': string;
/**
* The ID of the site that the install will belong to
* @type {string}
* @memberof CreateInstallRequest
*/
'site_id'?: string | null;
/**
* The site environment that the install will fill
* @type {string}
* @memberof CreateInstallRequest
*/
'environment'?: CreateInstallRequestEnvironmentEnum | null;
}
export const CreateInstallRequestEnvironmentEnum = {
Production: 'production',
Staging: 'staging',
Development: 'development'
} as const;
export type CreateInstallRequestEnvironmentEnum = typeof CreateInstallRequestEnvironmentEnum[keyof typeof CreateInstallRequestEnvironmentEnum];
/**
*
* @export
* @interface CreateSiteRequest
*/
export interface CreateSiteRequest {
/**
*
* @type {string}
* @memberof CreateSiteRequest
*/
'name': string;
/**
* The account ID
* @type {string}
* @memberof CreateSiteRequest
*/
'account_id': string;
}
/**
*
* @export
* @interface CreateSshKeyRequest
*/
export interface CreateSshKeyRequest {
/**
*
* @type {string}
* @memberof CreateSshKeyRequest
*/
'public_key': string;
}
/**
*
* @export
* @interface Domain
*/
export interface Domain {
/**
*
* @type {string}
* @memberof Domain
*/
'name': string;
/**
*
* @type {boolean}
* @memberof Domain
*/
'duplicate': boolean;
/**
*
* @type {boolean}
* @memberof Domain
*/
'primary': boolean;
/**
*
* @type {string}
* @memberof Domain
*/
'id': string;
/**
*
* @type {Array<DomainRedirectsToInner>}
* @memberof Domain
*/
'redirects_to'?: Array<DomainRedirectsToInner>;
}
/**
*
* @export
* @interface DomainOrRedirect
*/
export interface DomainOrRedirect {
/**
*
* @type {string}
* @memberof DomainOrRedirect
*/
'id': string;
/**
*
* @type {string}
* @memberof DomainOrRedirect
*/
'name': string;
/**
*
* @type {boolean}
* @memberof DomainOrRedirect
*/
'duplicate': boolean;
/**
*
* @type {boolean}
* @memberof DomainOrRedirect
*/
'primary': boolean;
/**
*
* @type {DomainRedirectsToInner}
* @memberof DomainOrRedirect
*/
'redirects_to'?: DomainRedirectsToInner;
}
/**
*
* @export
* @interface DomainRedirectsToInner
*/
export interface DomainRedirectsToInner {
/**
*
* @type {string}
* @memberof DomainRedirectsToInner
*/
'id'?: string;
/**
*
* @type {string}
* @memberof DomainRedirectsToInner
*/
'name'?: string;
}
/**
*
* @export
* @interface ForbiddenErrorResponse
*/
export interface ForbiddenErrorResponse {
/**
* A message regarding the error that occurred on the server
* @type {string}
* @memberof ForbiddenErrorResponse
*/
'message': string;
/**
* (Optional) A URL where documentation regarding this specific error can be found
* @type {string}
* @memberof ForbiddenErrorResponse
*/
'documentation_url'?: string;
}
/**
*
* @export
* @interface Installation
*/
export interface Installation {
/**
*
* @type {string}
* @memberof Installation
*/
'id': string;
/**
*
* @type {string}
* @memberof Installation
*/
'name': string;
/**
*
* @type {InstallationAccount}
* @memberof Installation
*/
'account': InstallationAccount;
/**
* The PHP version used to run WordPress (read-only)
* @type {string}
* @memberof Installation
*/
'php_version': string | null;
/**
*
* @type {string}
* @memberof Installation
*/
'status'?: InstallationStatusEnum;
/**
*
* @type {InstallationSite}
* @memberof Installation
*/
'site'?: InstallationSite | null;
/**
* Returns the CNAME of the install
* @type {string}
* @memberof Installation
*/
'cname'?: string;
/**
* A list of stable IPs bound to the install. This will only apply to some premium/enterprise plans
* @type {Array<string>}
* @memberof Installation
*/
'stable_ips'?: Array<string> | null;
/**
*
* @type {string}
* @memberof Installation
*/
'environment'?: InstallationEnvironmentEnum | null;
/**
* The primary domain for the install.
* @type {string}
* @memberof Installation
*/
'primary_domain'?: string | null;
/**
*
* @type {boolean}
* @memberof Installation
*/
'is_multisite'?: boolean | null;
}
export const InstallationStatusEnum = {
Active: 'active',
Pending: 'pending'
} as const;
export type InstallationStatusEnum = typeof InstallationStatusEnum[keyof typeof InstallationStatusEnum];
export const InstallationEnvironmentEnum = {
Production: 'production',
Staging: 'staging',
Development: 'development'
} as const;
export type InstallationEnvironmentEnum = typeof InstallationEnvironmentEnum[keyof typeof InstallationEnvironmentEnum];
/**
*
* @export
* @interface InstallationAccount
*/
export interface InstallationAccount {
/**
* The account ID
* @type {string}
* @memberof InstallationAccount
*/
'id'?: string;
}
/**
*
* @export
* @interface InstallationSite
*/
export interface InstallationSite {
/**
*
* @type {string}
* @memberof InstallationSite
*/
'id'?: string;
}
/**
*
* @export
* @interface InternalServerErrorResponse
*/
export interface InternalServerErrorResponse {
/**
* A message regarding the error that occurred on the server
* @type {string}
* @memberof InternalServerErrorResponse
*/
'message': string;
}
/**
*
* @export
* @interface ListAccountUsers200Response
*/
export interface ListAccountUsers200Response {
/**
*
* @type {Array<AccountUser>}
* @memberof ListAccountUsers200Response
*/
'results'?: Array<AccountUser>;
}
/**
*
* @export
* @interface ListAccounts200Response
*/
export interface ListAccounts200Response {
/**
* Path to the previous page of results
* @type {string}
* @memberof ListAccounts200Response
*/
'previous'?: string | null;
/**
* Path to the next page of results
* @type {string}
* @memberof ListAccounts200Response
*/
'next'?: string | null;
/**
* The total number of results
* @type {number}
* @memberof ListAccounts200Response
*/
'count'?: number;
/**
*
* @type {Array<Account>}
* @memberof ListAccounts200Response
*/
'results'?: Array<Account>;
}
/**
*
* @export
* @interface ListDomains200Response
*/
export interface ListDomains200Response {
/**
* Path to the previous page of results
* @type {string}
* @memberof ListDomains200Response
*/
'previous'?: string | null;
/**
* Path to the next page of results
* @type {string}
* @memberof ListDomains200Response
*/
'next'?: string | null;
/**
* The total number of results
* @type {number}
* @memberof ListDomains200Response
*/
'count'?: number;
/**
*
* @type {Array<Domain>}
* @memberof ListDomains200Response
*/
'results'?: Array<Domain>;
}
/**
*
* @export
* @interface ListInstalls200Response
*/
export interface ListInstalls200Response {
/**
* Path to the previous page of results
* @type {string}
* @memberof ListInstalls200Response
*/
'previous'?: string | null;
/**
* Path to the next page of results
* @type {string}
* @memberof ListInstalls200Response
*/
'next'?: string | null;
/**
* The total number of results
* @type {number}
* @memberof ListInstalls200Response
*/
'count'?: number;
/**
*
* @type {Array<Installation>}
* @memberof ListInstalls200Response
*/
'results'?: Array<Installation>;
}
/**
*
* @export
* @interface ListSites200Response
*/
export interface ListSites200Response {
/**
* Path to the previous page of results
* @type {string}
* @memberof ListSites200Response
*/
'previous'?: string | null;
/**
* Path to the next page of results
* @type {string}
* @memberof ListSites200Response
*/
'next'?: string | null;
/**
* The total number of results
* @type {number}
* @memberof ListSites200Response
*/
'count'?: number;
/**
*
* @type {Array<Site>}
* @memberof ListSites200Response
*/
'results'?: Array<Site>;
}
/**
*
* @export
* @interface ListSshKeys200Response
*/
export interface ListSshKeys200Response {
/**
* Path to the previous page of results
* @type {string}
* @memberof ListSshKeys200Response
*/
'previous'?: string | null;
/**
* Path to the next page of results
* @type {string}
* @memberof ListSshKeys200Response
*/
'next'?: string | null;
/**
* The total number of results
* @type {number}
* @memberof ListSshKeys200Response
*/
'count'?: number;
/**
*
* @type {Array<SshKey>}
* @memberof ListSshKeys200Response
*/
'results'?: Array<SshKey>;
}
/**
*
* @export
* @interface NotFoundErrorResponse
*/
export interface NotFoundErrorResponse {
/**
* A message regarding the error that occurred on the server
* @type {string}
* @memberof NotFoundErrorResponse
*/
'message': string;
/**
* (Optional) A URL where documentation regarding this specific error can be found
* @type {string}
* @memberof NotFoundErrorResponse
*/
'documentation_url'?: string;
}
/**
*
* @export
* @interface PurgeCache429Response
*/
export interface PurgeCache429Response {
/**
* A message regarding the error that occurred on the server
* @type {string}
* @memberof PurgeCache429Response
*/
'message': string;
}
/**
*
* @export
* @interface PurgeCacheRequest
*/
export interface PurgeCacheRequest {
/**
*
* @type {string}
* @memberof PurgeCacheRequest
*/
'type': PurgeCacheRequestTypeEnum;
}
export const PurgeCacheRequestTypeEnum = {
Object: 'object',
Page: 'page',
Cdn: 'cdn'
} as const;
export type PurgeCacheRequestTypeEnum = typeof PurgeCacheRequestTypeEnum[keyof typeof PurgeCacheRequestTypeEnum];
/**
*
* @export
* @interface ResourceError
*/
export interface ResourceError {
/**
* The name of the resource that was being processed when the error occurred
* @type {string}
* @memberof ResourceError
*/
'resource': string;
/**
* (Optional) The specific field associated with the error
* @type {string}
* @memberof ResourceError
*/
'field': string;
/**
* (Optional) A type associated with the error. `invalid_value`, `access_error`, `value_unavailable`
* @type {string}
* @memberof ResourceError
*/
'type': string;
/**
* (Optional) A machine code relating to the error that occurred with the field and resource
* @type {string}
* @memberof ResourceError
*/
'code': string;
/**
* (Optional) A human-readable message relating to the error that occurred with the field and resource
* @type {string}
* @memberof ResourceError
*/
'message': string;
}
/**
*
* @export
* @interface Site
*/
export interface Site {
/**
*
* @type {string}
* @memberof Site
*/
'id': string;
/**
*
* @type {string}
* @memberof Site
*/
'name': string;
/**
*
* @type {InstallationAccount}
* @memberof Site
*/
'account': InstallationAccount;
/**
*
* @type {string}
* @memberof Site
*/
'group_name'?: string | null;
/**
*
* @type {Array<string>}
* @memberof Site
*/
'tags'?: Array<string>;
/**
*
* @type {Array<SiteInstallsInner>}
* @memberof Site
*/
'installs'?: Array<SiteInstallsInner>;
}
/**
*
* @export
* @interface SiteInstallsInner
*/
export interface SiteInstallsInner {
/**
*
* @type {string}
* @memberof SiteInstallsInner
*/
'id'?: string;
/**
*
* @type {string}
* @memberof SiteInstallsInner
*/
'name'?: string;
/**
*
* @type {string}
* @memberof SiteInstallsInner
*/
'environment'?: SiteInstallsInnerEnvironmentEnum | null;
/**
* Returns the CNAME of the install
* @type {string}
* @memberof SiteInstallsInner
*/
'cname'?: string;
/**
* The PHP version used to run WordPress
* @type {string}
* @memberof SiteInstallsInner
*/
'php_version'?: string | null;
/**
*
* @type {boolean}
* @memberof SiteInstallsInner
*/
'is_multisite'?: boolean | null;
}
export const SiteInstallsInnerEnvironmentEnum = {
Production: 'production',
Staging: 'staging',
Development: 'development'
} as const;
export type SiteInstallsInnerEnvironmentEnum = typeof SiteInstallsInnerEnvironmentEnum[keyof typeof SiteInstallsInnerEnvironmentEnum];
/**
*
* @export
* @interface SshKey
*/
export interface SshKey {
/**
*
* @type {string}
* @memberof SshKey
*/
'comment'?: string;
/**
*
* @type {string}
* @memberof SshKey
*/
'created_at'?: string;
/**
*
* @type {string}
* @memberof SshKey
*/
'fingerprint'?: string;
/**
*
* @type {string}
* @memberof SshKey
*/
'uuid'?: string;
}
/**
*
* @export
* @interface Status
*/
export interface Status {
/**
*
* @type {boolean}
* @memberof Status
*/
'success'?: boolean;
/**
* The time when the status was requested in rfc3339 format
* @type {string}
* @memberof Status
*/
'created_on'?: string;
}
/**
*
* @export
* @interface UpdateAccountUserRequest
*/
export interface UpdateAccountUserRequest {
/**
* choose from \'owner\', \'full,billing\', \'full\', \'partial,billing\', and \'partial\'
* @type {string}
* @memberof UpdateAccountUserRequest
*/
'roles': string;
/**
*
* @type {Array<string>}
* @memberof UpdateAccountUserRequest
*/
'install_ids'?: Array<string>;
}
/**
*
* @export
* @interface UpdateDomainRequest
*/
export interface UpdateDomainRequest {
/**
*
* @type {boolean}
* @memberof UpdateDomainRequest
*/
'primary'?: boolean;
/**
*
* @type {string}
* @memberof UpdateDomainRequest
*/
'redirect_to'?: string;
}
/**
*
* @export
* @interface UpdateInstallRequest
*/
export interface UpdateInstallRequest {
/**
* The site ID
* @type {string}
* @memberof UpdateInstallRequest
*/
'site_id'?: string;
/**
*
* @type {string}
* @memberof UpdateInstallRequest
*/
'environment'?: UpdateInstallRequestEnvironmentEnum | null;
}
export const UpdateInstallRequestEnvironmentEnum = {
Production: 'production',
Staging: 'staging',
Development: 'development'
} as const;
export type UpdateInstallRequestEnvironmentEnum = typeof UpdateInstallRequestEnvironmentEnum[keyof typeof UpdateInstallRequestEnvironmentEnum];
/**
*
* @export
* @interface UpdateSiteRequest
*/
export interface UpdateSiteRequest {
/**
* The new site name
* @type {string}
* @memberof UpdateSiteRequest
*/
'name'?: string;
}
/**
*
* @export
* @interface User
*/
export interface User {
/**
*
* @type {string}
* @memberof User
*/
'id': string;
/**
*
* @type {string}
* @memberof User
*/
'first_name'?: string;
/**
*
* @type {string}
* @memberof User
*/
'last_name'?: string;
/**
*
* @type {string}
* @memberof User
*/
'email': string;
/**
*
* @type {string}
* @memberof User
*/
'phone_number'?: string | null;
}
/**
* AccountApi - axios parameter creator
* @export
*/
export const AccountApiAxiosParamCreator = function (configuration?: 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: string, authorization?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// 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 = {} as any;
const localVarQueryParameter = {} as any;
// 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?: string, limit?: number, offset?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
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 = {} as any;
const localVarQueryParameter = {} as any;
// 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?: 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: string, authorization?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Account>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getAccount(accountId, authorization, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['AccountApi.getAccount']?.[localVarOperationServerIndex]?.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?: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListAccounts200Response>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listAccounts(authorization, limit, offset, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['AccountApi.listAccounts']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
/**
* AccountApi - factory interface
* @export
*/
export const AccountApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
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: string, authorization?: string, options?: RawAxiosRequestConfig): AxiosPromise<Account> {
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?: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig): AxiosPromise<ListAccounts200Response> {
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
*/
public getAccount(accountId: string, authorization?: string, options?: RawAxiosRequestConfig) {
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
*/
public listAccounts(authorization?: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig) {
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?: 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: string, body: CreateAccountUserRequest, authorization?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// 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 = {} as any;
const localVarQueryParameter = {} as any;
// 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: string, userId: string, authorization?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// 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 = {} as any;
const localVarQueryParameter = {} as any;
// 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: string, userId: string, authorization?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// 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 = {} as any;
const localVarQueryParameter = {} as any;
// 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: string, authorization?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// 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 = {} as any;
const localVarQueryParameter = {} as any;
// 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: string, userId: string, body: UpdateAccountUserRequest, authorization?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// 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 = {} as any;
const localVarQueryParameter = {} as any;
// 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?: 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: string, body: CreateAccountUserRequest, authorization?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateAccountUser201Response>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createAccountUser(accountId, body, authorization, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['AccountUserApi.createAccountUser']?.[localVarOperationServerIndex]?.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: string, userId: string, authorization?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosIns