// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; import * as PlaidAPI from './plaid'; export class Plaid extends APIResource { /** * Exchange token (Plaid) */ exchange(body: PlaidExchangeParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/auth/plaid/exchange', { body, ...options }); } /** * Auth Link (Plaid) */ link(body?: PlaidLinkParams, options?: Core.RequestOptions): Core.APIPromise; link(options?: Core.RequestOptions): Core.APIPromise; link( body: PlaidLinkParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(body)) { return this.link({}, body); } return this._client.post('/auth/plaid/link', { body, ...options }); } } export interface PlaidExchangeSchema { data: PlaidExchangeSchema.Data; } export namespace PlaidExchangeSchema { export interface Data { access_token: string; } } export interface PlaidLinkSchema { data: PlaidLinkSchema.Data; } export namespace PlaidLinkSchema { export interface Data { expiration: string; link_token: string; } } export interface PlaidExchangeParams { token: string; } export interface PlaidLinkParams { /** * Used when initiating the reconnect flow */ accessToken?: string; language?: string; userId?: string; } export namespace Plaid { export import PlaidExchangeSchema = PlaidAPI.PlaidExchangeSchema; export import PlaidLinkSchema = PlaidAPI.PlaidLinkSchema; export import PlaidExchangeParams = PlaidAPI.PlaidExchangeParams; export import PlaidLinkParams = PlaidAPI.PlaidLinkParams; }