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

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

  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_UPDATED_CODE = "updatedCode";
  @SerializedName(SERIALIZED_NAME_UPDATED_CODE)
  private String updatedCode;

  public static final String SERIALIZED_NAME_DISABLED = "disabled";
  @SerializedName(SERIALIZED_NAME_DISABLED)
  private Boolean disabled;

  /**
   * Gets or Sets license
   */
  @JsonAdapter(LicenseEnum.Adapter.class)
  public enum LicenseEnum {
    APACHE("APACHE"),
    
    BSD3_N("BSD3_N"),
    
    BSD3_R("BSD3_R"),
    
    BSD2_S("BSD2_S"),
    
    FREE_BSD("FREE_BSD"),
    
    GPL("GPL"),
    
    AGPL("AGPL"),
    
    LGPL("LGPL"),
    
    MIT("MIT"),
    
    MOZ("MOZ"),
    
    CDDL("CDDL"),
    
    EPL("EPL"),
    
    OPEN("OPEN"),
    
    COM("COM");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_LICENSE = "license";
  @SerializedName(SERIALIZED_NAME_LICENSE)
  private LicenseEnum license;

  public static final String SERIALIZED_NAME_LOGO_PICTURE = "logoPicture";
  @SerializedName(SERIALIZED_NAME_LOGO_PICTURE)
  private String logoPicture;

  public static final String SERIALIZED_NAME_LOGO_PICTURE_FILE = "logoPictureFile";
  @SerializedName(SERIALIZED_NAME_LOGO_PICTURE_FILE)
  private List<byte[]> logoPictureFile = null;

  public static final String SERIALIZED_NAME_SCRIPT = "script";
  @SerializedName(SERIALIZED_NAME_SCRIPT)
  private ScriptInstanceDto script;

  public static final String SERIALIZED_NAME_MODULE_ITEMS = "moduleItems";
  @SerializedName(SERIALIZED_NAME_MODULE_ITEMS)
  private List<Object> moduleItems = null;

  public static final String SERIALIZED_NAME_PRODUCT_TEMPLATE = "productTemplate";
  @SerializedName(SERIALIZED_NAME_PRODUCT_TEMPLATE)
  private ProductTemplateDto productTemplate;

  public static final String SERIALIZED_NAME_CODE_ONLY = "codeOnly";
  @SerializedName(SERIALIZED_NAME_CODE_ONLY)
  private Boolean codeOnly;

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


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

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

  public String getUpdatedCode() {
    return updatedCode;
  }



  public void setUpdatedCode(String updatedCode) {
    this.updatedCode = updatedCode;
  }


  public BusinessProductModelDto disabled(Boolean disabled) {
    
    this.disabled = disabled;
    return this;
  }

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

  public Boolean getDisabled() {
    return disabled;
  }



  public void setDisabled(Boolean disabled) {
    this.disabled = disabled;
  }


  public BusinessProductModelDto license(LicenseEnum license) {
    
    this.license = license;
    return this;
  }

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

  public LicenseEnum getLicense() {
    return license;
  }



  public void setLicense(LicenseEnum license) {
    this.license = license;
  }


  public BusinessProductModelDto logoPicture(String logoPicture) {
    
    this.logoPicture = logoPicture;
    return this;
  }

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

  public String getLogoPicture() {
    return logoPicture;
  }



  public void setLogoPicture(String logoPicture) {
    this.logoPicture = logoPicture;
  }


  public BusinessProductModelDto logoPictureFile(List<byte[]> logoPictureFile) {
    
    this.logoPictureFile = logoPictureFile;
    return this;
  }

  public BusinessProductModelDto addLogoPictureFileItem(byte[] logoPictureFileItem) {
    if (this.logoPictureFile == null) {
      this.logoPictureFile = new ArrayList<byte[]>();
    }
    this.logoPictureFile.add(logoPictureFileItem);
    return this;
  }

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

  public List<byte[]> getLogoPictureFile() {
    return logoPictureFile;
  }



  public void setLogoPictureFile(List<byte[]> logoPictureFile) {
    this.logoPictureFile = logoPictureFile;
  }


  public BusinessProductModelDto script(ScriptInstanceDto script) {
    
    this.script = script;
    return this;
  }

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

  public ScriptInstanceDto getScript() {
    return script;
  }



  public void setScript(ScriptInstanceDto script) {
    this.script = script;
  }


  public BusinessProductModelDto moduleItems(List<Object> moduleItems) {
    
    this.moduleItems = moduleItems;
    return this;
  }

  public BusinessProductModelDto addModuleItemsItem(Object moduleItemsItem) {
    if (this.moduleItems == null) {
      this.moduleItems = new ArrayList<Object>();
    }
    this.moduleItems.add(moduleItemsItem);
    return this;
  }

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

  public List<Object> getModuleItems() {
    return moduleItems;
  }



  public void setModuleItems(List<Object> moduleItems) {
    this.moduleItems = moduleItems;
  }


  public BusinessProductModelDto productTemplate(ProductTemplateDto productTemplate) {
    
    this.productTemplate = productTemplate;
    return this;
  }

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

  public ProductTemplateDto getProductTemplate() {
    return productTemplate;
  }



  public void setProductTemplate(ProductTemplateDto productTemplate) {
    this.productTemplate = productTemplate;
  }


  public BusinessProductModelDto codeOnly(Boolean codeOnly) {
    
    this.codeOnly = codeOnly;
    return this;
  }

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

  public Boolean getCodeOnly() {
    return codeOnly;
  }



  public void setCodeOnly(Boolean codeOnly) {
    this.codeOnly = codeOnly;
  }


  public BusinessProductModelDto _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;
    }
    BusinessProductModelDto businessProductModelDto = (BusinessProductModelDto) o;
    return Objects.equals(this.id, businessProductModelDto.id) &&
        Objects.equals(this.code, businessProductModelDto.code) &&
        Objects.equals(this.description, businessProductModelDto.description) &&
        Objects.equals(this.updatedCode, businessProductModelDto.updatedCode) &&
        Objects.equals(this.disabled, businessProductModelDto.disabled) &&
        Objects.equals(this.license, businessProductModelDto.license) &&
        Objects.equals(this.logoPicture, businessProductModelDto.logoPicture) &&
        Objects.equals(this.logoPictureFile, businessProductModelDto.logoPictureFile) &&
        Objects.equals(this.script, businessProductModelDto.script) &&
        Objects.equals(this.moduleItems, businessProductModelDto.moduleItems) &&
        Objects.equals(this.productTemplate, businessProductModelDto.productTemplate) &&
        Objects.equals(this.codeOnly, businessProductModelDto.codeOnly) &&
        Objects.equals(this._transient, businessProductModelDto._transient);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, code, description, updatedCode, disabled, license, logoPicture, logoPictureFile, script, moduleItems, productTemplate, codeOnly, _transient);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class BusinessProductModelDto {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    updatedCode: ").append(toIndentedString(updatedCode)).append("\n");
    sb.append("    disabled: ").append(toIndentedString(disabled)).append("\n");
    sb.append("    license: ").append(toIndentedString(license)).append("\n");
    sb.append("    logoPicture: ").append(toIndentedString(logoPicture)).append("\n");
    sb.append("    logoPictureFile: ").append(toIndentedString(logoPictureFile)).append("\n");
    sb.append("    script: ").append(toIndentedString(script)).append("\n");
    sb.append("    moduleItems: ").append(toIndentedString(moduleItems)).append("\n");
    sb.append("    productTemplate: ").append(toIndentedString(productTemplate)).append("\n");
    sb.append("    codeOnly: ").append(toIndentedString(codeOnly)).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    ");
  }

}

