/**
 * Account information PNZ-API-CentreLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

import { lazy, object, Schema, string } from '../schema';
import { CreditorAccount, creditorAccountSchema } from './creditorAccount';
import { CreditorAgent, creditorAgentSchema } from './creditorAgent';
import { Reference, referenceSchema } from './reference';

export interface Beneficiary {
  accountId: string;
  beneficiaryId: string;
  reference: Reference;
  creditorAgent: CreditorAgent;
  creditorAccount: CreditorAccount;
}

export const beneficiarySchema: Schema<Beneficiary> = object({
  accountId: ['AccountId', string()],
  beneficiaryId: ['BeneficiaryId', string()],
  reference: ['Reference', lazy(() => referenceSchema)],
  creditorAgent: ['CreditorAgent', lazy(() => creditorAgentSchema)],
  creditorAccount: ['CreditorAccount', lazy(() => creditorAccountSchema)],
});
