/* tslint:disable */ /* eslint-disable */ /** * Fireblocks API * Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) * * The version of the OpenAPI document: 1.6.2 * Contact: developers@fireblocks.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; import { convertToFireblocksResponse } from "../response/fireblocksResponse"; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from 'url'; // 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 { assertParamExistsAndNotEmpty } from '../utils/validation_utils'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { CreateUserGroupResponse } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { UserGroupCreateRequest } from '../models'; // @ts-ignore import { UserGroupCreateResponse } from '../models'; // @ts-ignore import { UserGroupResponse } from '../models'; // @ts-ignore import { UserGroupUpdateRequest } from '../models'; // @ts-ignore import { UserGroupsResponse } from '../models'; /** * UserGroupsBetaApi - axios parameter creator * @export */ export const UserGroupsBetaApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Create a new user group. Users with the Viewer role cannot be added to groups. Endpoint Permission: Admin, Non-Signing Admin. * @summary Create user group * @param {UserGroupCreateRequest} userGroupCreateRequest * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createUserGroup: async (userGroupCreateRequest: UserGroupCreateRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('createUserGroup', 'userGroupCreateRequest', userGroupCreateRequest) const localVarPath = `/management/user_groups`; // 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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'createUserGroup'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(userGroupCreateRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Delete a user group by ID. **Note**: - This endpoint is now in Beta, disabled for general availability at this time. - Please note that this endpoint is available only for API keys with Admin permissions. * @summary Delete user group * @param {string} groupId The ID of the user group * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteUserGroup: async (groupId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('deleteUserGroup', 'groupId', groupId) const localVarPath = `/management/user_groups/{groupId}` .replace(`{${"groupId"}}`, encodeURIComponent(String(groupId))); // 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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'deleteUserGroup'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get a user group by ID. **Note**: - This endpoint is now in Beta, disabled for general availability at this time. - Please note that this endpoint is available only for API keys with Admin permissions. * @summary Get user group * @param {string} groupId The ID of the user group * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUserGroup: async (groupId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getUserGroup', 'groupId', groupId) const localVarPath = `/management/user_groups/{groupId}` .replace(`{${"groupId"}}`, encodeURIComponent(String(groupId))); // 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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getUserGroup'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get all user groups in your workspace - Please note that this endpoint is available only for API keys with Admin/Non Signing Admin permissions. Endpoint Permission: Admin, Non-Signing Admin. * @summary List user groups * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUserGroups: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/management/user_groups`; // 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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getUserGroups'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Update a user group by ID. **Note**: - This endpoint is now in Beta, disabled for general availability at this time. - Please note that this endpoint is available only for API keys with Admin permissions. * @summary Update user group * @param {UserGroupUpdateRequest} userGroupUpdateRequest * @param {string} groupId The ID of the user group * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateUserGroup: async (userGroupUpdateRequest: UserGroupUpdateRequest, groupId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('updateUserGroup', 'userGroupUpdateRequest', userGroupUpdateRequest) assertParamExistsAndNotEmpty('updateUserGroup', 'groupId', groupId) const localVarPath = `/management/user_groups/{groupId}` .replace(`{${"groupId"}}`, encodeURIComponent(String(groupId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'updateUserGroup'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(userGroupUpdateRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * UserGroupsBetaApi - functional programming interface * @export */ export const UserGroupsBetaApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = UserGroupsBetaApiAxiosParamCreator(configuration) return { /** * Create a new user group. Users with the Viewer role cannot be added to groups. Endpoint Permission: Admin, Non-Signing Admin. * @summary Create user group * @param {UserGroupCreateRequest} userGroupCreateRequest * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createUserGroup(userGroupCreateRequest: UserGroupCreateRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createUserGroup(userGroupCreateRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['UserGroupsBetaApi.createUserGroup']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Delete a user group by ID. **Note**: - This endpoint is now in Beta, disabled for general availability at this time. - Please note that this endpoint is available only for API keys with Admin permissions. * @summary Delete user group * @param {string} groupId The ID of the user group * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteUserGroup(groupId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUserGroup(groupId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['UserGroupsBetaApi.deleteUserGroup']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Get a user group by ID. **Note**: - This endpoint is now in Beta, disabled for general availability at this time. - Please note that this endpoint is available only for API keys with Admin permissions. * @summary Get user group * @param {string} groupId The ID of the user group * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getUserGroup(groupId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserGroup(groupId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['UserGroupsBetaApi.getUserGroup']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Get all user groups in your workspace - Please note that this endpoint is available only for API keys with Admin/Non Signing Admin permissions. Endpoint Permission: Admin, Non-Signing Admin. * @summary List user groups * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getUserGroups(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserGroups(options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['UserGroupsBetaApi.getUserGroups']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Update a user group by ID. **Note**: - This endpoint is now in Beta, disabled for general availability at this time. - Please note that this endpoint is available only for API keys with Admin permissions. * @summary Update user group * @param {UserGroupUpdateRequest} userGroupUpdateRequest * @param {string} groupId The ID of the user group * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateUserGroup(userGroupUpdateRequest: UserGroupUpdateRequest, groupId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateUserGroup(userGroupUpdateRequest, groupId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['UserGroupsBetaApi.updateUserGroup']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * UserGroupsBetaApi - factory interface * @export */ export const UserGroupsBetaApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = UserGroupsBetaApiFp(configuration) return { /** * Create a new user group. Users with the Viewer role cannot be added to groups. Endpoint Permission: Admin, Non-Signing Admin. * @summary Create user group * @param {UserGroupsBetaApiCreateUserGroupRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createUserGroup(requestParameters: UserGroupsBetaApiCreateUserGroupRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUserGroup(requestParameters.userGroupCreateRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Delete a user group by ID. **Note**: - This endpoint is now in Beta, disabled for general availability at this time. - Please note that this endpoint is available only for API keys with Admin permissions. * @summary Delete user group * @param {UserGroupsBetaApiDeleteUserGroupRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteUserGroup(requestParameters: UserGroupsBetaApiDeleteUserGroupRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteUserGroup(requestParameters.groupId, options).then((request) => request(axios, basePath)); }, /** * Get a user group by ID. **Note**: - This endpoint is now in Beta, disabled for general availability at this time. - Please note that this endpoint is available only for API keys with Admin permissions. * @summary Get user group * @param {UserGroupsBetaApiGetUserGroupRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUserGroup(requestParameters: UserGroupsBetaApiGetUserGroupRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getUserGroup(requestParameters.groupId, options).then((request) => request(axios, basePath)); }, /** * Get all user groups in your workspace - Please note that this endpoint is available only for API keys with Admin/Non Signing Admin permissions. Endpoint Permission: Admin, Non-Signing Admin. * @summary List user groups * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUserGroups(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getUserGroups(options).then((request) => request(axios, basePath)); }, /** * Update a user group by ID. **Note**: - This endpoint is now in Beta, disabled for general availability at this time. - Please note that this endpoint is available only for API keys with Admin permissions. * @summary Update user group * @param {UserGroupsBetaApiUpdateUserGroupRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateUserGroup(requestParameters: UserGroupsBetaApiUpdateUserGroupRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateUserGroup(requestParameters.userGroupUpdateRequest, requestParameters.groupId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for createUserGroup operation in UserGroupsBetaApi. * @export * @interface UserGroupsBetaApiCreateUserGroupRequest */ export interface UserGroupsBetaApiCreateUserGroupRequest { /** * * @type {UserGroupCreateRequest} * @memberof UserGroupsBetaApiCreateUserGroup */ readonly userGroupCreateRequest: UserGroupCreateRequest /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof UserGroupsBetaApiCreateUserGroup */ readonly idempotencyKey?: string } /** * Request parameters for deleteUserGroup operation in UserGroupsBetaApi. * @export * @interface UserGroupsBetaApiDeleteUserGroupRequest */ export interface UserGroupsBetaApiDeleteUserGroupRequest { /** * The ID of the user group * @type {string} * @memberof UserGroupsBetaApiDeleteUserGroup */ readonly groupId: string } /** * Request parameters for getUserGroup operation in UserGroupsBetaApi. * @export * @interface UserGroupsBetaApiGetUserGroupRequest */ export interface UserGroupsBetaApiGetUserGroupRequest { /** * The ID of the user group * @type {string} * @memberof UserGroupsBetaApiGetUserGroup */ readonly groupId: string } /** * Request parameters for updateUserGroup operation in UserGroupsBetaApi. * @export * @interface UserGroupsBetaApiUpdateUserGroupRequest */ export interface UserGroupsBetaApiUpdateUserGroupRequest { /** * * @type {UserGroupUpdateRequest} * @memberof UserGroupsBetaApiUpdateUserGroup */ readonly userGroupUpdateRequest: UserGroupUpdateRequest /** * The ID of the user group * @type {string} * @memberof UserGroupsBetaApiUpdateUserGroup */ readonly groupId: string /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof UserGroupsBetaApiUpdateUserGroup */ readonly idempotencyKey?: string } /** * UserGroupsBetaApi - object-oriented interface * @export * @class UserGroupsBetaApi * @extends {BaseAPI} */ export class UserGroupsBetaApi extends BaseAPI { /** * Create a new user group. Users with the Viewer role cannot be added to groups. Endpoint Permission: Admin, Non-Signing Admin. * @summary Create user group * @param {UserGroupsBetaApiCreateUserGroupRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UserGroupsBetaApi */ public createUserGroup(requestParameters: UserGroupsBetaApiCreateUserGroupRequest) { return UserGroupsBetaApiFp(this.configuration).createUserGroup(requestParameters.userGroupCreateRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Delete a user group by ID. **Note**: - This endpoint is now in Beta, disabled for general availability at this time. - Please note that this endpoint is available only for API keys with Admin permissions. * @summary Delete user group * @param {UserGroupsBetaApiDeleteUserGroupRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UserGroupsBetaApi */ public deleteUserGroup(requestParameters: UserGroupsBetaApiDeleteUserGroupRequest) { return UserGroupsBetaApiFp(this.configuration).deleteUserGroup(requestParameters.groupId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Get a user group by ID. **Note**: - This endpoint is now in Beta, disabled for general availability at this time. - Please note that this endpoint is available only for API keys with Admin permissions. * @summary Get user group * @param {UserGroupsBetaApiGetUserGroupRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UserGroupsBetaApi */ public getUserGroup(requestParameters: UserGroupsBetaApiGetUserGroupRequest) { return UserGroupsBetaApiFp(this.configuration).getUserGroup(requestParameters.groupId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Get all user groups in your workspace - Please note that this endpoint is available only for API keys with Admin/Non Signing Admin permissions. Endpoint Permission: Admin, Non-Signing Admin. * @summary List user groups * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UserGroupsBetaApi */ public getUserGroups() { return UserGroupsBetaApiFp(this.configuration).getUserGroups().then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Update a user group by ID. **Note**: - This endpoint is now in Beta, disabled for general availability at this time. - Please note that this endpoint is available only for API keys with Admin permissions. * @summary Update user group * @param {UserGroupsBetaApiUpdateUserGroupRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UserGroupsBetaApi */ public updateUserGroup(requestParameters: UserGroupsBetaApiUpdateUserGroupRequest) { return UserGroupsBetaApiFp(this.configuration).updateUserGroup(requestParameters.userGroupUpdateRequest, requestParameters.groupId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } }