All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.electrum.suv.api.models.ProvisionRequest Maven / Gradle / Ivy

package io.electrum.suv.api.models;

import java.util.List;
import java.util.Objects;

import javax.validation.Valid;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.electrum.vas.Utils;
import io.electrum.vas.model.Amounts;
import io.electrum.vas.model.Tender;
import io.electrum.vas.model.Transaction;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * Information about the voucher provision request.
 **/

@ApiModel(description = "Information about the voucher provision request.")
public final class ProvisionRequest extends Transaction {
   private Amounts amounts = null;
   private List tenders = null;
   private Voucher voucher = null;

   /**
    * If the voucher identified by the voucher field is not a fixed price product then the amounts field indicates the
    * value of the product referred to.
    **/
   public ProvisionRequest amounts(Amounts amounts) {
      this.amounts = amounts;
      return this;
   }

   @ApiModelProperty(value = "If the voucher identified by the voucher field is not a fixed price product then the "
         + "amounts field indicates the value of the product referred to.")
   @JsonProperty("amounts")
   @Valid
   public Amounts getAmounts() {
      return amounts;
   }

   public void setAmounts(Amounts amounts) {
      this.amounts = amounts;
   }

   /**
    * An array of tenders used to pay for the transaction
    **/
   public ProvisionRequest tenders(List tenders) {
      this.tenders = tenders;
      return this;
   }

   @ApiModelProperty(value = "An array of tenders used to pay for the transaction.")
   @JsonProperty("tenders")
   @Valid
   public List getTenders() {
      return tenders;
   }

   public void setTenders(List tenders) {
      this.tenders = tenders;
   }

   /**
    * The voucher that is being requested for provisioning.
    **/
   public ProvisionRequest voucher(Voucher voucher) {
      this.voucher = voucher;
      return this;
   }

   @ApiModelProperty(value = "The voucher that is being requested for provisioning.")
   @JsonProperty("voucher")
   public Voucher getVoucher() {
      return voucher;
   }

   public void setVoucher(Voucher voucher) {
      this.voucher = voucher;
   }

   @Override
   public boolean equals(Object o) {
      if (this == o)
         return true;
      if (o == null || getClass() != o.getClass())
         return false;
      if (!super.equals(o))
         return false;
      ProvisionRequest request = (ProvisionRequest) o;
      return Objects.equals(amounts, request.amounts) && Objects.equals(tenders, request.tenders)
            && Objects.equals(voucher, request.voucher);
   }

   @Override
   public int hashCode() {
      return Objects.hash(super.hashCode(), amounts, tenders, voucher);
   }

   @Override
   public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class ProvisionRequest {\n");
      sb.append("    id: ").append(Utils.toIndentedString(this.id)).append("\n");
      sb.append("    time: ").append(Utils.toIndentedString(this.time)).append("\n");
      sb.append("    originator: ").append(Utils.toIndentedString(this.originator)).append("\n");
      sb.append("    client: ").append(Utils.toIndentedString(this.client)).append("\n");
      sb.append("    settlementEntity: ").append(Utils.toIndentedString(this.settlementEntity)).append("\n");
      sb.append("    receiver: ").append(Utils.toIndentedString(this.receiver)).append("\n");
      sb.append("    thirdPartyIdentifiers: ").append(Utils.toIndentedString(this.thirdPartyIdentifiers)).append("\n");
      sb.append("    slipData: ").append(Utils.toIndentedString(this.slipData)).append("\n");
      sb.append("    basketRef: ").append(Utils.toIndentedString(this.basketRef)).append("\n");
      sb.append("    tranType: ").append(Utils.toIndentedString(this.tranType)).append("\n");
      sb.append("    srcAccType: ").append(Utils.toIndentedString(this.srcAccType)).append("\n");
      sb.append("    destAccType: ").append(Utils.toIndentedString(this.destAccType)).append("\n");
      sb.append("    amounts:  ").append(Utils.toIndentedString(amounts)).append("\n");
      sb.append("    tenders: ").append(Utils.toIndentedString(tenders)).append("\n");
      sb.append("    voucher: ").append(Utils.toIndentedString(voucher)).append("\n");
      sb.append("}");
      return sb.toString();
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy