/* tslint:disable */ /* eslint-disable */ /** * Faraday REST API * The [Faraday](https://faraday.ai) API makes it easy to predict customer behavior programmatically. See our [API change policy](https://faraday.ai/legal). * * The version of the OpenAPI document: 1.0.0 * Contact: support@faraday.ai * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import { AccountBilling, } from '../models'; export interface GetAccountBillingRequest { accountId: string; } /** * */ export class BillingApi extends runtime.BaseAPI { /** * Get invoices, payments, and usage stats for your account. * Get billing information about your account. */ async getAccountBillingRaw(requestParameters: GetAccountBillingRequest, ): Promise> { if (requestParameters.accountId === null || requestParameters.accountId === undefined) { throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountBilling.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/accounts/{account_id}/billing`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response); } /** * Get invoices, payments, and usage stats for your account. * Get billing information about your account. */ async getAccountBilling(accountId: string, ): Promise { const response = await this.getAccountBillingRaw({ accountId: accountId }, ); return await response.value(); } /** * Get invoices, payments, and usage stats for the current account. * Get billing information about the current account. */ async getCurrentAccountBillingRaw(): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("bearer", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/accounts/current/billing`, method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response); } /** * Get invoices, payments, and usage stats for the current account. * Get billing information about the current account. */ async getCurrentAccountBilling(): Promise { const response = await this.getCurrentAccountBillingRaw(); return await response.value(); } }