/* tslint:disable */ /* eslint-disable */ /** * Section API * Get edgey with the Section API * * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; import { BillingHistory } from '../models'; import { BillingSummary } from '../models'; import { ErrorModel } from '../models'; /** * BillingApi - axios parameter creator * @export */ export const BillingApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Get basic billing information for account. * @param {number} accountId The account identifier number * @param {*} [options] Override http request option. * @throws {RequiredError} */ accountBillingGet: async (accountId: number, options: any = {}): Promise => { // verify required parameter 'accountId' is not null or undefined if (accountId === null || accountId === undefined) { throw new RequiredError('accountId','Required parameter accountId was null or undefined when calling accountBillingGet.'); } const localVarPath = `/account/{accountId}/billingsummary` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // authentication keyInQuery required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("access_token") : await configuration.apiKey; localVarQueryParameter["access_token"] = localVarApiKeyValue; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.query) { query.set(key, options.query[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Get billing history * @param {number} accountId The account identifier number * @param {*} [options] Override http request option. * @throws {RequiredError} */ accountBillingHistoryGet: async (accountId: number, options: any = {}): Promise => { // verify required parameter 'accountId' is not null or undefined if (accountId === null || accountId === undefined) { throw new RequiredError('accountId','Required parameter accountId was null or undefined when calling accountBillingHistoryGet.'); } const localVarPath = `/account/{accountId}/billinghistory` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // authentication keyInQuery required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("access_token") : await configuration.apiKey; localVarQueryParameter["access_token"] = localVarApiKeyValue; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.query) { query.set(key, options.query[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, } }; /** * BillingApi - functional programming interface * @export */ export const BillingApiFp = function(configuration?: Configuration) { return { /** * Get basic billing information for account. * @param {number} accountId The account identifier number * @param {*} [options] Override http request option. * @throws {RequiredError} */ async accountBillingGet(accountId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await BillingApiAxiosParamCreator(configuration).accountBillingGet(accountId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Get billing history * @param {number} accountId The account identifier number * @param {*} [options] Override http request option. * @throws {RequiredError} */ async accountBillingHistoryGet(accountId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await BillingApiAxiosParamCreator(configuration).accountBillingHistoryGet(accountId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * BillingApi - factory interface * @export */ export const BillingApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * Get basic billing information for account. * @param {number} accountId The account identifier number * @param {*} [options] Override http request option. * @throws {RequiredError} */ accountBillingGet(accountId: number, options?: any): AxiosPromise { return BillingApiFp(configuration).accountBillingGet(accountId, options).then((request) => request(axios, basePath)); }, /** * Get billing history * @param {number} accountId The account identifier number * @param {*} [options] Override http request option. * @throws {RequiredError} */ accountBillingHistoryGet(accountId: number, options?: any): AxiosPromise> { return BillingApiFp(configuration).accountBillingHistoryGet(accountId, options).then((request) => request(axios, basePath)); }, }; }; /** * BillingApi - object-oriented interface * @export * @class BillingApi * @extends {BaseAPI} */ export class BillingApi extends BaseAPI { /** * Get basic billing information for account. * @param {number} accountId The account identifier number * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BillingApi */ public accountBillingGet(accountId: number, options?: any) { return BillingApiFp(this.configuration).accountBillingGet(accountId, options).then((request) => request(this.axios, this.basePath)); } /** * Get billing history * @param {number} accountId The account identifier number * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BillingApi */ public accountBillingHistoryGet(accountId: number, options?: any) { return BillingApiFp(this.configuration).accountBillingHistoryGet(accountId, options).then((request) => request(this.axios, this.basePath)); } }