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

import { boolean, lazy, object, Schema, string } from '../schema';
import { CreditorAccount, creditorAccountSchema } from './creditorAccount';
import { CreditorAgent1, creditorAgent1Schema } from './creditorAgent1';
import { DebtorAccount3, debtorAccount3Schema } from './debtorAccount3';
import { InstructedAmount, instructedAmountSchema } from './instructedAmount';
import {
  RemittanceInformation,
  remittanceInformationSchema,
} from './remittanceInformation';

export interface Initiation2 {
  endToEndIdentification: string;
  remittanceInformation: RemittanceInformation;
  creditorAgent: CreditorAgent1;
  debtorAccountRelease: boolean;
  instructionIdentification: string;
  instructedAmount: InstructedAmount;
  debtorAccount: DebtorAccount3;
  creditorAccount: CreditorAccount;
}

export const initiation2Schema: Schema<Initiation2> = object({
  endToEndIdentification: ['EndToEndIdentification', string()],
  remittanceInformation: [
    'RemittanceInformation',
    lazy(() => remittanceInformationSchema),
  ],
  creditorAgent: ['CreditorAgent', lazy(() => creditorAgent1Schema)],
  debtorAccountRelease: ['DebtorAccountRelease', boolean()],
  instructionIdentification: ['InstructionIdentification', string()],
  instructedAmount: ['InstructedAmount', lazy(() => instructedAmountSchema)],
  debtorAccount: ['DebtorAccount', lazy(() => debtorAccount3Schema)],
  creditorAccount: ['CreditorAccount', lazy(() => creditorAccountSchema)],
});
