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

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

package io.electrum.suv.api.models;

import java.util.Objects;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonProperty;

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

/**
 * Information about the voucher provisioned.
 **/
@ApiModel(description = "Information about the voucher provisioned.")
public final class ProvisionResponse extends Transaction {
   private Amounts amounts = 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 in the response.
    **/
   public ProvisionResponse amounts(Amounts amounts) {
      this.amounts = amounts;
      return this;
   }

   @ApiModelProperty(value = "The amounts for which a single use voucher is provisioned for.")
   @JsonProperty("amounts")
   @Valid
   public Amounts getAmounts() {
      return amounts;
   }

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

   /**
    * The voucher provisioned if the vendor processed the request successfully.
    **/
   public ProvisionResponse voucher(Voucher voucher) {
      this.voucher = voucher;
      return this;
   }

   @ApiModelProperty(required = true, value = "The voucher provisioned if the vendor processed the request "
         + "successfully.")
   @JsonProperty("voucher")
   @NotNull
   @Valid
   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;
      ProvisionResponse response = (ProvisionResponse) o;
      return Objects.equals(amounts, response.amounts) && Objects.equals(voucher, response.voucher);
   }

   @Override
   public int hashCode() {

      return Objects.hash(super.hashCode(), amounts, voucher);
   }

   @Override
   public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class ProvisionResponse {\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("    voucher:  ").append(Utils.toIndentedString(voucher)).append("\n");
      sb.append("}");
      return sb.toString();
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy