/* tslint:disable */ /* eslint-disable */ /** * ForestVPN Cloud API * ForestVPN Cloud - it's a Google Cloud but for VPN apps. Ready to use VPN Cloud Platform minimizes efforts to build fast, secure, and modern VPN apps. * * OpenAPI spec version: 2.0 * Contact: support@forestvpn.com * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; import { CreateOrUpdateProfileRequest } from '../models'; import { Profile } from '../models'; import { ProfileStats } from '../models'; /** * ProfilesApi - axios parameter creator * @export */ export const ProfilesApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @summary Create profile * @param {string} X_Project_Id * @param {CreateOrUpdateProfileRequest} [body] * @param {string} [search] Search by ID, profile ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ createProfile: async (X_Project_Id: string, body?: CreateOrUpdateProfileRequest, search?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'X_Project_Id' is not null or undefined if (X_Project_Id === null || X_Project_Id === undefined) { throw new RequiredError('X_Project_Id','Required parameter X_Project_Id was null or undefined when calling createProfile.'); } const localVarPath = `/profiles/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiTokenAuth required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-API-TOKEN") : await configuration.apiKey; localVarHeaderParameter["X-API-TOKEN"] = localVarApiKeyValue; } // authentication BearerTokenAuth required if (search !== undefined) { localVarQueryParameter['search'] = search; } if (X_Project_Id !== undefined && X_Project_Id !== null) { localVarHeaderParameter['X-Project-Id'] = String(X_Project_Id); } localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Deletes profile and all associated resources * @summary Delete profile * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteProfile: async (X_Project_Id: string, profileId: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'X_Project_Id' is not null or undefined if (X_Project_Id === null || X_Project_Id === undefined) { throw new RequiredError('X_Project_Id','Required parameter X_Project_Id was null or undefined when calling deleteProfile.'); } // verify required parameter 'profileId' is not null or undefined if (profileId === null || profileId === undefined) { throw new RequiredError('profileId','Required parameter profileId was null or undefined when calling deleteProfile.'); } const localVarPath = `/profiles/{profileId}/` .replace(`{${"profileId"}}`, encodeURIComponent(String(profileId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiTokenAuth required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-API-TOKEN") : await configuration.apiKey; localVarHeaderParameter["X-API-TOKEN"] = localVarApiKeyValue; } // authentication BearerTokenAuth required if (X_Project_Id !== undefined && X_Project_Id !== null) { localVarHeaderParameter['X-Project-Id'] = String(X_Project_Id); } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Profile details * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProfile: async (X_Project_Id: string, profileId: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'X_Project_Id' is not null or undefined if (X_Project_Id === null || X_Project_Id === undefined) { throw new RequiredError('X_Project_Id','Required parameter X_Project_Id was null or undefined when calling getProfile.'); } // verify required parameter 'profileId' is not null or undefined if (profileId === null || profileId === undefined) { throw new RequiredError('profileId','Required parameter profileId was null or undefined when calling getProfile.'); } const localVarPath = `/profiles/{profileId}/` .replace(`{${"profileId"}}`, encodeURIComponent(String(profileId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiTokenAuth required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-API-TOKEN") : await configuration.apiKey; localVarHeaderParameter["X-API-TOKEN"] = localVarApiKeyValue; } // authentication BearerTokenAuth required if (X_Project_Id !== undefined && X_Project_Id !== null) { localVarHeaderParameter['X-Project-Id'] = String(X_Project_Id); } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Profile stats list * @param {string} X_Project_Id * @param {string} profileId * @param {string} [aggregate_by] * @param {string} [date_after] * @param {string} [date_before] * @param {number} [per_page] * @param {number} [page] * @param {*} [options] Override http request option. * @throws {RequiredError} */ listProfileStats: async (X_Project_Id: string, profileId: string, aggregate_by?: string, date_after?: string, date_before?: string, per_page?: number, page?: number, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'X_Project_Id' is not null or undefined if (X_Project_Id === null || X_Project_Id === undefined) { throw new RequiredError('X_Project_Id','Required parameter X_Project_Id was null or undefined when calling listProfileStats.'); } // verify required parameter 'profileId' is not null or undefined if (profileId === null || profileId === undefined) { throw new RequiredError('profileId','Required parameter profileId was null or undefined when calling listProfileStats.'); } const localVarPath = `/profiles/{profileId}/stats/` .replace(`{${"profileId"}}`, encodeURIComponent(String(profileId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiTokenAuth required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-API-TOKEN") : await configuration.apiKey; localVarHeaderParameter["X-API-TOKEN"] = localVarApiKeyValue; } // authentication BearerTokenAuth required if (aggregate_by !== undefined) { localVarQueryParameter['aggregate_by'] = aggregate_by; } if (date_after !== undefined) { localVarQueryParameter['date_after'] = (date_after as any instanceof Date) ? (date_after as any).toISOString().substr(0,10) : date_after; } if (date_before !== undefined) { localVarQueryParameter['date_before'] = (date_before as any instanceof Date) ? (date_before as any).toISOString().substr(0,10) : date_before; } if (per_page !== undefined) { localVarQueryParameter['per_page'] = per_page; } if (page !== undefined) { localVarQueryParameter['page'] = page; } if (X_Project_Id !== undefined && X_Project_Id !== null) { localVarHeaderParameter['X-Project-Id'] = String(X_Project_Id); } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Profile list * @param {string} X_Project_Id * @param {string} [external_key] * @param {number} [per_page] * @param {number} [page] * @param {string} [ordering] Sort output by (use \"-\" for desc ordering (i.g \"-first_name\")) * @param {*} [options] Override http request option. * @throws {RequiredError} */ listProfiles: async (X_Project_Id: string, external_key?: string, per_page?: number, page?: number, ordering?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'X_Project_Id' is not null or undefined if (X_Project_Id === null || X_Project_Id === undefined) { throw new RequiredError('X_Project_Id','Required parameter X_Project_Id was null or undefined when calling listProfiles.'); } const localVarPath = `/profiles/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiTokenAuth required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-API-TOKEN") : await configuration.apiKey; localVarHeaderParameter["X-API-TOKEN"] = localVarApiKeyValue; } // authentication BearerTokenAuth required if (external_key !== undefined) { localVarQueryParameter['external_key'] = external_key; } if (per_page !== undefined) { localVarQueryParameter['per_page'] = per_page; } if (page !== undefined) { localVarQueryParameter['page'] = page; } if (ordering !== undefined) { localVarQueryParameter['ordering'] = ordering; } if (X_Project_Id !== undefined && X_Project_Id !== null) { localVarHeaderParameter['X-Project-Id'] = String(X_Project_Id); } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Partial update profile details * @param {CreateOrUpdateProfileRequest} body * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} */ partialUpdateProfile: async (body: CreateOrUpdateProfileRequest, X_Project_Id: string, profileId: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling partialUpdateProfile.'); } // verify required parameter 'X_Project_Id' is not null or undefined if (X_Project_Id === null || X_Project_Id === undefined) { throw new RequiredError('X_Project_Id','Required parameter X_Project_Id was null or undefined when calling partialUpdateProfile.'); } // verify required parameter 'profileId' is not null or undefined if (profileId === null || profileId === undefined) { throw new RequiredError('profileId','Required parameter profileId was null or undefined when calling partialUpdateProfile.'); } const localVarPath = `/profiles/{profileId}/` .replace(`{${"profileId"}}`, encodeURIComponent(String(profileId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiTokenAuth required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-API-TOKEN") : await configuration.apiKey; localVarHeaderParameter["X-API-TOKEN"] = localVarApiKeyValue; } // authentication BearerTokenAuth required if (X_Project_Id !== undefined && X_Project_Id !== null) { localVarHeaderParameter['X-Project-Id'] = String(X_Project_Id); } localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Profile config * @param {string} X_Project_Id * @param {string} profileId * @param {string} [config] Config type (\"wireguard\" by default) * @param {string} [peer] Node Binding ID * @param {boolean} [file] Set true if downloand required * @param {*} [options] Override http request option. * @throws {RequiredError} */ profileConfig: async (X_Project_Id: string, profileId: string, config?: string, peer?: string, file?: boolean, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'X_Project_Id' is not null or undefined if (X_Project_Id === null || X_Project_Id === undefined) { throw new RequiredError('X_Project_Id','Required parameter X_Project_Id was null or undefined when calling profileConfig.'); } // verify required parameter 'profileId' is not null or undefined if (profileId === null || profileId === undefined) { throw new RequiredError('profileId','Required parameter profileId was null or undefined when calling profileConfig.'); } const localVarPath = `/profiles/{profileId}/config/` .replace(`{${"profileId"}}`, encodeURIComponent(String(profileId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiTokenAuth required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-API-TOKEN") : await configuration.apiKey; localVarHeaderParameter["X-API-TOKEN"] = localVarApiKeyValue; } // authentication BearerTokenAuth required if (config !== undefined) { localVarQueryParameter['config'] = config; } if (peer !== undefined) { localVarQueryParameter['peer'] = peer; } if (file !== undefined) { localVarQueryParameter['file'] = file; } if (X_Project_Id !== undefined && X_Project_Id !== null) { localVarHeaderParameter['X-Project-Id'] = String(X_Project_Id); } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Update profile details * @param {CreateOrUpdateProfileRequest} body * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateProfile: async (body: CreateOrUpdateProfileRequest, X_Project_Id: string, profileId: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling updateProfile.'); } // verify required parameter 'X_Project_Id' is not null or undefined if (X_Project_Id === null || X_Project_Id === undefined) { throw new RequiredError('X_Project_Id','Required parameter X_Project_Id was null or undefined when calling updateProfile.'); } // verify required parameter 'profileId' is not null or undefined if (profileId === null || profileId === undefined) { throw new RequiredError('profileId','Required parameter profileId was null or undefined when calling updateProfile.'); } const localVarPath = `/profiles/{profileId}/` .replace(`{${"profileId"}}`, encodeURIComponent(String(profileId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiTokenAuth required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-API-TOKEN") : await configuration.apiKey; localVarHeaderParameter["X-API-TOKEN"] = localVarApiKeyValue; } // authentication BearerTokenAuth required if (X_Project_Id !== undefined && X_Project_Id !== null) { localVarHeaderParameter['X-Project-Id'] = String(X_Project_Id); } localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, } }; /** * ProfilesApi - functional programming interface * @export */ export const ProfilesApiFp = function(configuration?: Configuration) { return { /** * * @summary Create profile * @param {string} X_Project_Id * @param {CreateOrUpdateProfileRequest} [body] * @param {string} [search] Search by ID, profile ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createProfile(X_Project_Id: string, body?: CreateOrUpdateProfileRequest, search?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await ProfilesApiAxiosParamCreator(configuration).createProfile(X_Project_Id, body, search, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Deletes profile and all associated resources * @summary Delete profile * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteProfile(X_Project_Id: string, profileId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await ProfilesApiAxiosParamCreator(configuration).deleteProfile(X_Project_Id, profileId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Profile details * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getProfile(X_Project_Id: string, profileId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await ProfilesApiAxiosParamCreator(configuration).getProfile(X_Project_Id, profileId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Profile stats list * @param {string} X_Project_Id * @param {string} profileId * @param {string} [aggregate_by] * @param {string} [date_after] * @param {string} [date_before] * @param {number} [per_page] * @param {number} [page] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listProfileStats(X_Project_Id: string, profileId: string, aggregate_by?: string, date_after?: string, date_before?: string, per_page?: number, page?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>>> { const localVarAxiosArgs = await ProfilesApiAxiosParamCreator(configuration).listProfileStats(X_Project_Id, profileId, aggregate_by, date_after, date_before, per_page, page, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Profile list * @param {string} X_Project_Id * @param {string} [external_key] * @param {number} [per_page] * @param {number} [page] * @param {string} [ordering] Sort output by (use \"-\" for desc ordering (i.g \"-first_name\")) * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listProfiles(X_Project_Id: string, external_key?: string, per_page?: number, page?: number, ordering?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>>> { const localVarAxiosArgs = await ProfilesApiAxiosParamCreator(configuration).listProfiles(X_Project_Id, external_key, per_page, page, ordering, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Partial update profile details * @param {CreateOrUpdateProfileRequest} body * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async partialUpdateProfile(body: CreateOrUpdateProfileRequest, X_Project_Id: string, profileId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await ProfilesApiAxiosParamCreator(configuration).partialUpdateProfile(body, X_Project_Id, profileId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Profile config * @param {string} X_Project_Id * @param {string} profileId * @param {string} [config] Config type (\"wireguard\" by default) * @param {string} [peer] Node Binding ID * @param {boolean} [file] Set true if downloand required * @param {*} [options] Override http request option. * @throws {RequiredError} */ async profileConfig(X_Project_Id: string, profileId: string, config?: string, peer?: string, file?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await ProfilesApiAxiosParamCreator(configuration).profileConfig(X_Project_Id, profileId, config, peer, file, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Update profile details * @param {CreateOrUpdateProfileRequest} body * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateProfile(body: CreateOrUpdateProfileRequest, X_Project_Id: string, profileId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await ProfilesApiAxiosParamCreator(configuration).updateProfile(body, X_Project_Id, profileId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * ProfilesApi - factory interface * @export */ export const ProfilesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * * @summary Create profile * @param {string} X_Project_Id * @param {CreateOrUpdateProfileRequest} [body] * @param {string} [search] Search by ID, profile ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createProfile(X_Project_Id: string, body?: CreateOrUpdateProfileRequest, search?: string, options?: AxiosRequestConfig): Promise> { return ProfilesApiFp(configuration).createProfile(X_Project_Id, body, search, options).then((request) => request(axios, basePath)); }, /** * Deletes profile and all associated resources * @summary Delete profile * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteProfile(X_Project_Id: string, profileId: string, options?: AxiosRequestConfig): Promise> { return ProfilesApiFp(configuration).deleteProfile(X_Project_Id, profileId, options).then((request) => request(axios, basePath)); }, /** * * @summary Profile details * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getProfile(X_Project_Id: string, profileId: string, options?: AxiosRequestConfig): Promise> { return ProfilesApiFp(configuration).getProfile(X_Project_Id, profileId, options).then((request) => request(axios, basePath)); }, /** * * @summary Profile stats list * @param {string} X_Project_Id * @param {string} profileId * @param {string} [aggregate_by] * @param {string} [date_after] * @param {string} [date_before] * @param {number} [per_page] * @param {number} [page] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listProfileStats(X_Project_Id: string, profileId: string, aggregate_by?: string, date_after?: string, date_before?: string, per_page?: number, page?: number, options?: AxiosRequestConfig): Promise>> { return ProfilesApiFp(configuration).listProfileStats(X_Project_Id, profileId, aggregate_by, date_after, date_before, per_page, page, options).then((request) => request(axios, basePath)); }, /** * * @summary Profile list * @param {string} X_Project_Id * @param {string} [external_key] * @param {number} [per_page] * @param {number} [page] * @param {string} [ordering] Sort output by (use \"-\" for desc ordering (i.g \"-first_name\")) * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listProfiles(X_Project_Id: string, external_key?: string, per_page?: number, page?: number, ordering?: string, options?: AxiosRequestConfig): Promise>> { return ProfilesApiFp(configuration).listProfiles(X_Project_Id, external_key, per_page, page, ordering, options).then((request) => request(axios, basePath)); }, /** * * @summary Partial update profile details * @param {CreateOrUpdateProfileRequest} body * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async partialUpdateProfile(body: CreateOrUpdateProfileRequest, X_Project_Id: string, profileId: string, options?: AxiosRequestConfig): Promise> { return ProfilesApiFp(configuration).partialUpdateProfile(body, X_Project_Id, profileId, options).then((request) => request(axios, basePath)); }, /** * * @summary Profile config * @param {string} X_Project_Id * @param {string} profileId * @param {string} [config] Config type (\"wireguard\" by default) * @param {string} [peer] Node Binding ID * @param {boolean} [file] Set true if downloand required * @param {*} [options] Override http request option. * @throws {RequiredError} */ async profileConfig(X_Project_Id: string, profileId: string, config?: string, peer?: string, file?: boolean, options?: AxiosRequestConfig): Promise> { return ProfilesApiFp(configuration).profileConfig(X_Project_Id, profileId, config, peer, file, options).then((request) => request(axios, basePath)); }, /** * * @summary Update profile details * @param {CreateOrUpdateProfileRequest} body * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateProfile(body: CreateOrUpdateProfileRequest, X_Project_Id: string, profileId: string, options?: AxiosRequestConfig): Promise> { return ProfilesApiFp(configuration).updateProfile(body, X_Project_Id, profileId, options).then((request) => request(axios, basePath)); }, }; }; /** * ProfilesApi - object-oriented interface * @export * @class ProfilesApi * @extends {BaseAPI} */ export class ProfilesApi extends BaseAPI { /** * * @summary Create profile * @param {string} X_Project_Id * @param {CreateOrUpdateProfileRequest} [body] * @param {string} [search] Search by ID, profile ID * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfilesApi */ public async createProfile(X_Project_Id: string, body?: CreateOrUpdateProfileRequest, search?: string, options?: AxiosRequestConfig) : Promise> { return ProfilesApiFp(this.configuration).createProfile(X_Project_Id, body, search, options).then((request) => request(this.axios, this.basePath)); } /** * Deletes profile and all associated resources * @summary Delete profile * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfilesApi */ public async deleteProfile(X_Project_Id: string, profileId: string, options?: AxiosRequestConfig) : Promise> { return ProfilesApiFp(this.configuration).deleteProfile(X_Project_Id, profileId, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Profile details * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfilesApi */ public async getProfile(X_Project_Id: string, profileId: string, options?: AxiosRequestConfig) : Promise> { return ProfilesApiFp(this.configuration).getProfile(X_Project_Id, profileId, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Profile stats list * @param {string} X_Project_Id * @param {string} profileId * @param {string} [aggregate_by] * @param {string} [date_after] * @param {string} [date_before] * @param {number} [per_page] * @param {number} [page] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfilesApi */ public async listProfileStats(X_Project_Id: string, profileId: string, aggregate_by?: string, date_after?: string, date_before?: string, per_page?: number, page?: number, options?: AxiosRequestConfig) : Promise>> { return ProfilesApiFp(this.configuration).listProfileStats(X_Project_Id, profileId, aggregate_by, date_after, date_before, per_page, page, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Profile list * @param {string} X_Project_Id * @param {string} [external_key] * @param {number} [per_page] * @param {number} [page] * @param {string} [ordering] Sort output by (use \"-\" for desc ordering (i.g \"-first_name\")) * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfilesApi */ public async listProfiles(X_Project_Id: string, external_key?: string, per_page?: number, page?: number, ordering?: string, options?: AxiosRequestConfig) : Promise>> { return ProfilesApiFp(this.configuration).listProfiles(X_Project_Id, external_key, per_page, page, ordering, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Partial update profile details * @param {CreateOrUpdateProfileRequest} body * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfilesApi */ public async partialUpdateProfile(body: CreateOrUpdateProfileRequest, X_Project_Id: string, profileId: string, options?: AxiosRequestConfig) : Promise> { return ProfilesApiFp(this.configuration).partialUpdateProfile(body, X_Project_Id, profileId, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Profile config * @param {string} X_Project_Id * @param {string} profileId * @param {string} [config] Config type (\"wireguard\" by default) * @param {string} [peer] Node Binding ID * @param {boolean} [file] Set true if downloand required * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfilesApi */ public async profileConfig(X_Project_Id: string, profileId: string, config?: string, peer?: string, file?: boolean, options?: AxiosRequestConfig) : Promise> { return ProfilesApiFp(this.configuration).profileConfig(X_Project_Id, profileId, config, peer, file, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Update profile details * @param {CreateOrUpdateProfileRequest} body * @param {string} X_Project_Id * @param {string} profileId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfilesApi */ public async updateProfile(body: CreateOrUpdateProfileRequest, X_Project_Id: string, profileId: string, options?: AxiosRequestConfig) : Promise> { return ProfilesApiFp(this.configuration).updateProfile(body, X_Project_Id, profileId, options).then((request) => request(this.axios, this.basePath)); } }