/*
 * 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.OrderLinks;
import org.openapitools.client.model.Resource;

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

  public static final String SERIALIZED_NAME_PRODUCT = "product";
  @SerializedName(SERIALIZED_NAME_PRODUCT)
  private Resource product;

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

  public static final String SERIALIZED_NAME_PRODUCT_PRICE = "productPrice";
  @SerializedName(SERIALIZED_NAME_PRODUCT_PRICE)
  private Double productPrice;

  public static final String SERIALIZED_NAME_QUANTITY = "quantity";
  @SerializedName(SERIALIZED_NAME_QUANTITY)
  private Long quantity;

  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 ProductInstance 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 ProductInstance product(Resource product) {
    
    this.product = product;
    return this;
  }

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

  public Resource getProduct() {
    return product;
  }



  public void setProduct(Resource product) {
    this.product = product;
  }


  public ProductInstance seller(Resource seller) {
    
    this.seller = seller;
    return this;
  }

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

  public Resource getSeller() {
    return seller;
  }



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


  public ProductInstance productPrice(Double productPrice) {
    
    this.productPrice = productPrice;
    return this;
  }

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

  public Double getProductPrice() {
    return productPrice;
  }



  public void setProductPrice(Double productPrice) {
    this.productPrice = productPrice;
  }


  public ProductInstance quantity(Long quantity) {
    
    this.quantity = quantity;
    return this;
  }

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

  public Long getQuantity() {
    return quantity;
  }



  public void setQuantity(Long quantity) {
    this.quantity = quantity;
  }


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

  public ProductInstance 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 ProductInstance 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;
    }
    ProductInstance productInstance = (ProductInstance) o;
    return Objects.equals(this.code, productInstance.code) &&
        Objects.equals(this.product, productInstance.product) &&
        Objects.equals(this.seller, productInstance.seller) &&
        Objects.equals(this.productPrice, productInstance.productPrice) &&
        Objects.equals(this.quantity, productInstance.quantity) &&
        Objects.equals(this.links, productInstance.links) &&
        Objects.equals(this.id, productInstance.id);
  }

  @Override
  public int hashCode() {
    return Objects.hash(code, product, seller, productPrice, quantity, links, id);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ProductInstance {\n");
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    product: ").append(toIndentedString(product)).append("\n");
    sb.append("    seller: ").append(toIndentedString(seller)).append("\n");
    sb.append("    productPrice: ").append(toIndentedString(productPrice)).append("\n");
    sb.append("    quantity: ").append(toIndentedString(quantity)).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    ");
  }

}

