/** * @license * Verifalia - Email list cleaning and real-time email verification service * https://verifalia.com/ * support@verifalia.com * * Copyright (c) 2005-2024 Cobisi Research * * Cobisi Research * Via Della Costituzione, 31 * 35010 Vigonza * Italy - European Union * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ import { DailyUsageListingOptions } from './models/DailyUsageListingOptions'; import { RestClientFactory } from "../rest/RestClientFactory"; import { Balance } from "./models/Balance"; import { CancellationToken } from '../common/CancellationToken'; import { DailyUsage } from './models/DailyUsage'; export declare class CreditsRestClient { private readonly _restClientFactory; constructor(restClientFactory: RestClientFactory); /** * Returns the current credits balance for the Verifalia account. * * This method returns a `Promise` which can be consumed using the async/await pattern (or through the * classic `then()` / `catch()` functions) and can be cancelled through a `CancellationToken`. * * Here is an example: * ```ts * const verifalia = new VerifaliaRestClient(...); * * const balance = await verifalia * .credits * .getBalance(); * * console.log(`Credit packs: ${balance.creditPacks}, free credits: ${balance.freeCredits}`); * // 'Credit packs: 507.23, free credits: 10.86' * ``` * * @param cancellationToken An optional token used to cancel the asynchronous request. */ getBalance(cancellationToken?: CancellationToken): Promise; /** * Lists the daily usages of the credits for the Verifalia account, according to the specified * listing options. * * This method returns a `Promise` which can be consumed using the async/await pattern (or through the * classic `then()` / `catch()` functions) and can be cancelled through a `CancellationToken`. * * Here is how to list the credit daily usages between two dates: * ```ts * const verifalia = new VerifaliaRestClient(...); * const dailyUsages = verifalia * .credits * .listDailyUsages({ * dateFilter: new DateBetweenPredicate(new Date(2023, 2, 15), new Date(2023, 3, 1)) * }); * * for await (const dailyUsage of dailyUsages) { * console.log(`Date: ${dailyUsage.date}, credit packs: ${dailyUsage.creditPacks}, free credits: ${dailyUsage.freeCredits}`); * // 'Date: 2023-02-15, credit packs: 98.85, free credits: 50' * // 'Date: 2023-02-16, credit packs: 0, free credits: 19.26' * // ... * // 'Date: 2023-03-01, credit packs: 1.565, free credits: 50' * } * ``` * * @param options A `DailyUsageListingOptions` with the options for the listing operation. * @param cancellationToken An optional token used to cancel the asynchronous request. */ listDailyUsages(options?: DailyUsageListingOptions, cancellationToken?: CancellationToken): AsyncGenerator; } //# sourceMappingURL=CreditsRestClient.d.ts.map