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

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

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

  public static final String SERIALIZED_NAME_FAILED_REASON = "failed_reason";
  @SerializedName(SERIALIZED_NAME_FAILED_REASON)
  private String failedReason;

  public static final String SERIALIZED_NAME_INVOICE_NUMBER = "invoice_number";
  @SerializedName(SERIALIZED_NAME_INVOICE_NUMBER)
  private String invoiceNumber;

  public static final String SERIALIZED_NAME_INVOICE = "invoice";
  @SerializedName(SERIALIZED_NAME_INVOICE)
  private Invoice invoice;

  public static final String SERIALIZED_NAME_STATE = "state";
  @SerializedName(SERIALIZED_NAME_STATE)
  private Object state;

  public static final String SERIALIZED_NAME_CREDIT_MEMO_NUMBER = "credit_memo_number";
  @SerializedName(SERIALIZED_NAME_CREDIT_MEMO_NUMBER)
  private String creditMemoNumber;

  public WriteOff() { 
  }

  public WriteOff amount(String amount) {
    
    this.amount = amount;
    return this;
  }

   /**
   * The total billing document amount that is written off.
   * @return amount
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The total billing document amount that is written off.")

  public String getAmount() {
    return amount;
  }


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


  public WriteOff failedReason(String failedReason) {
    
    this.failedReason = failedReason;
    return this;
  }

   /**
   * Reasons for failure.
   * @return failedReason
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Reasons for failure.")

  public String getFailedReason() {
    return failedReason;
  }


  public void setFailedReason(String failedReason) {
    this.failedReason = failedReason;
  }


  public WriteOff invoiceNumber(String invoiceNumber) {
    
    this.invoiceNumber = invoiceNumber;
    return this;
  }

   /**
   * The invoice number.
   * @return invoiceNumber
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The invoice number.")

  public String getInvoiceNumber() {
    return invoiceNumber;
  }


  public void setInvoiceNumber(String invoiceNumber) {
    this.invoiceNumber = invoiceNumber;
  }


  public WriteOff invoice(Invoice invoice) {
    
    this.invoice = invoice;
    return this;
  }

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

  public Invoice getInvoice() {
    return invoice;
  }


  public void setInvoice(Invoice invoice) {
    this.invoice = invoice;
  }


  public WriteOff state(Object state) {
    
    this.state = state;
    return this;
  }

   /**
   * The states of the transactions.
   * @return state
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The states of the transactions.")

  public Object getState() {
    return state;
  }


  public void setState(Object state) {
    this.state = state;
  }


  public WriteOff creditMemoNumber(String creditMemoNumber) {
    
    this.creditMemoNumber = creditMemoNumber;
    return this;
  }

   /**
   * The credit memo number.
   * @return creditMemoNumber
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The credit memo number.")

  public String getCreditMemoNumber() {
    return creditMemoNumber;
  }


  public void setCreditMemoNumber(String creditMemoNumber) {
    this.creditMemoNumber = creditMemoNumber;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    WriteOff writeOff = (WriteOff) o;
    return Objects.equals(this.amount, writeOff.amount) &&
        Objects.equals(this.failedReason, writeOff.failedReason) &&
        Objects.equals(this.invoiceNumber, writeOff.invoiceNumber) &&
        Objects.equals(this.invoice, writeOff.invoice) &&
        Objects.equals(this.state, writeOff.state) &&
        Objects.equals(this.creditMemoNumber, writeOff.creditMemoNumber);
  }

  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(amount, failedReason, invoiceNumber, invoice, state, creditMemoNumber);
  }

  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 WriteOff {\n");
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
    sb.append("    failedReason: ").append(toIndentedString(failedReason)).append("\n");
    sb.append("    invoiceNumber: ").append(toIndentedString(invoiceNumber)).append("\n");
    sb.append("    invoice: ").append(toIndentedString(invoice)).append("\n");
    sb.append("    state: ").append(toIndentedString(state)).append("\n");
    sb.append("    creditMemoNumber: ").append(toIndentedString(creditMemoNumber)).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