/* 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 { ErrorSchema } from '../models'; // @ts-ignore import { GetMpcKeysResponse } from '../models'; /** * KeysApi - axios parameter creator * @export */ export const KeysApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Returns a list of MPC signing keys of the workspace. For each key, the list of players associated with it is attached. * @summary Get list of mpc keys * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMpcKeysList: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/keys/mpc/list`; // 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 = 'getMpcKeysList'; 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, }; }, /** * Returns a list of MPC signing keys of a specific user. For each key, the list of players associated with it is attached. * @summary Get list of mpc keys by `userId` * @param {string} userId The id for the user * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMpcKeysListByUser: async (userId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getMpcKeysListByUser', 'userId', userId) const localVarPath = `/keys/mpc/list/{userId}` .replace(`{${"userId"}}`, 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}; // 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 = 'getMpcKeysListByUser'; 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, }; }, } }; /** * KeysApi - functional programming interface * @export */ export const KeysApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = KeysApiAxiosParamCreator(configuration) return { /** * Returns a list of MPC signing keys of the workspace. For each key, the list of players associated with it is attached. * @summary Get list of mpc keys * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMpcKeysList(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getMpcKeysList(options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeysApi.getMpcKeysList']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns a list of MPC signing keys of a specific user. For each key, the list of players associated with it is attached. * @summary Get list of mpc keys by `userId` * @param {string} userId The id for the user * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMpcKeysListByUser(userId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getMpcKeysListByUser(userId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['KeysApi.getMpcKeysListByUser']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * KeysApi - factory interface * @export */ export const KeysApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = KeysApiFp(configuration) return { /** * Returns a list of MPC signing keys of the workspace. For each key, the list of players associated with it is attached. * @summary Get list of mpc keys * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMpcKeysList(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getMpcKeysList(options).then((request) => request(axios, basePath)); }, /** * Returns a list of MPC signing keys of a specific user. For each key, the list of players associated with it is attached. * @summary Get list of mpc keys by `userId` * @param {KeysApiGetMpcKeysListByUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMpcKeysListByUser(requestParameters: KeysApiGetMpcKeysListByUserRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getMpcKeysListByUser(requestParameters.userId, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for getMpcKeysListByUser operation in KeysApi. * @export * @interface KeysApiGetMpcKeysListByUserRequest */ export interface KeysApiGetMpcKeysListByUserRequest { /** * The id for the user * @type {string} * @memberof KeysApiGetMpcKeysListByUser */ readonly userId: string } /** * KeysApi - object-oriented interface * @export * @class KeysApi * @extends {BaseAPI} */ export class KeysApi extends BaseAPI { /** * Returns a list of MPC signing keys of the workspace. For each key, the list of players associated with it is attached. * @summary Get list of mpc keys * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeysApi */ public getMpcKeysList() { return KeysApiFp(this.configuration).getMpcKeysList().then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns a list of MPC signing keys of a specific user. For each key, the list of players associated with it is attached. * @summary Get list of mpc keys by `userId` * @param {KeysApiGetMpcKeysListByUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeysApi */ public getMpcKeysListByUser(requestParameters: KeysApiGetMpcKeysListByUserRequest) { return KeysApiFp(this.configuration).getMpcKeysListByUser(requestParameters.userId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } }