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

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

The 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 org.openapitools.client.model.BillingDocument;
import org.openapitools.jackson.nullable.JsonNullable;

import org.openapitools.client.JSON.CustomFieldAdapter;
import org.openapitools.client.JSON.NullableFieldAdapter;
/**
 * CreditMemoAppliedToResponse
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class CreditMemoAppliedToResponse {
  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_AMOUNT = "amount";
  @SerializedName(SERIALIZED_NAME_AMOUNT)
  private BigDecimal amount;

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

  /**
   * The type of billing document. Can be one of the debit memo or invoice.
   */
  @JsonAdapter(BillingDocumentTypeEnum.Adapter.class)
  public enum BillingDocumentTypeEnum {
    DEBIT_MEMO("debit_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 CreditMemoAppliedToResponse() { 
  }

  public CreditMemoAppliedToResponse 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 CreditMemoAppliedToResponse id(String id) {
    
    this.id = id;
    return this;
  }

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

  public String getId() {
    return id;
  }


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


  public CreditMemoAppliedToResponse 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 CreditMemoAppliedToResponse 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 CreditMemoAppliedToResponse billingDocumentType(BillingDocumentTypeEnum billingDocumentType) {
    
    this.billingDocumentType = billingDocumentType;
    return this;
  }

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

  public BillingDocumentTypeEnum getBillingDocumentType() {
    return billingDocumentType;
  }


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


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

  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, amount, billingDocument, billingDocumentType);
  }

  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 CreditMemoAppliedToResponse {\n");
    sb.append("    billingDocumentId: ").append(toIndentedString(billingDocumentId)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
    sb.append("    billingDocument: ").append(toIndentedString(billingDocument)).append("\n");
    sb.append("    billingDocumentType: ").append(toIndentedString(billingDocumentType)).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