/* * This file is part of LibEuFin. * Copyright (C) 2024 Taler Systems S.A. * LibEuFin is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation; either version 3, or * (at your option) any later version. * LibEuFin is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * You should have received a copy of the GNU Affero General Public * License along with LibEuFin; see the file COPYING. If not, see * */ // THIS FILE IS GENERATED, DO NOT EDIT package tech.libeufin.ebics.iso20022 import java.time.* import java.util.* import com.gitlab.mvysny.konsumexml.* data class AdviceType1( val CdtAdvc: AdviceType1Choice?, val DbtAdvc: AdviceType1Choice?, ) { companion object { fun parse(k: Konsumer): AdviceType1 = AdviceType1( k.childOrNull("CdtAdvc") { AdviceType1Choice.parse(this) }, k.childOrNull("DbtAdvc") { AdviceType1Choice.parse(this) }, ) } } sealed interface AdviceType1Choice { @JvmInline value class Cd(val value: AdviceType1Code): AdviceType1Choice @JvmInline value class Prtry(val value: String): AdviceType1Choice companion object { fun parse(k: Konsumer): AdviceType1Choice = k.child(Names.of("Cd", "Prtry")) { when (localName) { "Cd" -> Cd(AdviceType1Code.valueOf(text())) "Prtry" -> Prtry(text()) else -> throw Error("Impossible") } } } } enum class AdviceType1Code { ADWD, ADND, } sealed interface Authorisation1Choice { @JvmInline value class Cd(val value: Authorisation1Code): Authorisation1Choice @JvmInline value class Prtry(val value: String): Authorisation1Choice companion object { fun parse(k: Konsumer): Authorisation1Choice = k.child(Names.of("Cd", "Prtry")) { when (localName) { "Cd" -> Cd(Authorisation1Code.valueOf(text())) "Prtry" -> Prtry(text()) else -> throw Error("Impossible") } } } } enum class Authorisation1Code { AUTH, FDET, FSUM, ILEV, } data class Cheque11( val ChqTp: ChequeType2Code?, val ChqNb: String?, val ChqFr: NameAndAddress16?, val DlvryMtd: ChequeDeliveryMethod1Choice?, val DlvrTo: NameAndAddress16?, val InstrPrty: Priority2Code?, val ChqMtrtyDt: LocalDate?, val FrmsCd: String?, val MemoFld: List, val RgnlClrZone: String?, val PrtLctn: String?, val Sgntr: List, ) { companion object { fun parse(k: Konsumer): Cheque11 = Cheque11( k.childOrNull("ChqTp") { ChequeType2Code.valueOf(text()) }, k.childOrNull("ChqNb") { text() }, k.childOrNull("ChqFr") { NameAndAddress16.parse(this) }, k.childOrNull("DlvryMtd") { ChequeDeliveryMethod1Choice.parse(this) }, k.childOrNull("DlvrTo") { NameAndAddress16.parse(this) }, k.childOrNull("InstrPrty") { Priority2Code.valueOf(text()) }, k.childOrNull("ChqMtrtyDt") { text().toDate() }, k.childOrNull("FrmsCd") { text() }, k.children("MemoFld", maxCount=2) { text() }, k.childOrNull("RgnlClrZone") { text() }, k.childOrNull("PrtLctn") { text() }, k.children("Sgntr", maxCount=5) { text() }, ) } } enum class ChequeDelivery1Code { MLDB, MLCD, MLFA, CRDB, CRCD, CRFA, PUDB, PUCD, PUFA, RGDB, RGCD, RGFA, } sealed interface ChequeDeliveryMethod1Choice { @JvmInline value class Cd(val value: ChequeDelivery1Code): ChequeDeliveryMethod1Choice @JvmInline value class Prtry(val value: String): ChequeDeliveryMethod1Choice companion object { fun parse(k: Konsumer): ChequeDeliveryMethod1Choice = k.child(Names.of("Cd", "Prtry")) { when (localName) { "Cd" -> Cd(ChequeDelivery1Code.valueOf(text())) "Prtry" -> Prtry(text()) else -> throw Error("Impossible") } } } } enum class ChequeType2Code { CCHQ, CCCH, BCHQ, DRFT, ELDR, } data class CreditTransferTransaction54( val PmtId: PaymentIdentification6, val PmtTpInf: PaymentTypeInformation26?, val Amt: AmountType4Choice, val XchgRateInf: ExchangeRate1?, val ChrgBr: ChargeBearerType1Code?, val MndtRltdInf: CreditTransferMandateData1?, val ChqInstr: Cheque11?, val UltmtDbtr: PartyIdentification135?, val IntrmyAgt1: BranchAndFinancialInstitutionIdentification6?, val IntrmyAgt1Acct: CashAccount40?, val IntrmyAgt2: BranchAndFinancialInstitutionIdentification6?, val IntrmyAgt2Acct: CashAccount40?, val IntrmyAgt3: BranchAndFinancialInstitutionIdentification6?, val IntrmyAgt3Acct: CashAccount40?, val CdtrAgt: BranchAndFinancialInstitutionIdentification6?, val CdtrAgtAcct: CashAccount40?, val Cdtr: PartyIdentification135?, val CdtrAcct: CashAccount40?, val UltmtCdtr: PartyIdentification135?, val InstrForCdtrAgt: List, val InstrForDbtrAgt: InstructionForDebtorAgent1?, val Purp: Purpose2Choice?, val RgltryRptg: List, val Tax: TaxInformation10?, val RltdRmtInf: List, val RmtInf: RemittanceInformation21?, val SplmtryData: List, ) { companion object { fun parse(k: Konsumer): CreditTransferTransaction54 = CreditTransferTransaction54( k.child("PmtId") { PaymentIdentification6.parse(this) }, k.childOrNull("PmtTpInf") { PaymentTypeInformation26.parse(this) }, k.child("Amt") { AmountType4Choice.parse(this) }, k.childOrNull("XchgRateInf") { ExchangeRate1.parse(this) }, k.childOrNull("ChrgBr") { ChargeBearerType1Code.valueOf(text()) }, k.childOrNull("MndtRltdInf") { CreditTransferMandateData1.parse(this) }, k.childOrNull("ChqInstr") { Cheque11.parse(this) }, k.childOrNull("UltmtDbtr") { PartyIdentification135.parse(this) }, k.childOrNull("IntrmyAgt1") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("IntrmyAgt1Acct") { CashAccount40.parse(this) }, k.childOrNull("IntrmyAgt2") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("IntrmyAgt2Acct") { CashAccount40.parse(this) }, k.childOrNull("IntrmyAgt3") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("IntrmyAgt3Acct") { CashAccount40.parse(this) }, k.childOrNull("CdtrAgt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("CdtrAgtAcct") { CashAccount40.parse(this) }, k.childOrNull("Cdtr") { PartyIdentification135.parse(this) }, k.childOrNull("CdtrAcct") { CashAccount40.parse(this) }, k.childOrNull("UltmtCdtr") { PartyIdentification135.parse(this) }, k.children("InstrForCdtrAgt") { InstructionForCreditorAgent3.parse(this) }, k.childOrNull("InstrForDbtrAgt") { InstructionForDebtorAgent1.parse(this) }, k.childOrNull("Purp") { Purpose2Choice.parse(this) }, k.children("RgltryRptg", maxCount=10) { RegulatoryReporting3.parse(this) }, k.childOrNull("Tax") { TaxInformation10.parse(this) }, k.children("RltdRmtInf", maxCount=10) { RemittanceLocation7.parse(this) }, k.childOrNull("RmtInf") { RemittanceInformation21.parse(this) }, k.children("SplmtryData") { SupplementaryData1.parse(this) }, ) } } data class CustomerCreditTransferInitiationV11( val GrpHdr: GroupHeader95, val PmtInf: List, val SplmtryData: List, ) { companion object { fun parse(k: Konsumer): CustomerCreditTransferInitiationV11 = CustomerCreditTransferInitiationV11( k.child("GrpHdr") { GroupHeader95.parse(this) }, k.children("PmtInf", minCount=1, ) { PaymentInstruction40.parse(this) }, k.children("SplmtryData") { SupplementaryData1.parse(this) }, ) } } data class pain_001_001_11( val CstmrCdtTrfInitn: CustomerCreditTransferInitiationV11, ) { companion object { fun parse(k: Konsumer): pain_001_001_11 = pain_001_001_11( k.child("CstmrCdtTrfInitn") { CustomerCreditTransferInitiationV11.parse(this) }, ) } } data class ExchangeRate1( val UnitCcy: String?, val XchgRate: Float?, val RateTp: ExchangeRateType1Code?, val CtrctId: String?, ) { companion object { fun parse(k: Konsumer): ExchangeRate1 = ExchangeRate1( k.childOrNull("UnitCcy") { text() }, k.childOrNull("XchgRate") { text().xmlFloat() }, k.childOrNull("RateTp") { ExchangeRateType1Code.valueOf(text()) }, k.childOrNull("CtrctId") { text() }, ) } } enum class ExchangeRateType1Code { SPOT, SALE, AGRD, } data class GroupHeader95( val MsgId: String, val CreDtTm: LocalDateTime, val Authstn: List, val NbOfTxs: String, val CtrlSum: Float?, val InitgPty: PartyIdentification135, val FwdgAgt: BranchAndFinancialInstitutionIdentification6?, val InitnSrc: PaymentInitiationSource1?, ) { companion object { fun parse(k: Konsumer): GroupHeader95 = GroupHeader95( k.child("MsgId") { text() }, k.child("CreDtTm") { text().toDateTime() }, k.children("Authstn", maxCount=2) { Authorisation1Choice.parse(this) }, k.child("NbOfTxs") { text() }, k.childOrNull("CtrlSum") { text().xmlFloat() }, k.child("InitgPty") { PartyIdentification135.parse(this) }, k.childOrNull("FwdgAgt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("InitnSrc") { PaymentInitiationSource1.parse(this) }, ) } } data class InstructionForCreditorAgent3( val Cd: ExternalCreditorAgentInstruction1Code?, val InstrInf: String?, ) { companion object { fun parse(k: Konsumer): InstructionForCreditorAgent3 = InstructionForCreditorAgent3( k.childOrNull("Cd") { text().xmlCodeSet() }, k.childOrNull("InstrInf") { text() }, ) } } data class InstructionForDebtorAgent1( val Cd: ExternalDebtorAgentInstruction1Code?, val InstrInf: String?, ) { companion object { fun parse(k: Konsumer): InstructionForDebtorAgent1 = InstructionForDebtorAgent1( k.childOrNull("Cd") { text().xmlCodeSet() }, k.childOrNull("InstrInf") { text() }, ) } } data class PaymentIdentification6( val InstrId: String?, val EndToEndId: String, val UETR: String?, ) { companion object { fun parse(k: Konsumer): PaymentIdentification6 = PaymentIdentification6( k.childOrNull("InstrId") { text() }, k.child("EndToEndId") { text() }, k.childOrNull("UETR") { text() }, ) } } data class PaymentInitiationSource1( val Nm: String, val Prvdr: String?, val Vrsn: String?, ) { companion object { fun parse(k: Konsumer): PaymentInitiationSource1 = PaymentInitiationSource1( k.child("Nm") { text() }, k.childOrNull("Prvdr") { text() }, k.childOrNull("Vrsn") { text() }, ) } } data class PaymentInstruction40( val PmtInfId: String, val PmtMtd: PaymentMethod3Code, val ReqdAdvcTp: AdviceType1?, val BtchBookg: Boolean?, val NbOfTxs: String?, val CtrlSum: Float?, val PmtTpInf: PaymentTypeInformation26?, val ReqdExctnDt: DateAndDateTime2Choice, val PoolgAdjstmntDt: LocalDate?, val Dbtr: PartyIdentification135, val DbtrAcct: CashAccount40, val DbtrAgt: BranchAndFinancialInstitutionIdentification6, val DbtrAgtAcct: CashAccount40?, val InstrForDbtrAgt: String?, val UltmtDbtr: PartyIdentification135?, val ChrgBr: ChargeBearerType1Code?, val ChrgsAcct: CashAccount40?, val ChrgsAcctAgt: BranchAndFinancialInstitutionIdentification6?, val CdtTrfTxInf: List, ) { companion object { fun parse(k: Konsumer): PaymentInstruction40 = PaymentInstruction40( k.child("PmtInfId") { text() }, k.child("PmtMtd") { PaymentMethod3Code.valueOf(text()) }, k.childOrNull("ReqdAdvcTp") { AdviceType1.parse(this) }, k.childOrNull("BtchBookg") { text().xmlBoolean() }, k.childOrNull("NbOfTxs") { text() }, k.childOrNull("CtrlSum") { text().xmlFloat() }, k.childOrNull("PmtTpInf") { PaymentTypeInformation26.parse(this) }, k.child("ReqdExctnDt") { DateAndDateTime2Choice.parse(this) }, k.childOrNull("PoolgAdjstmntDt") { text().toDate() }, k.child("Dbtr") { PartyIdentification135.parse(this) }, k.child("DbtrAcct") { CashAccount40.parse(this) }, k.child("DbtrAgt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.childOrNull("DbtrAgtAcct") { CashAccount40.parse(this) }, k.childOrNull("InstrForDbtrAgt") { text() }, k.childOrNull("UltmtDbtr") { PartyIdentification135.parse(this) }, k.childOrNull("ChrgBr") { ChargeBearerType1Code.valueOf(text()) }, k.childOrNull("ChrgsAcct") { CashAccount40.parse(this) }, k.childOrNull("ChrgsAcctAgt") { BranchAndFinancialInstitutionIdentification6.parse(this) }, k.children("CdtTrfTxInf", minCount=1, ) { CreditTransferTransaction54.parse(this) }, ) } } enum class PaymentMethod3Code { CHK, TRF, TRA, } data class PaymentTypeInformation26( val InstrPrty: Priority2Code?, val SvcLvl: List, val LclInstrm: LocalInstrument2Choice?, val CtgyPurp: CategoryPurpose1Choice?, ) { companion object { fun parse(k: Konsumer): PaymentTypeInformation26 = PaymentTypeInformation26( k.childOrNull("InstrPrty") { Priority2Code.valueOf(text()) }, k.children("SvcLvl") { ServiceLevel8Choice.parse(this) }, k.childOrNull("LclInstrm") { LocalInstrument2Choice.parse(this) }, k.childOrNull("CtgyPurp") { CategoryPurpose1Choice.parse(this) }, ) } } data class RegulatoryAuthority2( val Nm: String?, val Ctry: String?, ) { companion object { fun parse(k: Konsumer): RegulatoryAuthority2 = RegulatoryAuthority2( k.childOrNull("Nm") { text() }, k.childOrNull("Ctry") { text() }, ) } } data class RegulatoryReporting3( val DbtCdtRptgInd: RegulatoryReportingType1Code?, val Authrty: RegulatoryAuthority2?, val Dtls: List, ) { companion object { fun parse(k: Konsumer): RegulatoryReporting3 = RegulatoryReporting3( k.childOrNull("DbtCdtRptgInd") { RegulatoryReportingType1Code.valueOf(text()) }, k.childOrNull("Authrty") { RegulatoryAuthority2.parse(this) }, k.children("Dtls") { StructuredRegulatoryReporting3.parse(this) }, ) } } enum class RegulatoryReportingType1Code { CRED, DEBT, BOTH, } data class StructuredRegulatoryReporting3( val Tp: String?, val Dt: LocalDate?, val Ctry: String?, val Cd: String?, val Amt: ActiveOrHistoricCurrencyAndAmount?, val Inf: List, ) { companion object { fun parse(k: Konsumer): StructuredRegulatoryReporting3 = StructuredRegulatoryReporting3( k.childOrNull("Tp") { text() }, k.childOrNull("Dt") { text().toDate() }, k.childOrNull("Ctry") { text() }, k.childOrNull("Cd") { text() }, k.childOrNull("Amt") { ActiveOrHistoricCurrencyAndAmount.parse(this) }, k.children("Inf") { text() }, ) } } data class TaxInformation10( val Cdtr: TaxParty1?, val Dbtr: TaxParty2?, val AdmstnZone: String?, val RefNb: String?, val Mtd: String?, val TtlTaxblBaseAmt: ActiveOrHistoricCurrencyAndAmount?, val TtlTaxAmt: ActiveOrHistoricCurrencyAndAmount?, val Dt: LocalDate?, val SeqNb: Float?, val Rcrd: List, ) { companion object { fun parse(k: Konsumer): TaxInformation10 = TaxInformation10( k.childOrNull("Cdtr") { TaxParty1.parse(this) }, k.childOrNull("Dbtr") { TaxParty2.parse(this) }, k.childOrNull("AdmstnZone") { text() }, k.childOrNull("RefNb") { text() }, k.childOrNull("Mtd") { text() }, k.childOrNull("TtlTaxblBaseAmt") { ActiveOrHistoricCurrencyAndAmount.parse(this) }, k.childOrNull("TtlTaxAmt") { ActiveOrHistoricCurrencyAndAmount.parse(this) }, k.childOrNull("Dt") { text().toDate() }, k.childOrNull("SeqNb") { text().xmlFloat() }, k.children("Rcrd") { TaxRecord3.parse(this) }, ) } }