// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; import * as Core from '../../../core'; import * as GocardlessAPI from './gocardless'; import * as AgreementAPI from './agreement'; export class Gocardless extends APIResource { agreement: AgreementAPI.Agreement = new AgreementAPI.Agreement(this._client); /** * Exchange token (GoCardLess) */ exchange( body: GocardlessExchangeParams, options?: Core.RequestOptions, ): Core.APIPromise { return this._client.post('/auth/gocardless/exchange', { body, ...options }); } /** * Auth link (GoCardLess) */ link(body: GocardlessLinkParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/auth/gocardless/link', { body, ...options }); } } export interface GocardlessExchangeSchema { data: GocardlessExchangeSchema.Data; } export namespace GocardlessExchangeSchema { export interface Data { id: string; access_valid_for_days: number; institution_id: string; max_historical_days: number; } } export interface GocardlessLinkSchema { data: GocardlessLinkSchema.Data; } export namespace GocardlessLinkSchema { export interface Data { link: string; } } export interface GocardlessExchangeParams { institutionId: string; transactionTotalDays: number; } export interface GocardlessLinkParams { agreement: string | null; institutionId: string; redirect: string; } export namespace Gocardless { export import GocardlessExchangeSchema = GocardlessAPI.GocardlessExchangeSchema; export import GocardlessLinkSchema = GocardlessAPI.GocardlessLinkSchema; export import GocardlessExchangeParams = GocardlessAPI.GocardlessExchangeParams; export import GocardlessLinkParams = GocardlessAPI.GocardlessLinkParams; export import Agreement = AgreementAPI.Agreement; export import GocardlessAgreementSchema = AgreementAPI.GocardlessAgreementSchema; export import AgreementCreateParams = AgreementAPI.AgreementCreateParams; }