/* 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 { ErrorResponse } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { GetWhitelistIpAddressesResponse } from '../models'; /** * WhitelistIpAddressesApi - axios parameter creator * @export */ export const WhitelistIpAddressesApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Get a list of the whitelisted IP addresses for a specific API Key - Please note that this endpoint is available only for API keys with Admin/Non Signing Admin permissions. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get whitelisted ip addresses for an API Key * @param {string} userId The ID of the api user * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWhitelistIpAddresses: async (userId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getWhitelistIpAddresses', 'userId', userId) const localVarPath = `/management/api_users/{userId}/whitelist_ip_addresses` .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 = 'getWhitelistIpAddresses'; 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, }; }, } }; /** * WhitelistIpAddressesApi - functional programming interface * @export */ export const WhitelistIpAddressesApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = WhitelistIpAddressesApiAxiosParamCreator(configuration) return { /** * Get a list of the whitelisted IP addresses for a specific API Key - Please note that this endpoint is available only for API keys with Admin/Non Signing Admin permissions. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get whitelisted ip addresses for an API Key * @param {string} userId The ID of the api user * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getWhitelistIpAddresses(userId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getWhitelistIpAddresses(userId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WhitelistIpAddressesApi.getWhitelistIpAddresses']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * WhitelistIpAddressesApi - factory interface * @export */ export const WhitelistIpAddressesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = WhitelistIpAddressesApiFp(configuration) return { /** * Get a list of the whitelisted IP addresses for a specific API Key - Please note that this endpoint is available only for API keys with Admin/Non Signing Admin permissions. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get whitelisted ip addresses for an API Key * @param {WhitelistIpAddressesApiGetWhitelistIpAddressesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWhitelistIpAddresses(requestParameters: WhitelistIpAddressesApiGetWhitelistIpAddressesRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getWhitelistIpAddresses(requestParameters.userId, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for getWhitelistIpAddresses operation in WhitelistIpAddressesApi. * @export * @interface WhitelistIpAddressesApiGetWhitelistIpAddressesRequest */ export interface WhitelistIpAddressesApiGetWhitelistIpAddressesRequest { /** * The ID of the api user * @type {string} * @memberof WhitelistIpAddressesApiGetWhitelistIpAddresses */ readonly userId: string } /** * WhitelistIpAddressesApi - object-oriented interface * @export * @class WhitelistIpAddressesApi * @extends {BaseAPI} */ export class WhitelistIpAddressesApi extends BaseAPI { /** * Get a list of the whitelisted IP addresses for a specific API Key - Please note that this endpoint is available only for API keys with Admin/Non Signing Admin permissions. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get whitelisted ip addresses for an API Key * @param {WhitelistIpAddressesApiGetWhitelistIpAddressesRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WhitelistIpAddressesApi */ public getWhitelistIpAddresses(requestParameters: WhitelistIpAddressesApiGetWhitelistIpAddressesRequest) { return WhitelistIpAddressesApiFp(this.configuration).getWhitelistIpAddresses(requestParameters.userId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } }