/*
 * 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.RoleDto;

/**
 * ScriptInstanceDto
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2019-09-13T10:03:17.753Z[GMT]")
public class ScriptInstanceDto {
  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 type
   */
  @JsonAdapter(TypeEnum.Adapter.class)
  public enum TypeEnum {
    SCRIPTSOURCETYPEENUM_JAVA("scriptSourceTypeEnum.JAVA");

    private String value;

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

    public String getValue() {
      return value;
    }

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

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

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

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

  public static final String SERIALIZED_NAME_TYPE = "type";
  @SerializedName(SERIALIZED_NAME_TYPE)
  private TypeEnum type;

  public static final String SERIALIZED_NAME_REUSE = "reuse";
  @SerializedName(SERIALIZED_NAME_REUSE)
  private Boolean reuse;

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

  public static final String SERIALIZED_NAME_EXECUTION_ROLES = "executionRoles";
  @SerializedName(SERIALIZED_NAME_EXECUTION_ROLES)
  private List<RoleDto> executionRoles = null;

  public static final String SERIALIZED_NAME_SOURCING_ROLES = "sourcingRoles";
  @SerializedName(SERIALIZED_NAME_SOURCING_ROLES)
  private List<RoleDto> sourcingRoles = null;

  public static final String SERIALIZED_NAME_SCRIPT_INSTANCE_CATEGORY_CODE = "scriptInstanceCategoryCode";
  @SerializedName(SERIALIZED_NAME_SCRIPT_INSTANCE_CATEGORY_CODE)
  private String scriptInstanceCategoryCode;

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


  public ScriptInstanceDto 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 ScriptInstanceDto 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 ScriptInstanceDto 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 ScriptInstanceDto 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 ScriptInstanceDto 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 ScriptInstanceDto type(TypeEnum type) {
    
    this.type = type;
    return this;
  }

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

  public TypeEnum getType() {
    return type;
  }



  public void setType(TypeEnum type) {
    this.type = type;
  }


  public ScriptInstanceDto reuse(Boolean reuse) {
    
    this.reuse = reuse;
    return this;
  }

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

  public Boolean getReuse() {
    return reuse;
  }



  public void setReuse(Boolean reuse) {
    this.reuse = reuse;
  }


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

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

  public String getScript() {
    return script;
  }



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


  public ScriptInstanceDto executionRoles(List<RoleDto> executionRoles) {
    
    this.executionRoles = executionRoles;
    return this;
  }

  public ScriptInstanceDto addExecutionRolesItem(RoleDto executionRolesItem) {
    if (this.executionRoles == null) {
      this.executionRoles = new ArrayList<RoleDto>();
    }
    this.executionRoles.add(executionRolesItem);
    return this;
  }

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

  public List<RoleDto> getExecutionRoles() {
    return executionRoles;
  }



  public void setExecutionRoles(List<RoleDto> executionRoles) {
    this.executionRoles = executionRoles;
  }


  public ScriptInstanceDto sourcingRoles(List<RoleDto> sourcingRoles) {
    
    this.sourcingRoles = sourcingRoles;
    return this;
  }

  public ScriptInstanceDto addSourcingRolesItem(RoleDto sourcingRolesItem) {
    if (this.sourcingRoles == null) {
      this.sourcingRoles = new ArrayList<RoleDto>();
    }
    this.sourcingRoles.add(sourcingRolesItem);
    return this;
  }

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

  public List<RoleDto> getSourcingRoles() {
    return sourcingRoles;
  }



  public void setSourcingRoles(List<RoleDto> sourcingRoles) {
    this.sourcingRoles = sourcingRoles;
  }


  public ScriptInstanceDto scriptInstanceCategoryCode(String scriptInstanceCategoryCode) {
    
    this.scriptInstanceCategoryCode = scriptInstanceCategoryCode;
    return this;
  }

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

  public String getScriptInstanceCategoryCode() {
    return scriptInstanceCategoryCode;
  }



  public void setScriptInstanceCategoryCode(String scriptInstanceCategoryCode) {
    this.scriptInstanceCategoryCode = scriptInstanceCategoryCode;
  }


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


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ScriptInstanceDto scriptInstanceDto = (ScriptInstanceDto) o;
    return Objects.equals(this.id, scriptInstanceDto.id) &&
        Objects.equals(this.code, scriptInstanceDto.code) &&
        Objects.equals(this.description, scriptInstanceDto.description) &&
        Objects.equals(this.updatedCode, scriptInstanceDto.updatedCode) &&
        Objects.equals(this.disabled, scriptInstanceDto.disabled) &&
        Objects.equals(this.type, scriptInstanceDto.type) &&
        Objects.equals(this.reuse, scriptInstanceDto.reuse) &&
        Objects.equals(this.script, scriptInstanceDto.script) &&
        Objects.equals(this.executionRoles, scriptInstanceDto.executionRoles) &&
        Objects.equals(this.sourcingRoles, scriptInstanceDto.sourcingRoles) &&
        Objects.equals(this.scriptInstanceCategoryCode, scriptInstanceDto.scriptInstanceCategoryCode) &&
        Objects.equals(this.codeOnly, scriptInstanceDto.codeOnly);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, code, description, updatedCode, disabled, type, reuse, script, executionRoles, sourcingRoles, scriptInstanceCategoryCode, codeOnly);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ScriptInstanceDto {\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("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    reuse: ").append(toIndentedString(reuse)).append("\n");
    sb.append("    script: ").append(toIndentedString(script)).append("\n");
    sb.append("    executionRoles: ").append(toIndentedString(executionRoles)).append("\n");
    sb.append("    sourcingRoles: ").append(toIndentedString(sourcingRoles)).append("\n");
    sb.append("    scriptInstanceCategoryCode: ").append(toIndentedString(scriptInstanceCategoryCode)).append("\n");
    sb.append("    codeOnly: ").append(toIndentedString(codeOnly)).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    ");
  }

}

