/* 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 { PolicyRuleQuotaRequest } from '../models'; // @ts-ignore import { PolicyRuleQuotaResponse } from '../models'; /** * PolicyEditorV2BetaApi - axios parameter creator * @export */ export const PolicyEditorV2BetaApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Returns the Amount Over Time (AOT) quota calculated for a specific policy rule. Endpoint Permissions: Owner, Admin, Non-Signing Admin. * @summary Calculate the AOT quota for a policy rule * @param {PolicyRuleQuotaRequest} policyRuleQuotaRequest * @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} */ getPolicyRuleQuota: async (policyRuleQuotaRequest: PolicyRuleQuotaRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('getPolicyRuleQuota', 'policyRuleQuotaRequest', policyRuleQuotaRequest) const localVarPath = `/policy/rules/quota`; // 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 = 'getPolicyRuleQuota'; 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(policyRuleQuotaRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * PolicyEditorV2BetaApi - functional programming interface * @export */ export const PolicyEditorV2BetaApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = PolicyEditorV2BetaApiAxiosParamCreator(configuration) return { /** * Returns the Amount Over Time (AOT) quota calculated for a specific policy rule. Endpoint Permissions: Owner, Admin, Non-Signing Admin. * @summary Calculate the AOT quota for a policy rule * @param {PolicyRuleQuotaRequest} policyRuleQuotaRequest * @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 getPolicyRuleQuota(policyRuleQuotaRequest: PolicyRuleQuotaRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPolicyRuleQuota(policyRuleQuotaRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['PolicyEditorV2BetaApi.getPolicyRuleQuota']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * PolicyEditorV2BetaApi - factory interface * @export */ export const PolicyEditorV2BetaApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = PolicyEditorV2BetaApiFp(configuration) return { /** * Returns the Amount Over Time (AOT) quota calculated for a specific policy rule. Endpoint Permissions: Owner, Admin, Non-Signing Admin. * @summary Calculate the AOT quota for a policy rule * @param {PolicyEditorV2BetaApiGetPolicyRuleQuotaRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPolicyRuleQuota(requestParameters: PolicyEditorV2BetaApiGetPolicyRuleQuotaRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPolicyRuleQuota(requestParameters.policyRuleQuotaRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for getPolicyRuleQuota operation in PolicyEditorV2BetaApi. * @export * @interface PolicyEditorV2BetaApiGetPolicyRuleQuotaRequest */ export interface PolicyEditorV2BetaApiGetPolicyRuleQuotaRequest { /** * * @type {PolicyRuleQuotaRequest} * @memberof PolicyEditorV2BetaApiGetPolicyRuleQuota */ readonly policyRuleQuotaRequest: PolicyRuleQuotaRequest /** * 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 PolicyEditorV2BetaApiGetPolicyRuleQuota */ readonly idempotencyKey?: string } /** * PolicyEditorV2BetaApi - object-oriented interface * @export * @class PolicyEditorV2BetaApi * @extends {BaseAPI} */ export class PolicyEditorV2BetaApi extends BaseAPI { /** * Returns the Amount Over Time (AOT) quota calculated for a specific policy rule. Endpoint Permissions: Owner, Admin, Non-Signing Admin. * @summary Calculate the AOT quota for a policy rule * @param {PolicyEditorV2BetaApiGetPolicyRuleQuotaRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PolicyEditorV2BetaApi */ public getPolicyRuleQuota(requestParameters: PolicyEditorV2BetaApiGetPolicyRuleQuotaRequest) { return PolicyEditorV2BetaApiFp(this.configuration).getPolicyRuleQuota(requestParameters.policyRuleQuotaRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } }