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

org.openapitools.client.model.RefundsAppliedToResponse Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
/*
* Quickstart API Reference
* Zuora Quickstart API is the API that helps you achieve fundamental use cases.
* It provides a much simplified object model and improved performance, enabling developers to easily learn and use.
*/

package org.openapitools.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.client.model.BillingDocument;
import org.openapitools.client.model.Payment;
import org.openapitools.client.model.RefundAppliedToItemResponse;
import org.openapitools.jackson.nullable.JsonNullable;

import org.openapitools.client.JSON.CustomFieldAdapter;
import org.openapitools.client.JSON.NullableFieldAdapter;
/**
 * RefundsAppliedToResponse
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class RefundsAppliedToResponse {
  public static final String SERIALIZED_NAME_BILLING_DOCUMENT_ID = "billing_document_id";
  @SerializedName(SERIALIZED_NAME_BILLING_DOCUMENT_ID)
  private String billingDocumentId;

  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private String id;

  public static final String SERIALIZED_NAME_BILLING_DOCUMENT = "billing_document";
  @SerializedName(SERIALIZED_NAME_BILLING_DOCUMENT)
  private BillingDocument billingDocument;

  public static final String SERIALIZED_NAME_AMOUNT = "amount";
  @SerializedName(SERIALIZED_NAME_AMOUNT)
  private BigDecimal amount;

  /**
   * The type of billing document. Can be one of the credit memo or invoice.
   */
  @JsonAdapter(BillingDocumentTypeEnum.Adapter.class)
  public enum BillingDocumentTypeEnum {
    CREDIT_MEMO("credit_memo"),
    
    INVOICE("invoice"),
    
    UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

    private String value;

    BillingDocumentTypeEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static BillingDocumentTypeEnum fromValue(String value) {
      for (BillingDocumentTypeEnum b : BillingDocumentTypeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter {
      @Override
      public void write(final JsonWriter jsonWriter, final BillingDocumentTypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public BillingDocumentTypeEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return BillingDocumentTypeEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_BILLING_DOCUMENT_TYPE = "billing_document_type";
  @SerializedName(SERIALIZED_NAME_BILLING_DOCUMENT_TYPE)
  private BillingDocumentTypeEnum billingDocumentType;

  public static final String SERIALIZED_NAME_PAYMENT = "payment";
  @SerializedName(SERIALIZED_NAME_PAYMENT)
  private Payment payment;

  public static final String SERIALIZED_NAME_ITEMS = "items";
  @SerializedName(SERIALIZED_NAME_ITEMS)
  private List items = null;

  public RefundsAppliedToResponse() { 
  }

  public RefundsAppliedToResponse billingDocumentId(String billingDocumentId) {
    
    this.billingDocumentId = billingDocumentId;
    return this;
  }

   /**
   * Identifier of an invoice or a debit memo.
   * @return billingDocumentId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Identifier of an invoice or a debit memo.")

  public String getBillingDocumentId() {
    return billingDocumentId;
  }


  public void setBillingDocumentId(String billingDocumentId) {
    this.billingDocumentId = billingDocumentId;
  }


  public RefundsAppliedToResponse id(String id) {
    
    this.id = id;
    return this;
  }

   /**
   * Identifier of the refund application.
   * @return id
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Identifier of the refund application.")

  public String getId() {
    return id;
  }


  public void setId(String id) {
    this.id = id;
  }


  public RefundsAppliedToResponse billingDocument(BillingDocument billingDocument) {
    
    this.billingDocument = billingDocument;
    return this;
  }

   /**
   * The related billing document.
   * @return billingDocument
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The related billing document.")

  public BillingDocument getBillingDocument() {
    return billingDocument;
  }


  public void setBillingDocument(BillingDocument billingDocument) {
    this.billingDocument = billingDocument;
  }


  public RefundsAppliedToResponse amount(BigDecimal amount) {
    
    this.amount = amount;
    return this;
  }

   /**
   * The amount of the payment that is applied to the specific billing document item or taxation item.
   * @return amount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The amount of the payment that is applied to the specific billing document item or taxation item.")

  public BigDecimal getAmount() {
    return amount;
  }


  public void setAmount(BigDecimal amount) {
    this.amount = amount;
  }


  public RefundsAppliedToResponse billingDocumentType(BillingDocumentTypeEnum billingDocumentType) {
    
    this.billingDocumentType = billingDocumentType;
    return this;
  }

   /**
   * The type of billing document. Can be one of the credit memo or invoice.
   * @return billingDocumentType
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The type of billing document. Can be one of the credit memo or invoice.")

  public BillingDocumentTypeEnum getBillingDocumentType() {
    return billingDocumentType;
  }


  public void setBillingDocumentType(BillingDocumentTypeEnum billingDocumentType) {
    this.billingDocumentType = billingDocumentType;
  }


  public RefundsAppliedToResponse payment(Payment payment) {
    
    this.payment = payment;
    return this;
  }

   /**
   * Get payment
   * @return payment
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Payment getPayment() {
    return payment;
  }


  public void setPayment(Payment payment) {
    this.payment = payment;
  }


  public RefundsAppliedToResponse items(List items) {
    
    this.items = items;
    return this;
  }

  public RefundsAppliedToResponse addItemsItem(RefundAppliedToItemResponse itemsItem) {
    if (this.items == null) {
      this.items = new ArrayList();
    }
    this.items.add(itemsItem);
    return this;
  }

   /**
   * The related credit memo item.
   * @return items
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The related credit memo item.")

  public List getItems() {
    return items;
  }


  public void setItems(List items) {
    this.items = items;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    RefundsAppliedToResponse refundsAppliedToResponse = (RefundsAppliedToResponse) o;
    return Objects.equals(this.billingDocumentId, refundsAppliedToResponse.billingDocumentId) &&
        Objects.equals(this.id, refundsAppliedToResponse.id) &&
        Objects.equals(this.billingDocument, refundsAppliedToResponse.billingDocument) &&
        Objects.equals(this.amount, refundsAppliedToResponse.amount) &&
        Objects.equals(this.billingDocumentType, refundsAppliedToResponse.billingDocumentType) &&
        Objects.equals(this.payment, refundsAppliedToResponse.payment) &&
        Objects.equals(this.items, refundsAppliedToResponse.items);
  }

  private static  boolean equalsNullable(JsonNullable a, JsonNullable b) {
    return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
  }

  @Override
  public int hashCode() {
    return Objects.hash(billingDocumentId, id, billingDocument, amount, billingDocumentType, payment, items);
  }

  private static  int hashCodeNullable(JsonNullable a) {
    if (a == null) {
      return 1;
    }
    return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class RefundsAppliedToResponse {\n");
    sb.append("    billingDocumentId: ").append(toIndentedString(billingDocumentId)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    billingDocument: ").append(toIndentedString(billingDocument)).append("\n");
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
    sb.append("    billingDocumentType: ").append(toIndentedString(billingDocumentType)).append("\n");
    sb.append("    payment: ").append(toIndentedString(payment)).append("\n");
    sb.append("    items: ").append(toIndentedString(items)).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    ");
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy