@circle-fin/circle-sdk
Version:
Node.js SDK for Circle API
272 lines (257 loc) • 13.5 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import globalAxios, {
AxiosPromise,
AxiosInstance,
AxiosRequestConfig
} from "axios";
import { Configuration } from "../configuration";
// Some imports not used depending on template conditions
// @ts-ignore
import {
DUMMY_BASE_URL,
assertParamExists,
setBearerAuthToObject,
setSearchParams,
serializeDataIfNeeded,
toPathString,
createRequestFunction
} from "../common";
// @ts-ignore
import {
BASE_PATH,
COLLECTION_FORMATS,
RequestArgs,
BaseAPI,
RequiredError
} from "../base";
// @ts-ignore
import { ListBusinessDepositsResponse } from "../models";
// @ts-ignore
import { NotAuthorized } from "../models";
/**
* DepositsApi - axios parameter creator
* @export
*/
export const DepositsApiAxiosParamCreator = function (
configuration?: Configuration
) {
return {
/**
* Searches for deposits sent to your business account. If the date parameters are omitted, returns the most recent deposits. This endpoint returns up to 50 deposits in descending chronological order or pageSize, if provided.
* @summary List all deposits
* @param {'wire'} [type] Unique identifier for the deposit type. Filters results to fetch deposits made by this specific type.
* @param {string} [from] Queries items created since the specified date-time (inclusive).
* @param {string} [to] Queries items created before the specified date-time (inclusive).
* @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next `n` items before the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageAfter.
* @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next `n` items after the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageBefore.
* @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listBusinessDeposits: async (
type?: "wire",
from?: string,
to?: string,
pageBefore?: string,
pageAfter?: string,
pageSize?: number,
options: AxiosRequestConfig = {}
): Promise<RequestArgs> => {
const localVarPath = `/v1/businessAccount/deposits`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: "GET",
...baseOptions,
...options
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
if (type !== undefined) {
localVarQueryParameter["type"] = type;
}
if (from !== undefined) {
localVarQueryParameter["from"] =
(from as any) instanceof Date ? (from as any).toISOString() : from;
}
if (to !== undefined) {
localVarQueryParameter["to"] =
(to as any) instanceof Date ? (to as any).toISOString() : to;
}
if (pageBefore !== undefined) {
localVarQueryParameter["pageBefore"] = pageBefore;
}
if (pageAfter !== undefined) {
localVarQueryParameter["pageAfter"] = pageAfter;
}
if (pageSize !== undefined) {
localVarQueryParameter["pageSize"] = pageSize;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions
};
}
};
};
/**
* DepositsApi - functional programming interface
* @export
*/
export const DepositsApiFp = function (configuration?: Configuration) {
const localVarAxiosParamCreator = DepositsApiAxiosParamCreator(configuration);
return {
/**
* Searches for deposits sent to your business account. If the date parameters are omitted, returns the most recent deposits. This endpoint returns up to 50 deposits in descending chronological order or pageSize, if provided.
* @summary List all deposits
* @param {'wire'} [type] Unique identifier for the deposit type. Filters results to fetch deposits made by this specific type.
* @param {string} [from] Queries items created since the specified date-time (inclusive).
* @param {string} [to] Queries items created before the specified date-time (inclusive).
* @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next `n` items before the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageAfter.
* @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next `n` items after the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageBefore.
* @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listBusinessDeposits(
type?: "wire",
from?: string,
to?: string,
pageBefore?: string,
pageAfter?: string,
pageSize?: number,
options?: AxiosRequestConfig
): Promise<
(
axios?: AxiosInstance,
basePath?: string
) => AxiosPromise<ListBusinessDepositsResponse>
> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.listBusinessDeposits(
type,
from,
to,
pageBefore,
pageAfter,
pageSize,
options
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
);
}
};
};
/**
* DepositsApi - factory interface
* @export
*/
export const DepositsApiFactory = function (
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance
) {
const localVarFp = DepositsApiFp(configuration);
return {
/**
* Searches for deposits sent to your business account. If the date parameters are omitted, returns the most recent deposits. This endpoint returns up to 50 deposits in descending chronological order or pageSize, if provided.
* @summary List all deposits
* @param {'wire'} [type] Unique identifier for the deposit type. Filters results to fetch deposits made by this specific type.
* @param {string} [from] Queries items created since the specified date-time (inclusive).
* @param {string} [to] Queries items created before the specified date-time (inclusive).
* @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next `n` items before the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageAfter.
* @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next `n` items after the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageBefore.
* @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listBusinessDeposits(
type?: "wire",
from?: string,
to?: string,
pageBefore?: string,
pageAfter?: string,
pageSize?: number,
options?: any
): AxiosPromise<ListBusinessDepositsResponse> {
return localVarFp
.listBusinessDeposits(
type,
from,
to,
pageBefore,
pageAfter,
pageSize,
options
)
.then((request) => request(axios, basePath));
}
};
};
/**
* DepositsApi - object-oriented interface
* @export
* @class DepositsApi
* @extends {BaseAPI}
*/
export class DepositsApi extends BaseAPI {
/**
* Searches for deposits sent to your business account. If the date parameters are omitted, returns the most recent deposits. This endpoint returns up to 50 deposits in descending chronological order or pageSize, if provided.
* @summary List all deposits
* @param {'wire'} [type] Unique identifier for the deposit type. Filters results to fetch deposits made by this specific type.
* @param {string} [from] Queries items created since the specified date-time (inclusive).
* @param {string} [to] Queries items created before the specified date-time (inclusive).
* @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next `n` items before the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageAfter.
* @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next `n` items after the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageBefore.
* @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DepositsApi
*/
public listBusinessDeposits(
type?: "wire",
from?: string,
to?: string,
pageBefore?: string,
pageAfter?: string,
pageSize?: number,
options?: AxiosRequestConfig
) {
return DepositsApiFp(this.configuration)
.listBusinessDeposits(
type,
from,
to,
pageBefore,
pageAfter,
pageSize,
options
)
.then((request) => request(this.axios, this.basePath));
}
}