uk.org.openbanking.datamodel.account.OBTransaction2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openbanking-sdk Show documentation
Show all versions of openbanking-sdk Show documentation
A Java SDK to help implementing the Open Banking standard : https://www.openbanking.org.uk/read-write-apis/
/**
*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at https://forgerock.org/cddlv1-0/. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2019 ForgeRock AS.
*/
package uk.org.openbanking.datamodel.account;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.joda.time.DateTime;
import org.springframework.validation.annotation.Validated;
import uk.org.openbanking.datamodel.payment.OBActiveOrHistoricCurrencyAndAmount;
import uk.org.openbanking.jackson.DateTimeDeserializer;
import uk.org.openbanking.jackson.DateTimeSerializer;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* Provides further details on an entry in the report.
*/
@ApiModel(description = "Provides further details on an entry in the report.")
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2018-06-25T23:06:46.214+01:00")
public class OBTransaction2 {
@JsonProperty("AccountId")
private String accountId = null;
@JsonProperty("TransactionId")
private String transactionId = null;
@JsonProperty("TransactionReference")
private String transactionReference = null;
@JsonProperty("StatementReference")
@Valid
private List statementReference = null;
@JsonProperty("Amount")
private OBActiveOrHistoricCurrencyAndAmount amount = null;
@JsonProperty("CreditDebitIndicator")
private OBCreditDebitCode creditDebitIndicator = null;
@JsonProperty("Status")
private OBEntryStatus1Code status = null;
@JsonProperty("BookingDateTime")
@JsonDeserialize(using = DateTimeDeserializer.class)
@JsonSerialize(using = DateTimeSerializer.class)
private DateTime bookingDateTime = null;
@JsonProperty("ValueDateTime")
@JsonDeserialize(using = DateTimeDeserializer.class)
@JsonSerialize(using = DateTimeSerializer.class)
private DateTime valueDateTime = null;
@JsonProperty("AddressLine")
private String addressLine = null;
@JsonProperty("BankTransactionCode")
private OBBankTransactionCodeStructure1 bankTransactionCode = null;
@JsonProperty("ProprietaryBankTransactionCode")
private ProprietaryBankTransactionCodeStructure1 proprietaryBankTransactionCode = null;
@JsonProperty("EquivalentAmount")
private OBEquivalentAmount equivalentAmount = null;
@JsonProperty("CreditorAgent")
private OBBranchAndFinancialInstitutionIdentification2 creditorAgent = null;
@JsonProperty("DebtorAgent")
private OBBranchAndFinancialInstitutionIdentification2 debtorAgent = null;
@JsonProperty("CardInstrument")
private OBTransactionCardInstrument1 cardInstrument = null;
@JsonProperty("TransactionInformation")
private String transactionInformation = null;
@JsonProperty("Balance")
private OBTransactionCashBalance balance = null;
@JsonProperty("MerchantDetails")
private OBMerchantDetails1 merchantDetails = null;
@JsonProperty("CreditorAccount")
private OBCashAccount2 creditorAccount = null;
@JsonProperty("DebtorAccount")
private OBBranchAndFinancialInstitutionIdentification2 debtorAccount = null;
public OBTransaction2 accountId(String accountId) {
this.accountId = accountId;
return this;
}
/**
* A unique and immutable identifier used to identify the account resource. This identifier has no meaning to the account owner.
* @return accountId
**/
@ApiModelProperty(required = true, value = "A unique and immutable identifier used to identify the account resource. This identifier has no meaning to the account owner.")
@NotNull
@Size(min=1,max=40)
public String getAccountId() {
return accountId;
}
public void setAccountId(String accountId) {
this.accountId = accountId;
}
public OBTransaction2 transactionId(String transactionId) {
this.transactionId = transactionId;
return this;
}
/**
* Unique identifier for the transaction within an servicing institution. This identifier is both unique and immutable.
* @return transactionId
**/
@ApiModelProperty(value = "Unique identifier for the transaction within an servicing institution. This identifier is both unique and immutable.")
@Size(min=1,max=40)
public String getTransactionId() {
return transactionId;
}
public void setTransactionId(String transactionId) {
this.transactionId = transactionId;
}
public OBTransaction2 transactionReference(String transactionReference) {
this.transactionReference = transactionReference;
return this;
}
/**
* Unique reference for the transaction. This reference is optionally populated, and may as an example be the FPID in the Faster Payments context.
* @return transactionReference
**/
@ApiModelProperty(value = "Unique reference for the transaction. This reference is optionally populated, and may as an example be the FPID in the Faster Payments context.")
@Size(min=1,max=35)
public String getTransactionReference() {
return transactionReference;
}
public void setTransactionReference(String transactionReference) {
this.transactionReference = transactionReference;
}
public OBTransaction2 statementReference(List statementReference) {
this.statementReference = statementReference;
return this;
}
public OBTransaction2 addStatementReferenceItem(String statementReferenceItem) {
if (this.statementReference == null) {
this.statementReference = new ArrayList();
}
this.statementReference.add(statementReferenceItem);
return this;
}
/**
* Unique reference for the statement. This reference may be optionally populated if available.
* @return statementReference
**/
@ApiModelProperty(value = "Unique reference for the statement. This reference may be optionally populated if available.")
public List getStatementReference() {
return statementReference;
}
public void setStatementReference(List statementReference) {
this.statementReference = statementReference;
}
public OBTransaction2 amount(OBActiveOrHistoricCurrencyAndAmount amount) {
this.amount = amount;
return this;
}
/**
* Get amount
* @return amount
**/
@ApiModelProperty(required = true, value = "")
@NotNull
@Valid
public OBActiveOrHistoricCurrencyAndAmount getAmount() {
return amount;
}
public void setAmount(OBActiveOrHistoricCurrencyAndAmount amount) {
this.amount = amount;
}
public OBTransaction2 creditDebitIndicator(OBCreditDebitCode creditDebitIndicator) {
this.creditDebitIndicator = creditDebitIndicator;
return this;
}
/**
* Indicates whether the transaction is a credit or a debit entry.
* @return creditDebitIndicator
**/
@ApiModelProperty(required = true, value = "Indicates whether the transaction is a credit or a debit entry.")
@NotNull
public OBCreditDebitCode getCreditDebitIndicator() {
return creditDebitIndicator;
}
public void setCreditDebitIndicator(OBCreditDebitCode creditDebitIndicator) {
this.creditDebitIndicator = creditDebitIndicator;
}
public OBTransaction2 status(OBEntryStatus1Code status) {
this.status = status;
return this;
}
/**
* Status of a transaction entry on the books of the account servicer.
* @return status
**/
@ApiModelProperty(required = true, value = "Status of a transaction entry on the books of the account servicer.")
@NotNull
public OBEntryStatus1Code getStatus() {
return status;
}
public void setStatus(OBEntryStatus1Code status) {
this.status = status;
}
public OBTransaction2 bookingDateTime(DateTime bookingDateTime) {
this.bookingDateTime = bookingDateTime;
return this;
}
/**
* Date and time when a transaction entry is posted to an account on the account servicer's books. Usage: Booking date is the expected booking date, unless the status is booked, in which case it is the actual booking date. All dates in the JSON payloads are represented in ISO 8601 date-time format. All date-time fields in responses must include the timezone. An example is below: 2017-04-05T10:43:07+00:00
* @return bookingDateTime
**/
@ApiModelProperty(required = true, value = "Date and time when a transaction entry is posted to an account on the account servicer's books. Usage: Booking date is the expected booking date, unless the status is booked, in which case it is the actual booking date. All dates in the JSON payloads are represented in ISO 8601 date-time format. All date-time fields in responses must include the timezone. An example is below: 2017-04-05T10:43:07+00:00")
@NotNull
@Valid
public DateTime getBookingDateTime() {
return bookingDateTime;
}
public void setBookingDateTime(DateTime bookingDateTime) {
this.bookingDateTime = bookingDateTime;
}
public OBTransaction2 valueDateTime(DateTime valueDateTime) {
this.valueDateTime = valueDateTime;
return this;
}
/**
* Date and time at which assets become available to the account owner in case of a credit entry, or cease to be available to the account owner in case of a debit transaction entry. Usage: If transaction entry status is pending and value date is present, then the value date refers to an expected/requested value date. For transaction entries subject to availability/float and for which availability information is provided, the value date must not be used. In this case the availability component identifies the number of availability days. All dates in the JSON payloads are represented in ISO 8601 date-time format. All date-time fields in responses must include the timezone. An example is below: 2017-04-05T10:43:07+00:00
* @return valueDateTime
**/
@ApiModelProperty(value = "Date and time at which assets become available to the account owner in case of a credit entry, or cease to be available to the account owner in case of a debit transaction entry. Usage: If transaction entry status is pending and value date is present, then the value date refers to an expected/requested value date. For transaction entries subject to availability/float and for which availability information is provided, the value date must not be used. In this case the availability component identifies the number of availability days. All dates in the JSON payloads are represented in ISO 8601 date-time format. All date-time fields in responses must include the timezone. An example is below: 2017-04-05T10:43:07+00:00")
@Valid
public DateTime getValueDateTime() {
return valueDateTime;
}
public void setValueDateTime(DateTime valueDateTime) {
this.valueDateTime = valueDateTime;
}
public OBTransaction2 addressLine(String addressLine) {
this.addressLine = addressLine;
return this;
}
/**
* Information that locates and identifies a specific address for a transaction entry, that is presented in free format text.
* @return addressLine
**/
@ApiModelProperty(value = "Information that locates and identifies a specific address for a transaction entry, that is presented in free format text.")
@Size(min=1,max=70)
public String getAddressLine() {
return addressLine;
}
public void setAddressLine(String addressLine) {
this.addressLine = addressLine;
}
public OBTransaction2 bankTransactionCode(OBBankTransactionCodeStructure1 bankTransactionCode) {
this.bankTransactionCode = bankTransactionCode;
return this;
}
/**
* Get bankTransactionCode
* @return bankTransactionCode
**/
@ApiModelProperty(value = "")
@Valid
public OBBankTransactionCodeStructure1 getBankTransactionCode() {
return bankTransactionCode;
}
public void setBankTransactionCode(OBBankTransactionCodeStructure1 bankTransactionCode) {
this.bankTransactionCode = bankTransactionCode;
}
public OBTransaction2 proprietaryBankTransactionCode(ProprietaryBankTransactionCodeStructure1 proprietaryBankTransactionCode) {
this.proprietaryBankTransactionCode = proprietaryBankTransactionCode;
return this;
}
/**
* Get proprietaryBankTransactionCode
* @return proprietaryBankTransactionCode
**/
@ApiModelProperty(value = "")
@Valid
public ProprietaryBankTransactionCodeStructure1 getProprietaryBankTransactionCode() {
return proprietaryBankTransactionCode;
}
public void setProprietaryBankTransactionCode(ProprietaryBankTransactionCodeStructure1 proprietaryBankTransactionCode) {
this.proprietaryBankTransactionCode = proprietaryBankTransactionCode;
}
public OBTransaction2 equivalentAmount(OBEquivalentAmount equivalentAmount) {
this.equivalentAmount = equivalentAmount;
return this;
}
/**
* Get equivalentAmount
* @return equivalentAmount
**/
@ApiModelProperty(value = "")
@Valid
public OBEquivalentAmount getEquivalentAmount() {
return equivalentAmount;
}
public void setEquivalentAmount(OBEquivalentAmount equivalentAmount) {
this.equivalentAmount = equivalentAmount;
}
public OBTransaction2 creditorAgent(OBBranchAndFinancialInstitutionIdentification2 creditorAgent) {
this.creditorAgent = creditorAgent;
return this;
}
/**
* Get creditorAgent
* @return creditorAgent
**/
@ApiModelProperty(value = "")
@Valid
public OBBranchAndFinancialInstitutionIdentification2 getCreditorAgent() {
return creditorAgent;
}
public void setCreditorAgent(OBBranchAndFinancialInstitutionIdentification2 creditorAgent) {
this.creditorAgent = creditorAgent;
}
public OBTransaction2 debtorAgent(OBBranchAndFinancialInstitutionIdentification2 debtorAgent) {
this.debtorAgent = debtorAgent;
return this;
}
/**
* Get debtorAgent
* @return debtorAgent
**/
@ApiModelProperty(value = "")
@Valid
public OBBranchAndFinancialInstitutionIdentification2 getDebtorAgent() {
return debtorAgent;
}
public void setDebtorAgent(OBBranchAndFinancialInstitutionIdentification2 debtorAgent) {
this.debtorAgent = debtorAgent;
}
public OBTransaction2 cardInstrument(OBTransactionCardInstrument1 cardInstrument) {
this.cardInstrument = cardInstrument;
return this;
}
/**
* Get cardInstrument
* @return cardInstrument
**/
@ApiModelProperty(value = "")
@Valid
public OBTransactionCardInstrument1 getCardInstrument() {
return cardInstrument;
}
public void setCardInstrument(OBTransactionCardInstrument1 cardInstrument) {
this.cardInstrument = cardInstrument;
}
public OBTransaction2 transactionInformation(String transactionInformation) {
this.transactionInformation = transactionInformation;
return this;
}
/**
* Further details of the transaction. This is the transaction narrative, which is unstructured text.
* @return transactionInformation
**/
@ApiModelProperty(value = "Further details of the transaction. This is the transaction narrative, which is unstructured text.")
@Size(min=1,max=500)
public String getTransactionInformation() {
return transactionInformation;
}
public void setTransactionInformation(String transactionInformation) {
this.transactionInformation = transactionInformation;
}
public OBTransaction2 balance(OBTransactionCashBalance balance) {
this.balance = balance;
return this;
}
/**
* Get balance
* @return balance
**/
@ApiModelProperty(value = "")
@Valid
public OBTransactionCashBalance getBalance() {
return balance;
}
public void setBalance(OBTransactionCashBalance balance) {
this.balance = balance;
}
public OBTransaction2 merchantDetails(OBMerchantDetails1 merchantDetails) {
this.merchantDetails = merchantDetails;
return this;
}
/**
* Get merchantDetails
* @return merchantDetails
**/
@ApiModelProperty(value = "")
@Valid
public OBMerchantDetails1 getMerchantDetails() {
return merchantDetails;
}
public void setMerchantDetails(OBMerchantDetails1 merchantDetails) {
this.merchantDetails = merchantDetails;
}
public OBTransaction2 creditorAccount(OBCashAccount2 creditorAccount) {
this.creditorAccount = creditorAccount;
return this;
}
/**
* Get creditorAccount
* @return creditorAccount
**/
@ApiModelProperty(value = "")
@Valid
public OBCashAccount2 getCreditorAccount() {
return creditorAccount;
}
public void setCreditorAccount(OBCashAccount2 creditorAccount) {
this.creditorAccount = creditorAccount;
}
public OBTransaction2 debtorAccount(OBBranchAndFinancialInstitutionIdentification2 debtorAccount) {
this.debtorAccount = debtorAccount;
return this;
}
/**
* Get debtorAccount
* @return debtorAccount
**/
@ApiModelProperty(value = "")
@Valid
public OBBranchAndFinancialInstitutionIdentification2 getDebtorAccount() {
return debtorAccount;
}
public void setDebtorAccount(OBBranchAndFinancialInstitutionIdentification2 debtorAccount) {
this.debtorAccount = debtorAccount;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OBTransaction2 obTransaction2 = (OBTransaction2) o;
return Objects.equals(this.accountId, obTransaction2.accountId) &&
Objects.equals(this.transactionId, obTransaction2.transactionId) &&
Objects.equals(this.transactionReference, obTransaction2.transactionReference) &&
Objects.equals(this.statementReference, obTransaction2.statementReference) &&
Objects.equals(this.amount, obTransaction2.amount) &&
Objects.equals(this.creditDebitIndicator, obTransaction2.creditDebitIndicator) &&
Objects.equals(this.status, obTransaction2.status) &&
Objects.equals(this.bookingDateTime, obTransaction2.bookingDateTime) &&
Objects.equals(this.valueDateTime, obTransaction2.valueDateTime) &&
Objects.equals(this.addressLine, obTransaction2.addressLine) &&
Objects.equals(this.bankTransactionCode, obTransaction2.bankTransactionCode) &&
Objects.equals(this.proprietaryBankTransactionCode, obTransaction2.proprietaryBankTransactionCode) &&
Objects.equals(this.equivalentAmount, obTransaction2.equivalentAmount) &&
Objects.equals(this.creditorAgent, obTransaction2.creditorAgent) &&
Objects.equals(this.debtorAgent, obTransaction2.debtorAgent) &&
Objects.equals(this.cardInstrument, obTransaction2.cardInstrument) &&
Objects.equals(this.transactionInformation, obTransaction2.transactionInformation) &&
Objects.equals(this.balance, obTransaction2.balance) &&
Objects.equals(this.merchantDetails, obTransaction2.merchantDetails) &&
Objects.equals(this.creditorAccount, obTransaction2.creditorAccount) &&
Objects.equals(this.debtorAccount, obTransaction2.debtorAccount);
}
@Override
public int hashCode() {
return Objects.hash(accountId, transactionId, transactionReference, statementReference, amount, creditDebitIndicator, status, bookingDateTime, valueDateTime, addressLine, bankTransactionCode, proprietaryBankTransactionCode, equivalentAmount, creditorAgent, debtorAgent, cardInstrument, transactionInformation, balance, merchantDetails, creditorAccount, debtorAccount);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OBTransaction2 {\n");
sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n");
sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n");
sb.append(" transactionReference: ").append(toIndentedString(transactionReference)).append("\n");
sb.append(" statementReference: ").append(toIndentedString(statementReference)).append("\n");
sb.append(" amount: ").append(toIndentedString(amount)).append("\n");
sb.append(" creditDebitIndicator: ").append(toIndentedString(creditDebitIndicator)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" bookingDateTime: ").append(toIndentedString(bookingDateTime)).append("\n");
sb.append(" valueDateTime: ").append(toIndentedString(valueDateTime)).append("\n");
sb.append(" addressLine: ").append(toIndentedString(addressLine)).append("\n");
sb.append(" bankTransactionCode: ").append(toIndentedString(bankTransactionCode)).append("\n");
sb.append(" proprietaryBankTransactionCode: ").append(toIndentedString(proprietaryBankTransactionCode)).append("\n");
sb.append(" equivalentAmount: ").append(toIndentedString(equivalentAmount)).append("\n");
sb.append(" creditorAgent: ").append(toIndentedString(creditorAgent)).append("\n");
sb.append(" debtorAgent: ").append(toIndentedString(debtorAgent)).append("\n");
sb.append(" cardInstrument: ").append(toIndentedString(cardInstrument)).append("\n");
sb.append(" transactionInformation: ").append(toIndentedString(transactionInformation)).append("\n");
sb.append(" balance: ").append(toIndentedString(balance)).append("\n");
sb.append(" merchantDetails: ").append(toIndentedString(merchantDetails)).append("\n");
sb.append(" creditorAccount: ").append(toIndentedString(creditorAccount)).append("\n");
sb.append(" debtorAccount: ").append(toIndentedString(debtorAccount)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}