UNPKG

@airwallex/node-sdk

Version:

Airwallex Node.js SDK

73 lines 3.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IssuingDigitalWalletTokensApi = void 0; const apiClient_1 = require("../../client/apiClient"); const dataParser_1 = require("../../utils/dataParser"); const issuingNonPciDigitalWalletTokenDto_1 = require("../../model/issuingNonPciDigitalWalletTokenDto"); const issuingNonPciQueryResultOfIssuingNonPciDigitalWalletTokenDto_1 = require("../../model/issuingNonPciQueryResultOfIssuingNonPciDigitalWalletTokenDto"); class IssuingDigitalWalletTokensApi { async getTokenById(id, options = {}) { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getTokenById.'); } const localVarPath = '/api/v1/issuing/digital_wallet_tokens/{id}'.replace('{' + 'id' + '}', encodeURIComponent(String(id))); const { headers, timeout, responseType } = options; let localVarHeaderParams = Object.assign({}, headers ? headers : {}); const data = await apiClient_1.apiClient.get(localVarPath, { headers: localVarHeaderParams, timeout, responseType, }); const typeName = issuingNonPciDigitalWalletTokenDto_1.IssuingNonPciDigitalWalletTokenDto.discriminator; return (0, dataParser_1.parseDataToType)(data, typeName); } async getTokens({ card_id, cardholder_id, from_created_at, from_token_expires_on, page_num, page_size, to_created_at, to_token_expires_on, token_reference_id, token_statuses, token_types }, options = {}) { const localVarPath = '/api/v1/issuing/digital_wallet_tokens'; const { headers, timeout, responseType } = options; let localVarHeaderParams = Object.assign({}, headers ? headers : {}); let queryParams = {}; if (card_id !== undefined) { queryParams['card_id'] = card_id; } if (cardholder_id !== undefined) { queryParams['cardholder_id'] = cardholder_id; } if (from_created_at !== undefined) { queryParams['from_created_at'] = from_created_at; } if (from_token_expires_on !== undefined) { queryParams['from_token_expires_on'] = from_token_expires_on; } if (page_num !== undefined) { queryParams['page_num'] = page_num; } if (page_size !== undefined) { queryParams['page_size'] = page_size; } if (to_created_at !== undefined) { queryParams['to_created_at'] = to_created_at; } if (to_token_expires_on !== undefined) { queryParams['to_token_expires_on'] = to_token_expires_on; } if (token_reference_id !== undefined) { queryParams['token_reference_id'] = token_reference_id; } if (token_statuses !== undefined) { queryParams['token_statuses'] = token_statuses; } if (token_types !== undefined) { queryParams['token_types'] = token_types; } const data = await apiClient_1.apiClient.get(localVarPath, { headers: localVarHeaderParams, params: queryParams, timeout, responseType, }); const typeName = issuingNonPciQueryResultOfIssuingNonPciDigitalWalletTokenDto_1.IssuingNonPciQueryResultOfIssuingNonPciDigitalWalletTokenDto.discriminator; return (0, dataParser_1.parseDataToType)(data, typeName); } } exports.IssuingDigitalWalletTokensApi = IssuingDigitalWalletTokensApi; //# sourceMappingURL=issuingDigitalWalletTokensApi.js.map