// TODO: better import syntax? import { BaseAPIRequestFactory, RequiredError } from './baseapi'; import {Configuration} from '../configuration'; import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {isCodeInRange} from '../util'; import { AccountBalanceRequest } from '../models/AccountBalanceRequest'; import { AccountBalanceResponse } from '../models/AccountBalanceResponse'; import { AccountBlockCountRequest } from '../models/AccountBlockCountRequest'; import { AccountBlockCountResponse } from '../models/AccountBlockCountResponse'; import { AccountGetRequest } from '../models/AccountGetRequest'; import { AccountGetResponse } from '../models/AccountGetResponse'; import { AccountHistoryRequest } from '../models/AccountHistoryRequest'; import { AccountHistoryResponse } from '../models/AccountHistoryResponse'; import { AccountInfoRequest } from '../models/AccountInfoRequest'; import { AccountInfoResponse } from '../models/AccountInfoResponse'; import { AccountKeyRequest } from '../models/AccountKeyRequest'; import { AccountKeyResponse } from '../models/AccountKeyResponse'; import { AccountRepresentativeRequest } from '../models/AccountRepresentativeRequest'; import { AccountRepresentativeResponse } from '../models/AccountRepresentativeResponse'; import { AccountWeightRequest } from '../models/AccountWeightRequest'; import { AccountWeightResponse } from '../models/AccountWeightResponse'; import { AccountsBalancesRequest } from '../models/AccountsBalancesRequest'; import { AccountsBalancesResponse } from '../models/AccountsBalancesResponse'; import { AccountsFrontiersRequest } from '../models/AccountsFrontiersRequest'; import { AccountsFrontiersResponse } from '../models/AccountsFrontiersResponse'; import { AccountsPendingRequest } from '../models/AccountsPendingRequest'; import { AccountsPendingResponse } from '../models/AccountsPendingResponse'; import { ActiveDifficultyRequest } from '../models/ActiveDifficultyRequest'; import { ActiveDifficultyResponse } from '../models/ActiveDifficultyResponse'; import { AvailableSupplyRequest } from '../models/AvailableSupplyRequest'; import { AvailableSupplyResponse } from '../models/AvailableSupplyResponse'; import { BlockAccountRequest } from '../models/BlockAccountRequest'; import { BlockAccountResponse } from '../models/BlockAccountResponse'; import { BlockConfirmRequest } from '../models/BlockConfirmRequest'; import { BlockConfirmResponse } from '../models/BlockConfirmResponse'; import { BlockCountRequest } from '../models/BlockCountRequest'; import { BlockCountResponse } from '../models/BlockCountResponse'; import { BlockCountTypeRequest } from '../models/BlockCountTypeRequest'; import { BlockCountTypeResponse } from '../models/BlockCountTypeResponse'; import { BlockCreateRequest } from '../models/BlockCreateRequest'; import { BlockCreateResponse } from '../models/BlockCreateResponse'; import { BlockHashRequest } from '../models/BlockHashRequest'; import { BlockHashResponse } from '../models/BlockHashResponse'; import { BlockInfoRequest } from '../models/BlockInfoRequest'; import { BlockInfoResponse } from '../models/BlockInfoResponse'; import { BlocksInfoRequest } from '../models/BlocksInfoRequest'; import { BlocksInfoResponse } from '../models/BlocksInfoResponse'; import { BlocksRequest } from '../models/BlocksRequest'; import { BlocksResponse } from '../models/BlocksResponse'; import { BootstrapAnyRequest } from '../models/BootstrapAnyRequest'; import { BootstrapAnyResponse } from '../models/BootstrapAnyResponse'; import { BootstrapLazyRequest } from '../models/BootstrapLazyRequest'; import { BootstrapLazyResponse } from '../models/BootstrapLazyResponse'; import { BootstrapRequest } from '../models/BootstrapRequest'; import { BootstrapResponse } from '../models/BootstrapResponse'; import { ChainRequest } from '../models/ChainRequest'; import { ChainResponse } from '../models/ChainResponse'; import { ConfirmationActiveRequest } from '../models/ConfirmationActiveRequest'; import { ConfirmationActiveResponse } from '../models/ConfirmationActiveResponse'; import { ConfirmationHistoryRequest } from '../models/ConfirmationHistoryRequest'; import { ConfirmationHistoryResponse } from '../models/ConfirmationHistoryResponse'; import { ConfirmationInfoRequest } from '../models/ConfirmationInfoRequest'; import { ConfirmationInfoResponse } from '../models/ConfirmationInfoResponse'; import { KeyCreateRequest } from '../models/KeyCreateRequest'; import { KeyCreateResponse } from '../models/KeyCreateResponse'; import { KeyExpandRequest } from '../models/KeyExpandRequest'; import { KeyExpandResponse } from '../models/KeyExpandResponse'; import { PendingRequest } from '../models/PendingRequest'; import { PendingResponse } from '../models/PendingResponse'; import { ProcessRequest } from '../models/ProcessRequest'; import { ProcessResponse } from '../models/ProcessResponse'; import { WorkGenerateRequest } from '../models/WorkGenerateRequest'; import { WorkGenerateResponse } from '../models/WorkGenerateResponse'; /** * no description */ export class NodeRPCsApiRequestFactory extends BaseAPIRequestFactory { /** * Returns how many RAW is owned and how many have not yet been received by **account** > This call may return results that include unconfirmed blocks, so it should not be used in any processes or integrations requiring only details from blocks confirmed by the network. * @param AccountBalanceRequest */ public async accountBalance(AccountBalanceRequest?: AccountBalanceRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#account_balance'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(AccountBalanceRequest, "AccountBalanceRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Get number of blocks for a specific account * @param AccountBlockCountRequest */ public async accountBlockCount(AccountBlockCountRequest?: AccountBlockCountRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#account_block_count'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(AccountBlockCountRequest, "AccountBlockCountRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Get account for the public key * @param AccountGetRequest */ public async accountGet(AccountGetRequest?: AccountGetRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#account_get'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(AccountGetRequest, "AccountGetRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Gets the account history. Reports send/receive information for an account. * @param AccountHistoryRequest */ public async accountHistory(AccountHistoryRequest?: AccountHistoryRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#account_history'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(AccountHistoryRequest, "AccountHistoryRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Returns frontier, open block, change representative block, balance, last modified timestamp from local database & block count for **account**. Only works for accounts that have an entry on the ledger, will return _Account not found_ otherwise. * @param AccountInfoRequest */ public async accountInfo(AccountInfoRequest?: AccountInfoRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#account_info'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(AccountInfoRequest, "AccountInfoRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Get the public key for **account** * @param AccountKeyRequest */ public async accountKey(AccountKeyRequest?: AccountKeyRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#account_key'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(AccountKeyRequest, "AccountKeyRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Returns the representative for **account** * @param AccountRepresentativeRequest */ public async accountRepresentative(AccountRepresentativeRequest?: AccountRepresentativeRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#account_representative'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(AccountRepresentativeRequest, "AccountRepresentativeRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Returns the voting weight for **account** * @param AccountWeightRequest */ public async accountWeight(AccountWeightRequest?: AccountWeightRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#account_weight'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(AccountWeightRequest, "AccountWeightRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Returns how many RAW is owned and how many have not yet been received by **accounts list** This call may return results that include unconfirmed blocks, so it should not be used in any processes or integrations requiring only details from blocks confirmed by the network. * @param AccountsBalancesRequest */ public async accountsBalances(AccountsBalancesRequest?: AccountsBalancesRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#accounts_balances'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(AccountsBalancesRequest, "AccountsBalancesRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Returns a list of pairs of account and block hash representing the head block for **accounts list** This call may return results that include unconfirmed blocks, so it should not be used in any processes or integrations requiring only details from blocks confirmed by the network. * @param AccountsFrontiersRequest */ public async accountsFrontiers(AccountsFrontiersRequest?: AccountsFrontiersRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#accounts_frontiers'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(AccountsFrontiersRequest, "AccountsFrontiersRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Returns a list of block hashes which have not yet been received by these accounts * @param AccountsPendingRequest */ public async accountsPending(AccountsPendingRequest?: AccountsPendingRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#accounts_pending'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(AccountsPendingRequest, "AccountsPendingRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Returns the difficulty values (16 hexadecimal digits string, 64 bit) for the minimum required on the network (network_minimum) as well as the current active difficulty seen on the network (network_current, 5 minute trended average of adjusted difficulty seen on confirmed transactions) which can be used to perform rework for better prioritization of transaction processing. A multiplier of the network_current from the base difficulty of network_minimum is also provided for comparison. * @param ActiveDifficultyRequest */ public async activeDifficulty(ActiveDifficultyRequest?: ActiveDifficultyRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#active_difficulty'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(ActiveDifficultyRequest, "ActiveDifficultyRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Returns how many raw are in the public supply * @param AvailableSupplyRequest */ public async availableSupply(AvailableSupplyRequest?: AvailableSupplyRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#available_supply'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(AvailableSupplyRequest, "AvailableSupplyRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Returns the account containing block * @param BlockAccountRequest */ public async blockAccount(BlockAccountRequest?: BlockAccountRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#block_account'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(BlockAccountRequest, "BlockAccountRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Request confirmation for **block** from known online representative nodes. Check results with confirmation history. * @param BlockConfirmRequest */ public async blockConfirm(BlockConfirmRequest?: BlockConfirmRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#block_confirm'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(BlockConfirmRequest, "BlockConfirmRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Reports the number of blocks in the ledger and unchecked synchronizing blocks. * @param BlockCountRequest */ public async blockCount(BlockCountRequest?: BlockCountRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#block_count'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(BlockCountRequest, "BlockCountRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Reports the number of blocks in the ledger by type (send, receive, open, change, state with version) * @param BlockCountTypeRequest */ public async blockCountType(BlockCountTypeRequest?: BlockCountTypeRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#block_count_type'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(BlockCountTypeRequest, "BlockCountTypeRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Creates a json representations of new block based on input data & signed with **private key** or **account** in **wallet**. Use for offline signing. * @param BlockCreateRequest */ public async blockCreate(BlockCreateRequest?: BlockCreateRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#block_create'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(BlockCreateRequest, "BlockCreateRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Returning block hash for given block content. Using the optional **json_block** is recommended since v19.0. * @param BlockHashRequest */ public async blockHash(BlockHashRequest?: BlockHashRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#block_hash'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(BlockHashRequest, "BlockHashRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Retrieves a json representation of the block in `contents` along with: * _since version 18.0_: `block_account`, transaction `amount`, block `balance`, block `height` in account chain, block local modification `timestamp` * _since version 19.0_: Whether block was `confirmed`, `subtype` (for state blocks) of `send`, `receive`, `change` or `epoch` Using the optional `json_block` is recommended since v19.0. * @param BlockInfoRequest */ public async blockInfo(BlockInfoRequest?: BlockInfoRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#block_info'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(BlockInfoRequest, "BlockInfoRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Retrieves a json representations of **blocks**. * @param BlocksRequest */ public async blocks(BlocksRequest?: BlocksRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#blocks'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(BlocksRequest, "BlocksRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Retrieves a json representations of blocks in contents along with: * _since version 18.0_: `block_account`, transaction `amount`, block `balance`, block `height` in account chain, block local modification timestamp * _since version 19.0_: Whether block was `confirmed`, `subtype` (for state blocks) of `send`, `receive`, `change` or `epoch` * @param BlocksInfoRequest */ public async blocksInfo(BlocksInfoRequest?: BlocksInfoRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#blocks_info'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(BlocksInfoRequest, "BlocksInfoRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Initialize bootstrap to specific **IP address** and **port**. Not compatible with launch flag [--disable_legacy_bootstrap](https://docs.nano.org/commands/command-line-interface/#-disable_legacy_bootstrap) * @param BootstrapRequest */ public async bootstrap(BootstrapRequest?: BootstrapRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#bootstrap'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(BootstrapRequest, "BootstrapRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Initialize multi-connection bootstrap to random peers. Not compatible with launch flag [--disable_legacy_bootstrap](https://docs.nano.org/commands/command-line-interface/#-disable_legacy_bootstrap) * @param BootstrapAnyRequest */ public async bootstrapAny(BootstrapAnyRequest?: BootstrapAnyRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#bootstrap_any'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(BootstrapAnyRequest, "BootstrapAnyRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * _version 17.0+_ Initialize lazy bootstrap with given block hash. Not compatible with launch flag [--disable_lazy_bootstrap](https://docs.nano.org/commands/command-line-interface/#-disable_lazy_bootstrap) * @param BootstrapLazyRequest */ public async bootstrapLazy(BootstrapLazyRequest?: BootstrapLazyRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#bootstrap_lazy'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(BootstrapLazyRequest, "BootstrapLazyRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Returns a consecutive list of block hashes in the account chain starting at **block** back to **count** (direction from frontier back to open block, from newer blocks to older). Will list all blocks back to the open block of this chain when count is set to \"-1\". The requested block hash is included in the answer. * @param ChainRequest */ public async chain(ChainRequest?: ChainRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#chain'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(ChainRequest, "ChainRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * _version 16.0+_ Returns list of active elections roots (excluding stopped & aborted elections). Find info about specific root with confirmation_info The roots provided are two parts and differ between the first account block and subsequent blocks: * First account block (open): 0000000000000000000000000000000000000000000000000000000000000000 + account public key * Other blocks: previous hash + previous hash * @param ConfirmationActiveRequest */ public async confirmationActive(ConfirmationActiveRequest?: ConfirmationActiveRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#confirmation_active'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(ConfirmationActiveRequest, "ConfirmationActiveRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * _version 12.0+_ _duration, time, confirmation_stats: version 17.0+_ Returns hash, tally weight, election duration (in milliseconds), election confirmation timestamp for recent elections winners. Also returns stats: count of elections in history (limited to 2048) & average duration time With version 19.0+ `confirmation_history_size` can be managed in [config.json](https://docs.nano.org/running-a-node/configuration/#example-file) to adjust the number of elections to be kept in history and returned by this call. Due to timings inside the node, the default 2048 limit will return all confirmations up to traffic levels of approximately 56 confirmations/sec. To properly track levels above this, increase this value or use the confirmation subscription through the [websocket](https://docs.nano.org/integration-guides/advanced/#websocket-support) instead. * @param ConfirmationHistoryRequest */ public async confirmationHistory(ConfirmationHistoryRequest?: ConfirmationHistoryRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#confirmation_history'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(ConfirmationHistoryRequest, "ConfirmationHistoryRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * _version 16.0+_ Returns info about active election by *root*. Including announcements count, last winner (initially local ledger block), total tally of voted representatives, concurrent blocks with tally & block contents for each. Using the optional `json_block` is recommended since v19.0. The roots provided are two parts and differ between the first account block and subsequent blocks: * First account block (open): 0000000000000000000000000000000000000000000000000000000000000000 + account public key * Other blocks: previous hash + previous hash * @param ConfirmationInfoRequest */ public async confirmationInfo(ConfirmationInfoRequest?: ConfirmationInfoRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#confirmation_info'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(ConfirmationInfoRequest, "ConfirmationInfoRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Generates an **adhoc random** keypair * @param KeyCreateRequest */ public async keyCreate(KeyCreateRequest?: KeyCreateRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#key_create'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(KeyCreateRequest, "KeyCreateRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Derive public key and account number from **private key** * @param KeyExpandRequest */ public async keyExpand(KeyExpandRequest?: KeyExpandRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#key_expand'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(KeyExpandRequest, "KeyExpandRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Returns a list of block hashes which have not yet been received by this account. **Optional `include_only_confirmed` recommended**: By default this will return blocks not in active elections but unconfirmed (e.g., block was received but node was restarted, election was dropped, new ledger with reset confirmation height). **To avoid potential issues related to these situations setting the include_only_confirmed = true is recommended for most use cases.** * @param PendingRequest */ public async pending(PendingRequest?: PendingRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#pending'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(PendingRequest, "PendingRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Publish block to the network * @param ProcessRequest */ public async process(ProcessRequest?: ProcessRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#process'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(ProcessRequest, "ProcessRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } /** * Generates work for block. hash is the frontier of the account or in the case of an open block, the public key representation of the account which can be found with account_key * @param WorkGenerateRequest */ public async workGenerate(WorkGenerateRequest?: WorkGenerateRequest, options?: Configuration): Promise { let config = options || this.configuration; // Path Params const localVarPath = '/#work_generate'; // Make Request Context const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params // Header Params // Form Params // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( ObjectSerializer.serialize(WorkGenerateRequest, "WorkGenerateRequest", ""), contentType ); requestContext.setBody(serializedBody); let authMethod = null; // Apply auth methods authMethod = config.authMethods["BasicAuth"] if (authMethod) { await authMethod.applySecurityAuthentication(requestContext); } return requestContext; } } export class NodeRPCsApiResponseProcessor { /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to accountBalance * @throws ApiException if the response code was not in [200, 299] */ public async accountBalance(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: AccountBalanceResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountBalanceResponse", "" ) as AccountBalanceResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: AccountBalanceResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountBalanceResponse", "" ) as AccountBalanceResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to accountBlockCount * @throws ApiException if the response code was not in [200, 299] */ public async accountBlockCount(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: AccountBlockCountResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountBlockCountResponse", "" ) as AccountBlockCountResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: AccountBlockCountResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountBlockCountResponse", "" ) as AccountBlockCountResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to accountGet * @throws ApiException if the response code was not in [200, 299] */ public async accountGet(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: AccountGetResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountGetResponse", "" ) as AccountGetResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: AccountGetResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountGetResponse", "" ) as AccountGetResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to accountHistory * @throws ApiException if the response code was not in [200, 299] */ public async accountHistory(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: AccountHistoryResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountHistoryResponse", "" ) as AccountHistoryResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: AccountHistoryResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountHistoryResponse", "" ) as AccountHistoryResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to accountInfo * @throws ApiException if the response code was not in [200, 299] */ public async accountInfo(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: AccountInfoResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountInfoResponse", "" ) as AccountInfoResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: AccountInfoResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountInfoResponse", "" ) as AccountInfoResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to accountKey * @throws ApiException if the response code was not in [200, 299] */ public async accountKey(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: AccountKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountKeyResponse", "" ) as AccountKeyResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: AccountKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountKeyResponse", "" ) as AccountKeyResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to accountRepresentative * @throws ApiException if the response code was not in [200, 299] */ public async accountRepresentative(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: AccountRepresentativeResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountRepresentativeResponse", "" ) as AccountRepresentativeResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: AccountRepresentativeResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountRepresentativeResponse", "" ) as AccountRepresentativeResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to accountWeight * @throws ApiException if the response code was not in [200, 299] */ public async accountWeight(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: AccountWeightResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountWeightResponse", "" ) as AccountWeightResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: AccountWeightResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountWeightResponse", "" ) as AccountWeightResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to accountsBalances * @throws ApiException if the response code was not in [200, 299] */ public async accountsBalances(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: AccountsBalancesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountsBalancesResponse", "" ) as AccountsBalancesResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: AccountsBalancesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountsBalancesResponse", "" ) as AccountsBalancesResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to accountsFrontiers * @throws ApiException if the response code was not in [200, 299] */ public async accountsFrontiers(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: AccountsFrontiersResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountsFrontiersResponse", "" ) as AccountsFrontiersResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: AccountsFrontiersResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountsFrontiersResponse", "" ) as AccountsFrontiersResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to accountsPending * @throws ApiException if the response code was not in [200, 299] */ public async accountsPending(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: AccountsPendingResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountsPendingResponse", "" ) as AccountsPendingResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: AccountsPendingResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AccountsPendingResponse", "" ) as AccountsPendingResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to activeDifficulty * @throws ApiException if the response code was not in [200, 299] */ public async activeDifficulty(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: ActiveDifficultyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ActiveDifficultyResponse", "" ) as ActiveDifficultyResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: ActiveDifficultyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ActiveDifficultyResponse", "" ) as ActiveDifficultyResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to availableSupply * @throws ApiException if the response code was not in [200, 299] */ public async availableSupply(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: AvailableSupplyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AvailableSupplyResponse", "" ) as AvailableSupplyResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: AvailableSupplyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AvailableSupplyResponse", "" ) as AvailableSupplyResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to blockAccount * @throws ApiException if the response code was not in [200, 299] */ public async blockAccount(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: BlockAccountResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlockAccountResponse", "" ) as BlockAccountResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: BlockAccountResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlockAccountResponse", "" ) as BlockAccountResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to blockConfirm * @throws ApiException if the response code was not in [200, 299] */ public async blockConfirm(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: BlockConfirmResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlockConfirmResponse", "" ) as BlockConfirmResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: BlockConfirmResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlockConfirmResponse", "" ) as BlockConfirmResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to blockCount * @throws ApiException if the response code was not in [200, 299] */ public async blockCount(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: BlockCountResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlockCountResponse", "" ) as BlockCountResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: BlockCountResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlockCountResponse", "" ) as BlockCountResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to blockCountType * @throws ApiException if the response code was not in [200, 299] */ public async blockCountType(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: BlockCountTypeResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlockCountTypeResponse", "" ) as BlockCountTypeResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: BlockCountTypeResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlockCountTypeResponse", "" ) as BlockCountTypeResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to blockCreate * @throws ApiException if the response code was not in [200, 299] */ public async blockCreate(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: BlockCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlockCreateResponse", "" ) as BlockCreateResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: BlockCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlockCreateResponse", "" ) as BlockCreateResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to blockHash * @throws ApiException if the response code was not in [200, 299] */ public async blockHash(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: BlockHashResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlockHashResponse", "" ) as BlockHashResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: BlockHashResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlockHashResponse", "" ) as BlockHashResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to blockInfo * @throws ApiException if the response code was not in [200, 299] */ public async blockInfo(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: BlockInfoResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlockInfoResponse", "" ) as BlockInfoResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: BlockInfoResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlockInfoResponse", "" ) as BlockInfoResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to blocks * @throws ApiException if the response code was not in [200, 299] */ public async blocks(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: BlocksResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlocksResponse", "" ) as BlocksResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: BlocksResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlocksResponse", "" ) as BlocksResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to blocksInfo * @throws ApiException if the response code was not in [200, 299] */ public async blocksInfo(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: BlocksInfoResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlocksInfoResponse", "" ) as BlocksInfoResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: BlocksInfoResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BlocksInfoResponse", "" ) as BlocksInfoResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to bootstrap * @throws ApiException if the response code was not in [200, 299] */ public async bootstrap(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: BootstrapResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BootstrapResponse", "" ) as BootstrapResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: BootstrapResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BootstrapResponse", "" ) as BootstrapResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to bootstrapAny * @throws ApiException if the response code was not in [200, 299] */ public async bootstrapAny(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: BootstrapAnyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BootstrapAnyResponse", "" ) as BootstrapAnyResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: BootstrapAnyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BootstrapAnyResponse", "" ) as BootstrapAnyResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to bootstrapLazy * @throws ApiException if the response code was not in [200, 299] */ public async bootstrapLazy(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: BootstrapLazyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BootstrapLazyResponse", "" ) as BootstrapLazyResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: BootstrapLazyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "BootstrapLazyResponse", "" ) as BootstrapLazyResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to chain * @throws ApiException if the response code was not in [200, 299] */ public async chain(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: ChainResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ChainResponse", "" ) as ChainResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: ChainResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ChainResponse", "" ) as ChainResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to confirmationActive * @throws ApiException if the response code was not in [200, 299] */ public async confirmationActive(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: ConfirmationActiveResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ConfirmationActiveResponse", "" ) as ConfirmationActiveResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: ConfirmationActiveResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ConfirmationActiveResponse", "" ) as ConfirmationActiveResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to confirmationHistory * @throws ApiException if the response code was not in [200, 299] */ public async confirmationHistory(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: ConfirmationHistoryResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ConfirmationHistoryResponse", "" ) as ConfirmationHistoryResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: ConfirmationHistoryResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ConfirmationHistoryResponse", "" ) as ConfirmationHistoryResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to confirmationInfo * @throws ApiException if the response code was not in [200, 299] */ public async confirmationInfo(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: ConfirmationInfoResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ConfirmationInfoResponse", "" ) as ConfirmationInfoResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: ConfirmationInfoResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ConfirmationInfoResponse", "" ) as ConfirmationInfoResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to keyCreate * @throws ApiException if the response code was not in [200, 299] */ public async keyCreate(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: KeyCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "KeyCreateResponse", "" ) as KeyCreateResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: KeyCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "KeyCreateResponse", "" ) as KeyCreateResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to keyExpand * @throws ApiException if the response code was not in [200, 299] */ public async keyExpand(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: KeyExpandResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "KeyExpandResponse", "" ) as KeyExpandResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: KeyExpandResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "KeyExpandResponse", "" ) as KeyExpandResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to pending * @throws ApiException if the response code was not in [200, 299] */ public async pending(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: PendingResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "PendingResponse", "" ) as PendingResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: PendingResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "PendingResponse", "" ) as PendingResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to process * @throws ApiException if the response code was not in [200, 299] */ public async process(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: ProcessResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ProcessResponse", "" ) as ProcessResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: ProcessResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ProcessResponse", "" ) as ProcessResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to workGenerate * @throws ApiException if the response code was not in [200, 299] */ public async workGenerate(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: WorkGenerateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "WorkGenerateResponse", "" ) as WorkGenerateResponse; return body; } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: WorkGenerateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "WorkGenerateResponse", "" ) as WorkGenerateResponse; return body; } let body = response.body || ""; throw new ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } }