/*
 * Swagger of Opencellsoft Api
 * @#Introduction
 *
 * The version of the OpenAPI document: 7.3.1-SNAPSHOT
 * Contact: contact@opencellsoft.fr
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


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.Auditable;
import org.openapitools.client.model.AuditableFieldHistory;
import org.openapitools.client.model.BusinessEntity;
import org.openapitools.client.model.Calendar;
import org.openapitools.client.model.ChargeTemplate;
import org.openapitools.client.model.CounterInstance;
import org.openapitools.client.model.Seller;
import org.openapitools.client.model.ServiceInstance;
import org.openapitools.client.model.Subscription;
import org.openapitools.client.model.TradingCountry;
import org.openapitools.client.model.TradingCurrency;
import org.openapitools.client.model.UserAccount;
import org.openapitools.client.model.WalletInstance;
import org.openapitools.client.model.WalletOperation;
import org.threeten.bp.OffsetDateTime;

/**
 * UsageChargeInstance
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2019-09-13T10:03:17.753Z[GMT]")
public class UsageChargeInstance {
  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private Long id;

  public static final String SERIALIZED_NAME_VERSION = "version";
  @SerializedName(SERIALIZED_NAME_VERSION)
  private Integer version;

  public static final String SERIALIZED_NAME_AUDITABLE = "auditable";
  @SerializedName(SERIALIZED_NAME_AUDITABLE)
  private Auditable auditable;

  public static final String SERIALIZED_NAME_HISTORIZED = "historized";
  @SerializedName(SERIALIZED_NAME_HISTORIZED)
  private Boolean historized;

  public static final String SERIALIZED_NAME_NOTIFIED = "notified";
  @SerializedName(SERIALIZED_NAME_NOTIFIED)
  private Boolean notified;

  public static final String SERIALIZED_NAME_AUDITABLE_FIELDS = "auditableFields";
  @SerializedName(SERIALIZED_NAME_AUDITABLE_FIELDS)
  private List<AuditableFieldHistory> auditableFields = null;

  public static final String SERIALIZED_NAME_CODE = "code";
  @SerializedName(SERIALIZED_NAME_CODE)
  private String code;

  public static final String SERIALIZED_NAME_DESCRIPTION = "description";
  @SerializedName(SERIALIZED_NAME_DESCRIPTION)
  private String description;

  public static final String SERIALIZED_NAME_APPEND_GENERATED_CODE = "appendGeneratedCode";
  @SerializedName(SERIALIZED_NAME_APPEND_GENERATED_CODE)
  private Boolean appendGeneratedCode;

  /**
   * Gets or Sets status
   */
  @JsonAdapter(StatusEnum.Adapter.class)
  public enum StatusEnum {
    ACTIVE("ACTIVE"),
    
    INACTIVE("INACTIVE"),
    
    CANCELED("CANCELED"),
    
    TERMINATED("TERMINATED"),
    
    SUSPENDED("SUSPENDED"),
    
    CLOSED("CLOSED");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_STATUS = "status";
  @SerializedName(SERIALIZED_NAME_STATUS)
  private StatusEnum status;

  public static final String SERIALIZED_NAME_STATUS_DATE = "statusDate";
  @SerializedName(SERIALIZED_NAME_STATUS_DATE)
  private OffsetDateTime statusDate;

  public static final String SERIALIZED_NAME_TERMINATION_DATE = "terminationDate";
  @SerializedName(SERIALIZED_NAME_TERMINATION_DATE)
  private OffsetDateTime terminationDate;

  public static final String SERIALIZED_NAME_CHARGE_TEMPLATE = "chargeTemplate";
  @SerializedName(SERIALIZED_NAME_CHARGE_TEMPLATE)
  private ChargeTemplate chargeTemplate;

  public static final String SERIALIZED_NAME_INVOICING_CALENDAR = "invoicingCalendar";
  @SerializedName(SERIALIZED_NAME_INVOICING_CALENDAR)
  private Calendar invoicingCalendar;

  public static final String SERIALIZED_NAME_CHARGE_DATE = "chargeDate";
  @SerializedName(SERIALIZED_NAME_CHARGE_DATE)
  private OffsetDateTime chargeDate;

  public static final String SERIALIZED_NAME_AMOUNT_WITHOUT_TAX = "amountWithoutTax";
  @SerializedName(SERIALIZED_NAME_AMOUNT_WITHOUT_TAX)
  private BigDecimal amountWithoutTax;

  public static final String SERIALIZED_NAME_AMOUNT_WITH_TAX = "amountWithTax";
  @SerializedName(SERIALIZED_NAME_AMOUNT_WITH_TAX)
  private BigDecimal amountWithTax;

  public static final String SERIALIZED_NAME_CRITERIA1 = "criteria1";
  @SerializedName(SERIALIZED_NAME_CRITERIA1)
  private String criteria1;

  public static final String SERIALIZED_NAME_CRITERIA2 = "criteria2";
  @SerializedName(SERIALIZED_NAME_CRITERIA2)
  private String criteria2;

  public static final String SERIALIZED_NAME_CRITERIA3 = "criteria3";
  @SerializedName(SERIALIZED_NAME_CRITERIA3)
  private String criteria3;

  public static final String SERIALIZED_NAME_SELLER = "seller";
  @SerializedName(SERIALIZED_NAME_SELLER)
  private Seller seller;

  public static final String SERIALIZED_NAME_USER_ACCOUNT = "userAccount";
  @SerializedName(SERIALIZED_NAME_USER_ACCOUNT)
  private UserAccount userAccount;

  public static final String SERIALIZED_NAME_SUBSCRIPTION = "subscription";
  @SerializedName(SERIALIZED_NAME_SUBSCRIPTION)
  private Subscription subscription;

  public static final String SERIALIZED_NAME_PR_DESCRIPTION = "prDescription";
  @SerializedName(SERIALIZED_NAME_PR_DESCRIPTION)
  private String prDescription;

  public static final String SERIALIZED_NAME_CURRENCY = "currency";
  @SerializedName(SERIALIZED_NAME_CURRENCY)
  private TradingCurrency currency;

  public static final String SERIALIZED_NAME_COUNTRY = "country";
  @SerializedName(SERIALIZED_NAME_COUNTRY)
  private TradingCountry country;

  public static final String SERIALIZED_NAME_WALLET_INSTANCES = "walletInstances";
  @SerializedName(SERIALIZED_NAME_WALLET_INSTANCES)
  private List<WalletInstance> walletInstances = null;

  public static final String SERIALIZED_NAME_PREPAID_WALLET_INSTANCES = "prepaidWalletInstances";
  @SerializedName(SERIALIZED_NAME_PREPAID_WALLET_INSTANCES)
  private List<WalletInstance> prepaidWalletInstances = null;

  public static final String SERIALIZED_NAME_PREPAID = "prepaid";
  @SerializedName(SERIALIZED_NAME_PREPAID)
  private Boolean prepaid;

  public static final String SERIALIZED_NAME_ORDER_NUMBER = "orderNumber";
  @SerializedName(SERIALIZED_NAME_ORDER_NUMBER)
  private String orderNumber;

  public static final String SERIALIZED_NAME_SERVICE_INSTANCE = "serviceInstance";
  @SerializedName(SERIALIZED_NAME_SERVICE_INSTANCE)
  private ServiceInstance serviceInstance;

  public static final String SERIALIZED_NAME_COUNTER = "counter";
  @SerializedName(SERIALIZED_NAME_COUNTER)
  private CounterInstance counter;

  public static final String SERIALIZED_NAME_RATING_UNIT_DESCRIPTION = "ratingUnitDescription";
  @SerializedName(SERIALIZED_NAME_RATING_UNIT_DESCRIPTION)
  private String ratingUnitDescription;

  public static final String SERIALIZED_NAME_LAST_UPDATE = "lastUpdate";
  @SerializedName(SERIALIZED_NAME_LAST_UPDATE)
  private OffsetDateTime lastUpdate;

  public static final String SERIALIZED_NAME_PRIORITY = "priority";
  @SerializedName(SERIALIZED_NAME_PRIORITY)
  private Integer priority;

  public static final String SERIALIZED_NAME_WALLET_OPERATIONS_SORTED = "walletOperationsSorted";
  @SerializedName(SERIALIZED_NAME_WALLET_OPERATIONS_SORTED)
  private List<WalletOperation> walletOperationsSorted = null;

  public static final String SERIALIZED_NAME_DESCRIPTION_OR_CODE = "descriptionOrCode";
  @SerializedName(SERIALIZED_NAME_DESCRIPTION_OR_CODE)
  private String descriptionOrCode;

  public static final String SERIALIZED_NAME_DESCRIPTION_AND_CODE = "descriptionAndCode";
  @SerializedName(SERIALIZED_NAME_DESCRIPTION_AND_CODE)
  private String descriptionAndCode;

  public static final String SERIALIZED_NAME_REFERENCE_CODE = "referenceCode";
  @SerializedName(SERIALIZED_NAME_REFERENCE_CODE)
  private String referenceCode;

  public static final String SERIALIZED_NAME_REFERENCE_DESCRIPTION = "referenceDescription";
  @SerializedName(SERIALIZED_NAME_REFERENCE_DESCRIPTION)
  private String referenceDescription;

  public static final String SERIALIZED_NAME_CODE_CHANGED = "codeChanged";
  @SerializedName(SERIALIZED_NAME_CODE_CHANGED)
  private Boolean codeChanged;

  public static final String SERIALIZED_NAME_PARENT_ENTITY = "parentEntity";
  @SerializedName(SERIALIZED_NAME_PARENT_ENTITY)
  private BusinessEntity parentEntity;

  public static final String SERIALIZED_NAME_TRANSIENT = "transient";
  @SerializedName(SERIALIZED_NAME_TRANSIENT)
  private Boolean _transient;


  public UsageChargeInstance id(Long id) {
    
    this.id = id;
    return this;
  }

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

  public Long getId() {
    return id;
  }



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


  public UsageChargeInstance version(Integer version) {
    
    this.version = version;
    return this;
  }

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

  public Integer getVersion() {
    return version;
  }



  public void setVersion(Integer version) {
    this.version = version;
  }


  public UsageChargeInstance auditable(Auditable auditable) {
    
    this.auditable = auditable;
    return this;
  }

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

  public Auditable getAuditable() {
    return auditable;
  }



  public void setAuditable(Auditable auditable) {
    this.auditable = auditable;
  }


  public UsageChargeInstance historized(Boolean historized) {
    
    this.historized = historized;
    return this;
  }

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

  public Boolean getHistorized() {
    return historized;
  }



  public void setHistorized(Boolean historized) {
    this.historized = historized;
  }


  public UsageChargeInstance notified(Boolean notified) {
    
    this.notified = notified;
    return this;
  }

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

  public Boolean getNotified() {
    return notified;
  }



  public void setNotified(Boolean notified) {
    this.notified = notified;
  }


  public UsageChargeInstance auditableFields(List<AuditableFieldHistory> auditableFields) {
    
    this.auditableFields = auditableFields;
    return this;
  }

  public UsageChargeInstance addAuditableFieldsItem(AuditableFieldHistory auditableFieldsItem) {
    if (this.auditableFields == null) {
      this.auditableFields = new ArrayList<AuditableFieldHistory>();
    }
    this.auditableFields.add(auditableFieldsItem);
    return this;
  }

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

  public List<AuditableFieldHistory> getAuditableFields() {
    return auditableFields;
  }



  public void setAuditableFields(List<AuditableFieldHistory> auditableFields) {
    this.auditableFields = auditableFields;
  }


  public UsageChargeInstance code(String code) {
    
    this.code = code;
    return this;
  }

   /**
   * Get code
   * @return code
  **/
  @ApiModelProperty(required = true, value = "")

  public String getCode() {
    return code;
  }



  public void setCode(String code) {
    this.code = code;
  }


  public UsageChargeInstance description(String description) {
    
    this.description = description;
    return this;
  }

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

  public String getDescription() {
    return description;
  }



  public void setDescription(String description) {
    this.description = description;
  }


  public UsageChargeInstance appendGeneratedCode(Boolean appendGeneratedCode) {
    
    this.appendGeneratedCode = appendGeneratedCode;
    return this;
  }

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

  public Boolean getAppendGeneratedCode() {
    return appendGeneratedCode;
  }



  public void setAppendGeneratedCode(Boolean appendGeneratedCode) {
    this.appendGeneratedCode = appendGeneratedCode;
  }


  public UsageChargeInstance status(StatusEnum status) {
    
    this.status = status;
    return this;
  }

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

  public StatusEnum getStatus() {
    return status;
  }



  public void setStatus(StatusEnum status) {
    this.status = status;
  }


  public UsageChargeInstance statusDate(OffsetDateTime statusDate) {
    
    this.statusDate = statusDate;
    return this;
  }

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

  public OffsetDateTime getStatusDate() {
    return statusDate;
  }



  public void setStatusDate(OffsetDateTime statusDate) {
    this.statusDate = statusDate;
  }


  public UsageChargeInstance terminationDate(OffsetDateTime terminationDate) {
    
    this.terminationDate = terminationDate;
    return this;
  }

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

  public OffsetDateTime getTerminationDate() {
    return terminationDate;
  }



  public void setTerminationDate(OffsetDateTime terminationDate) {
    this.terminationDate = terminationDate;
  }


  public UsageChargeInstance chargeTemplate(ChargeTemplate chargeTemplate) {
    
    this.chargeTemplate = chargeTemplate;
    return this;
  }

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

  public ChargeTemplate getChargeTemplate() {
    return chargeTemplate;
  }



  public void setChargeTemplate(ChargeTemplate chargeTemplate) {
    this.chargeTemplate = chargeTemplate;
  }


  public UsageChargeInstance invoicingCalendar(Calendar invoicingCalendar) {
    
    this.invoicingCalendar = invoicingCalendar;
    return this;
  }

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

  public Calendar getInvoicingCalendar() {
    return invoicingCalendar;
  }



  public void setInvoicingCalendar(Calendar invoicingCalendar) {
    this.invoicingCalendar = invoicingCalendar;
  }


  public UsageChargeInstance chargeDate(OffsetDateTime chargeDate) {
    
    this.chargeDate = chargeDate;
    return this;
  }

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

  public OffsetDateTime getChargeDate() {
    return chargeDate;
  }



  public void setChargeDate(OffsetDateTime chargeDate) {
    this.chargeDate = chargeDate;
  }


  public UsageChargeInstance amountWithoutTax(BigDecimal amountWithoutTax) {
    
    this.amountWithoutTax = amountWithoutTax;
    return this;
  }

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

  public BigDecimal getAmountWithoutTax() {
    return amountWithoutTax;
  }



  public void setAmountWithoutTax(BigDecimal amountWithoutTax) {
    this.amountWithoutTax = amountWithoutTax;
  }


  public UsageChargeInstance amountWithTax(BigDecimal amountWithTax) {
    
    this.amountWithTax = amountWithTax;
    return this;
  }

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

  public BigDecimal getAmountWithTax() {
    return amountWithTax;
  }



  public void setAmountWithTax(BigDecimal amountWithTax) {
    this.amountWithTax = amountWithTax;
  }


  public UsageChargeInstance criteria1(String criteria1) {
    
    this.criteria1 = criteria1;
    return this;
  }

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

  public String getCriteria1() {
    return criteria1;
  }



  public void setCriteria1(String criteria1) {
    this.criteria1 = criteria1;
  }


  public UsageChargeInstance criteria2(String criteria2) {
    
    this.criteria2 = criteria2;
    return this;
  }

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

  public String getCriteria2() {
    return criteria2;
  }



  public void setCriteria2(String criteria2) {
    this.criteria2 = criteria2;
  }


  public UsageChargeInstance criteria3(String criteria3) {
    
    this.criteria3 = criteria3;
    return this;
  }

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

  public String getCriteria3() {
    return criteria3;
  }



  public void setCriteria3(String criteria3) {
    this.criteria3 = criteria3;
  }


  public UsageChargeInstance seller(Seller seller) {
    
    this.seller = seller;
    return this;
  }

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

  public Seller getSeller() {
    return seller;
  }



  public void setSeller(Seller seller) {
    this.seller = seller;
  }


  public UsageChargeInstance userAccount(UserAccount userAccount) {
    
    this.userAccount = userAccount;
    return this;
  }

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

  public UserAccount getUserAccount() {
    return userAccount;
  }



  public void setUserAccount(UserAccount userAccount) {
    this.userAccount = userAccount;
  }


  public UsageChargeInstance subscription(Subscription subscription) {
    
    this.subscription = subscription;
    return this;
  }

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

  public Subscription getSubscription() {
    return subscription;
  }



  public void setSubscription(Subscription subscription) {
    this.subscription = subscription;
  }


  public UsageChargeInstance prDescription(String prDescription) {
    
    this.prDescription = prDescription;
    return this;
  }

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

  public String getPrDescription() {
    return prDescription;
  }



  public void setPrDescription(String prDescription) {
    this.prDescription = prDescription;
  }


  public UsageChargeInstance currency(TradingCurrency currency) {
    
    this.currency = currency;
    return this;
  }

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

  public TradingCurrency getCurrency() {
    return currency;
  }



  public void setCurrency(TradingCurrency currency) {
    this.currency = currency;
  }


  public UsageChargeInstance country(TradingCountry country) {
    
    this.country = country;
    return this;
  }

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

  public TradingCountry getCountry() {
    return country;
  }



  public void setCountry(TradingCountry country) {
    this.country = country;
  }


  public UsageChargeInstance walletInstances(List<WalletInstance> walletInstances) {
    
    this.walletInstances = walletInstances;
    return this;
  }

  public UsageChargeInstance addWalletInstancesItem(WalletInstance walletInstancesItem) {
    if (this.walletInstances == null) {
      this.walletInstances = new ArrayList<WalletInstance>();
    }
    this.walletInstances.add(walletInstancesItem);
    return this;
  }

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

  public List<WalletInstance> getWalletInstances() {
    return walletInstances;
  }



  public void setWalletInstances(List<WalletInstance> walletInstances) {
    this.walletInstances = walletInstances;
  }


  public UsageChargeInstance prepaidWalletInstances(List<WalletInstance> prepaidWalletInstances) {
    
    this.prepaidWalletInstances = prepaidWalletInstances;
    return this;
  }

  public UsageChargeInstance addPrepaidWalletInstancesItem(WalletInstance prepaidWalletInstancesItem) {
    if (this.prepaidWalletInstances == null) {
      this.prepaidWalletInstances = new ArrayList<WalletInstance>();
    }
    this.prepaidWalletInstances.add(prepaidWalletInstancesItem);
    return this;
  }

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

  public List<WalletInstance> getPrepaidWalletInstances() {
    return prepaidWalletInstances;
  }



  public void setPrepaidWalletInstances(List<WalletInstance> prepaidWalletInstances) {
    this.prepaidWalletInstances = prepaidWalletInstances;
  }


  public UsageChargeInstance prepaid(Boolean prepaid) {
    
    this.prepaid = prepaid;
    return this;
  }

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

  public Boolean getPrepaid() {
    return prepaid;
  }



  public void setPrepaid(Boolean prepaid) {
    this.prepaid = prepaid;
  }


  public UsageChargeInstance orderNumber(String orderNumber) {
    
    this.orderNumber = orderNumber;
    return this;
  }

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

  public String getOrderNumber() {
    return orderNumber;
  }



  public void setOrderNumber(String orderNumber) {
    this.orderNumber = orderNumber;
  }


  public UsageChargeInstance serviceInstance(ServiceInstance serviceInstance) {
    
    this.serviceInstance = serviceInstance;
    return this;
  }

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

  public ServiceInstance getServiceInstance() {
    return serviceInstance;
  }



  public void setServiceInstance(ServiceInstance serviceInstance) {
    this.serviceInstance = serviceInstance;
  }


  public UsageChargeInstance counter(CounterInstance counter) {
    
    this.counter = counter;
    return this;
  }

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

  public CounterInstance getCounter() {
    return counter;
  }



  public void setCounter(CounterInstance counter) {
    this.counter = counter;
  }


  public UsageChargeInstance ratingUnitDescription(String ratingUnitDescription) {
    
    this.ratingUnitDescription = ratingUnitDescription;
    return this;
  }

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

  public String getRatingUnitDescription() {
    return ratingUnitDescription;
  }



  public void setRatingUnitDescription(String ratingUnitDescription) {
    this.ratingUnitDescription = ratingUnitDescription;
  }


  public UsageChargeInstance lastUpdate(OffsetDateTime lastUpdate) {
    
    this.lastUpdate = lastUpdate;
    return this;
  }

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

  public OffsetDateTime getLastUpdate() {
    return lastUpdate;
  }



  public void setLastUpdate(OffsetDateTime lastUpdate) {
    this.lastUpdate = lastUpdate;
  }


  public UsageChargeInstance priority(Integer priority) {
    
    this.priority = priority;
    return this;
  }

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

  public Integer getPriority() {
    return priority;
  }



  public void setPriority(Integer priority) {
    this.priority = priority;
  }


  public UsageChargeInstance walletOperationsSorted(List<WalletOperation> walletOperationsSorted) {
    
    this.walletOperationsSorted = walletOperationsSorted;
    return this;
  }

  public UsageChargeInstance addWalletOperationsSortedItem(WalletOperation walletOperationsSortedItem) {
    if (this.walletOperationsSorted == null) {
      this.walletOperationsSorted = new ArrayList<WalletOperation>();
    }
    this.walletOperationsSorted.add(walletOperationsSortedItem);
    return this;
  }

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

  public List<WalletOperation> getWalletOperationsSorted() {
    return walletOperationsSorted;
  }



  public void setWalletOperationsSorted(List<WalletOperation> walletOperationsSorted) {
    this.walletOperationsSorted = walletOperationsSorted;
  }


  public UsageChargeInstance descriptionOrCode(String descriptionOrCode) {
    
    this.descriptionOrCode = descriptionOrCode;
    return this;
  }

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

  public String getDescriptionOrCode() {
    return descriptionOrCode;
  }



  public void setDescriptionOrCode(String descriptionOrCode) {
    this.descriptionOrCode = descriptionOrCode;
  }


  public UsageChargeInstance descriptionAndCode(String descriptionAndCode) {
    
    this.descriptionAndCode = descriptionAndCode;
    return this;
  }

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

  public String getDescriptionAndCode() {
    return descriptionAndCode;
  }



  public void setDescriptionAndCode(String descriptionAndCode) {
    this.descriptionAndCode = descriptionAndCode;
  }


  public UsageChargeInstance referenceCode(String referenceCode) {
    
    this.referenceCode = referenceCode;
    return this;
  }

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

  public String getReferenceCode() {
    return referenceCode;
  }



  public void setReferenceCode(String referenceCode) {
    this.referenceCode = referenceCode;
  }


  public UsageChargeInstance referenceDescription(String referenceDescription) {
    
    this.referenceDescription = referenceDescription;
    return this;
  }

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

  public String getReferenceDescription() {
    return referenceDescription;
  }



  public void setReferenceDescription(String referenceDescription) {
    this.referenceDescription = referenceDescription;
  }


  public UsageChargeInstance codeChanged(Boolean codeChanged) {
    
    this.codeChanged = codeChanged;
    return this;
  }

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

  public Boolean getCodeChanged() {
    return codeChanged;
  }



  public void setCodeChanged(Boolean codeChanged) {
    this.codeChanged = codeChanged;
  }


  public UsageChargeInstance parentEntity(BusinessEntity parentEntity) {
    
    this.parentEntity = parentEntity;
    return this;
  }

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

  public BusinessEntity getParentEntity() {
    return parentEntity;
  }



  public void setParentEntity(BusinessEntity parentEntity) {
    this.parentEntity = parentEntity;
  }


  public UsageChargeInstance _transient(Boolean _transient) {
    
    this._transient = _transient;
    return this;
  }

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

  public Boolean getTransient() {
    return _transient;
  }



  public void setTransient(Boolean _transient) {
    this._transient = _transient;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    UsageChargeInstance usageChargeInstance = (UsageChargeInstance) o;
    return Objects.equals(this.id, usageChargeInstance.id) &&
        Objects.equals(this.version, usageChargeInstance.version) &&
        Objects.equals(this.auditable, usageChargeInstance.auditable) &&
        Objects.equals(this.historized, usageChargeInstance.historized) &&
        Objects.equals(this.notified, usageChargeInstance.notified) &&
        Objects.equals(this.auditableFields, usageChargeInstance.auditableFields) &&
        Objects.equals(this.code, usageChargeInstance.code) &&
        Objects.equals(this.description, usageChargeInstance.description) &&
        Objects.equals(this.appendGeneratedCode, usageChargeInstance.appendGeneratedCode) &&
        Objects.equals(this.status, usageChargeInstance.status) &&
        Objects.equals(this.statusDate, usageChargeInstance.statusDate) &&
        Objects.equals(this.terminationDate, usageChargeInstance.terminationDate) &&
        Objects.equals(this.chargeTemplate, usageChargeInstance.chargeTemplate) &&
        Objects.equals(this.invoicingCalendar, usageChargeInstance.invoicingCalendar) &&
        Objects.equals(this.chargeDate, usageChargeInstance.chargeDate) &&
        Objects.equals(this.amountWithoutTax, usageChargeInstance.amountWithoutTax) &&
        Objects.equals(this.amountWithTax, usageChargeInstance.amountWithTax) &&
        Objects.equals(this.criteria1, usageChargeInstance.criteria1) &&
        Objects.equals(this.criteria2, usageChargeInstance.criteria2) &&
        Objects.equals(this.criteria3, usageChargeInstance.criteria3) &&
        Objects.equals(this.seller, usageChargeInstance.seller) &&
        Objects.equals(this.userAccount, usageChargeInstance.userAccount) &&
        Objects.equals(this.subscription, usageChargeInstance.subscription) &&
        Objects.equals(this.prDescription, usageChargeInstance.prDescription) &&
        Objects.equals(this.currency, usageChargeInstance.currency) &&
        Objects.equals(this.country, usageChargeInstance.country) &&
        Objects.equals(this.walletInstances, usageChargeInstance.walletInstances) &&
        Objects.equals(this.prepaidWalletInstances, usageChargeInstance.prepaidWalletInstances) &&
        Objects.equals(this.prepaid, usageChargeInstance.prepaid) &&
        Objects.equals(this.orderNumber, usageChargeInstance.orderNumber) &&
        Objects.equals(this.serviceInstance, usageChargeInstance.serviceInstance) &&
        Objects.equals(this.counter, usageChargeInstance.counter) &&
        Objects.equals(this.ratingUnitDescription, usageChargeInstance.ratingUnitDescription) &&
        Objects.equals(this.lastUpdate, usageChargeInstance.lastUpdate) &&
        Objects.equals(this.priority, usageChargeInstance.priority) &&
        Objects.equals(this.walletOperationsSorted, usageChargeInstance.walletOperationsSorted) &&
        Objects.equals(this.descriptionOrCode, usageChargeInstance.descriptionOrCode) &&
        Objects.equals(this.descriptionAndCode, usageChargeInstance.descriptionAndCode) &&
        Objects.equals(this.referenceCode, usageChargeInstance.referenceCode) &&
        Objects.equals(this.referenceDescription, usageChargeInstance.referenceDescription) &&
        Objects.equals(this.codeChanged, usageChargeInstance.codeChanged) &&
        Objects.equals(this.parentEntity, usageChargeInstance.parentEntity) &&
        Objects.equals(this._transient, usageChargeInstance._transient);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, version, auditable, historized, notified, auditableFields, code, description, appendGeneratedCode, status, statusDate, terminationDate, chargeTemplate, invoicingCalendar, chargeDate, amountWithoutTax, amountWithTax, criteria1, criteria2, criteria3, seller, userAccount, subscription, prDescription, currency, country, walletInstances, prepaidWalletInstances, prepaid, orderNumber, serviceInstance, counter, ratingUnitDescription, lastUpdate, priority, walletOperationsSorted, descriptionOrCode, descriptionAndCode, referenceCode, referenceDescription, codeChanged, parentEntity, _transient);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class UsageChargeInstance {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    version: ").append(toIndentedString(version)).append("\n");
    sb.append("    auditable: ").append(toIndentedString(auditable)).append("\n");
    sb.append("    historized: ").append(toIndentedString(historized)).append("\n");
    sb.append("    notified: ").append(toIndentedString(notified)).append("\n");
    sb.append("    auditableFields: ").append(toIndentedString(auditableFields)).append("\n");
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    appendGeneratedCode: ").append(toIndentedString(appendGeneratedCode)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    statusDate: ").append(toIndentedString(statusDate)).append("\n");
    sb.append("    terminationDate: ").append(toIndentedString(terminationDate)).append("\n");
    sb.append("    chargeTemplate: ").append(toIndentedString(chargeTemplate)).append("\n");
    sb.append("    invoicingCalendar: ").append(toIndentedString(invoicingCalendar)).append("\n");
    sb.append("    chargeDate: ").append(toIndentedString(chargeDate)).append("\n");
    sb.append("    amountWithoutTax: ").append(toIndentedString(amountWithoutTax)).append("\n");
    sb.append("    amountWithTax: ").append(toIndentedString(amountWithTax)).append("\n");
    sb.append("    criteria1: ").append(toIndentedString(criteria1)).append("\n");
    sb.append("    criteria2: ").append(toIndentedString(criteria2)).append("\n");
    sb.append("    criteria3: ").append(toIndentedString(criteria3)).append("\n");
    sb.append("    seller: ").append(toIndentedString(seller)).append("\n");
    sb.append("    userAccount: ").append(toIndentedString(userAccount)).append("\n");
    sb.append("    subscription: ").append(toIndentedString(subscription)).append("\n");
    sb.append("    prDescription: ").append(toIndentedString(prDescription)).append("\n");
    sb.append("    currency: ").append(toIndentedString(currency)).append("\n");
    sb.append("    country: ").append(toIndentedString(country)).append("\n");
    sb.append("    walletInstances: ").append(toIndentedString(walletInstances)).append("\n");
    sb.append("    prepaidWalletInstances: ").append(toIndentedString(prepaidWalletInstances)).append("\n");
    sb.append("    prepaid: ").append(toIndentedString(prepaid)).append("\n");
    sb.append("    orderNumber: ").append(toIndentedString(orderNumber)).append("\n");
    sb.append("    serviceInstance: ").append(toIndentedString(serviceInstance)).append("\n");
    sb.append("    counter: ").append(toIndentedString(counter)).append("\n");
    sb.append("    ratingUnitDescription: ").append(toIndentedString(ratingUnitDescription)).append("\n");
    sb.append("    lastUpdate: ").append(toIndentedString(lastUpdate)).append("\n");
    sb.append("    priority: ").append(toIndentedString(priority)).append("\n");
    sb.append("    walletOperationsSorted: ").append(toIndentedString(walletOperationsSorted)).append("\n");
    sb.append("    descriptionOrCode: ").append(toIndentedString(descriptionOrCode)).append("\n");
    sb.append("    descriptionAndCode: ").append(toIndentedString(descriptionAndCode)).append("\n");
    sb.append("    referenceCode: ").append(toIndentedString(referenceCode)).append("\n");
    sb.append("    referenceDescription: ").append(toIndentedString(referenceDescription)).append("\n");
    sb.append("    codeChanged: ").append(toIndentedString(codeChanged)).append("\n");
    sb.append("    parentEntity: ").append(toIndentedString(parentEntity)).append("\n");
    sb.append("    _transient: ").append(toIndentedString(_transient)).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(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

