/*
 * 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.util.ArrayList;
import java.util.List;
import org.openapitools.client.model.OrderItem;
import org.openapitools.client.model.OrderLinks;
import org.openapitools.client.model.PaymentMethod;
import org.openapitools.client.model.Resource;

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

  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;

  /**
   * Order status lifecycle
   */
  @JsonAdapter(StatusEnum.Adapter.class)
  public enum StatusEnum {
    IN_CREATION("IN_CREATION"),
    
    ACKNOWLEDGED("ACKNOWLEDGED"),
    
    IN_PROGRESS("IN_PROGRESS"),
    
    CANCELLED("CANCELLED"),
    
    COMPLETED("COMPLETED"),
    
    REJECTED("REJECTED"),
    
    PENDING("PENDING"),
    
    HELD("HELD"),
    
    FAILED("FAILED"),
    
    PARTIAL("PARTIAL");

    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_REQUESTED_PROCESSING_START_DATE = "requestedProcessingStartDate";
  @SerializedName(SERIALIZED_NAME_REQUESTED_PROCESSING_START_DATE)
  private String requestedProcessingStartDate;

  public static final String SERIALIZED_NAME_ORDER_ITEMS = "orderItems";
  @SerializedName(SERIALIZED_NAME_ORDER_ITEMS)
  private List<OrderItem> orderItems = null;

  public static final String SERIALIZED_NAME_BILLING_CYCLE = "billingCycle";
  @SerializedName(SERIALIZED_NAME_BILLING_CYCLE)
  private Resource billingCycle;

  public static final String SERIALIZED_NAME_PAYMENT_METHOD = "paymentMethod";
  @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD)
  private PaymentMethod paymentMethod;

  public static final String SERIALIZED_NAME_DELIVERY_INSTRUCTIONS = "deliveryInstructions";
  @SerializedName(SERIALIZED_NAME_DELIVERY_INSTRUCTIONS)
  private String deliveryInstructions;

  public static final String SERIALIZED_NAME_ORDER_DATE = "orderDate";
  @SerializedName(SERIALIZED_NAME_ORDER_DATE)
  private String orderDate;

  public static final String SERIALIZED_NAME_EXPECTED_COMPLETION_DATE = "expectedCompletionDate";
  @SerializedName(SERIALIZED_NAME_EXPECTED_COMPLETION_DATE)
  private String expectedCompletionDate;

  public static final String SERIALIZED_NAME_REQUESTED_COMPLETION_DATE = "requestedCompletionDate";
  @SerializedName(SERIALIZED_NAME_REQUESTED_COMPLETION_DATE)
  private String requestedCompletionDate;

  public static final String SERIALIZED_NAME_STATUS_MESSAGE = "statusMessage";
  @SerializedName(SERIALIZED_NAME_STATUS_MESSAGE)
  private String statusMessage;

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

  public static final String SERIALIZED_NAME_LINKS = "links";
  @SerializedName(SERIALIZED_NAME_LINKS)
  private List<OrderLinks> links = null;

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


  public Order category(String category) {
    
    this.category = category;
    return this;
  }

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

  public String getCategory() {
    return category;
  }



  public void setCategory(String category) {
    this.category = category;
  }


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

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

  public String getCode() {
    return code;
  }



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


  public Order 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 Order status(StatusEnum status) {
    
    this.status = status;
    return this;
  }

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

  public StatusEnum getStatus() {
    return status;
  }



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


  public Order requestedProcessingStartDate(String requestedProcessingStartDate) {
    
    this.requestedProcessingStartDate = requestedProcessingStartDate;
    return this;
  }

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

  public String getRequestedProcessingStartDate() {
    return requestedProcessingStartDate;
  }



  public void setRequestedProcessingStartDate(String requestedProcessingStartDate) {
    this.requestedProcessingStartDate = requestedProcessingStartDate;
  }


  public Order orderItems(List<OrderItem> orderItems) {
    
    this.orderItems = orderItems;
    return this;
  }

  public Order addOrderItemsItem(OrderItem orderItemsItem) {
    if (this.orderItems == null) {
      this.orderItems = new ArrayList<OrderItem>();
    }
    this.orderItems.add(orderItemsItem);
    return this;
  }

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

  public List<OrderItem> getOrderItems() {
    return orderItems;
  }



  public void setOrderItems(List<OrderItem> orderItems) {
    this.orderItems = orderItems;
  }


  public Order billingCycle(Resource billingCycle) {
    
    this.billingCycle = billingCycle;
    return this;
  }

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

  public Resource getBillingCycle() {
    return billingCycle;
  }



  public void setBillingCycle(Resource billingCycle) {
    this.billingCycle = billingCycle;
  }


  public Order paymentMethod(PaymentMethod paymentMethod) {
    
    this.paymentMethod = paymentMethod;
    return this;
  }

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

  public PaymentMethod getPaymentMethod() {
    return paymentMethod;
  }



  public void setPaymentMethod(PaymentMethod paymentMethod) {
    this.paymentMethod = paymentMethod;
  }


  public Order deliveryInstructions(String deliveryInstructions) {
    
    this.deliveryInstructions = deliveryInstructions;
    return this;
  }

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

  public String getDeliveryInstructions() {
    return deliveryInstructions;
  }



  public void setDeliveryInstructions(String deliveryInstructions) {
    this.deliveryInstructions = deliveryInstructions;
  }


  public Order orderDate(String orderDate) {
    
    this.orderDate = orderDate;
    return this;
  }

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

  public String getOrderDate() {
    return orderDate;
  }



  public void setOrderDate(String orderDate) {
    this.orderDate = orderDate;
  }


  public Order expectedCompletionDate(String expectedCompletionDate) {
    
    this.expectedCompletionDate = expectedCompletionDate;
    return this;
  }

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

  public String getExpectedCompletionDate() {
    return expectedCompletionDate;
  }



  public void setExpectedCompletionDate(String expectedCompletionDate) {
    this.expectedCompletionDate = expectedCompletionDate;
  }


  public Order requestedCompletionDate(String requestedCompletionDate) {
    
    this.requestedCompletionDate = requestedCompletionDate;
    return this;
  }

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

  public String getRequestedCompletionDate() {
    return requestedCompletionDate;
  }



  public void setRequestedCompletionDate(String requestedCompletionDate) {
    this.requestedCompletionDate = requestedCompletionDate;
  }


  public Order statusMessage(String statusMessage) {
    
    this.statusMessage = statusMessage;
    return this;
  }

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

  public String getStatusMessage() {
    return statusMessage;
  }



  public void setStatusMessage(String statusMessage) {
    this.statusMessage = statusMessage;
  }


  public Order priority(Long priority) {
    
    this.priority = priority;
    return this;
  }

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

  public Long getPriority() {
    return priority;
  }



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


  public Order links(List<OrderLinks> links) {
    
    this.links = links;
    return this;
  }

  public Order addLinksItem(OrderLinks linksItem) {
    if (this.links == null) {
      this.links = new ArrayList<OrderLinks>();
    }
    this.links.add(linksItem);
    return this;
  }

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

  public List<OrderLinks> getLinks() {
    return links;
  }



  public void setLinks(List<OrderLinks> links) {
    this.links = links;
  }


  public Order 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;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Order order = (Order) o;
    return Objects.equals(this.category, order.category) &&
        Objects.equals(this.code, order.code) &&
        Objects.equals(this.description, order.description) &&
        Objects.equals(this.status, order.status) &&
        Objects.equals(this.requestedProcessingStartDate, order.requestedProcessingStartDate) &&
        Objects.equals(this.orderItems, order.orderItems) &&
        Objects.equals(this.billingCycle, order.billingCycle) &&
        Objects.equals(this.paymentMethod, order.paymentMethod) &&
        Objects.equals(this.deliveryInstructions, order.deliveryInstructions) &&
        Objects.equals(this.orderDate, order.orderDate) &&
        Objects.equals(this.expectedCompletionDate, order.expectedCompletionDate) &&
        Objects.equals(this.requestedCompletionDate, order.requestedCompletionDate) &&
        Objects.equals(this.statusMessage, order.statusMessage) &&
        Objects.equals(this.priority, order.priority) &&
        Objects.equals(this.links, order.links) &&
        Objects.equals(this.id, order.id);
  }

  @Override
  public int hashCode() {
    return Objects.hash(category, code, description, status, requestedProcessingStartDate, orderItems, billingCycle, paymentMethod, deliveryInstructions, orderDate, expectedCompletionDate, requestedCompletionDate, statusMessage, priority, links, id);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Order {\n");
    sb.append("    category: ").append(toIndentedString(category)).append("\n");
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    requestedProcessingStartDate: ").append(toIndentedString(requestedProcessingStartDate)).append("\n");
    sb.append("    orderItems: ").append(toIndentedString(orderItems)).append("\n");
    sb.append("    billingCycle: ").append(toIndentedString(billingCycle)).append("\n");
    sb.append("    paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n");
    sb.append("    deliveryInstructions: ").append(toIndentedString(deliveryInstructions)).append("\n");
    sb.append("    orderDate: ").append(toIndentedString(orderDate)).append("\n");
    sb.append("    expectedCompletionDate: ").append(toIndentedString(expectedCompletionDate)).append("\n");
    sb.append("    requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)).append("\n");
    sb.append("    statusMessage: ").append(toIndentedString(statusMessage)).append("\n");
    sb.append("    priority: ").append(toIndentedString(priority)).append("\n");
    sb.append("    links: ").append(toIndentedString(links)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).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    ");
  }

}

