/*
 * 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;
import org.openapitools.client.model.SecuredEntityDto;
import org.threeten.bp.OffsetDateTime;

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

  public static final String SERIALIZED_NAME_PASSWORD = "password";
  @SerializedName(SERIALIZED_NAME_PASSWORD)
  private String password;

  public static final String SERIALIZED_NAME_EMAIL = "email";
  @SerializedName(SERIALIZED_NAME_EMAIL)
  private String email;

  public static final String SERIALIZED_NAME_FIRST_NAME = "firstName";
  @SerializedName(SERIALIZED_NAME_FIRST_NAME)
  private String firstName;

  public static final String SERIALIZED_NAME_LAST_NAME = "lastName";
  @SerializedName(SERIALIZED_NAME_LAST_NAME)
  private String lastName;

  public static final String SERIALIZED_NAME_ROLES = "roles";
  @SerializedName(SERIALIZED_NAME_ROLES)
  private List<String> roles = null;

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

  public static final String SERIALIZED_NAME_SECURED_ENTITIES = "securedEntities";
  @SerializedName(SERIALIZED_NAME_SECURED_ENTITIES)
  private List<SecuredEntityDto> securedEntities = null;

  public static final String SERIALIZED_NAME_ROLE = "role";
  @SerializedName(SERIALIZED_NAME_ROLE)
  private String role;

  public static final String SERIALIZED_NAME_USER_LEVEL = "userLevel";
  @SerializedName(SERIALIZED_NAME_USER_LEVEL)
  private String userLevel;

  public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
  @SerializedName(SERIALIZED_NAME_CREATED_AT)
  private OffsetDateTime createdAt;

  public static final String SERIALIZED_NAME_LAST_LOGIN_DATE = "lastLoginDate";
  @SerializedName(SERIALIZED_NAME_LAST_LOGIN_DATE)
  private OffsetDateTime lastLoginDate;

  public static final String SERIALIZED_NAME_PERMISSIONS = "permissions";
  @SerializedName(SERIALIZED_NAME_PERMISSIONS)
  private List<String> permissions = null;


  public UserDto username(String username) {
    
    this.username = username;
    return this;
  }

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

  public String getUsername() {
    return username;
  }



  public void setUsername(String username) {
    this.username = username;
  }


  public UserDto password(String password) {
    
    this.password = password;
    return this;
  }

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

  public String getPassword() {
    return password;
  }



  public void setPassword(String password) {
    this.password = password;
  }


  public UserDto email(String email) {
    
    this.email = email;
    return this;
  }

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

  public String getEmail() {
    return email;
  }



  public void setEmail(String email) {
    this.email = email;
  }


  public UserDto firstName(String firstName) {
    
    this.firstName = firstName;
    return this;
  }

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

  public String getFirstName() {
    return firstName;
  }



  public void setFirstName(String firstName) {
    this.firstName = firstName;
  }


  public UserDto lastName(String lastName) {
    
    this.lastName = lastName;
    return this;
  }

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

  public String getLastName() {
    return lastName;
  }



  public void setLastName(String lastName) {
    this.lastName = lastName;
  }


  public UserDto roles(List<String> roles) {
    
    this.roles = roles;
    return this;
  }

  public UserDto addRolesItem(String rolesItem) {
    if (this.roles == null) {
      this.roles = new ArrayList<String>();
    }
    this.roles.add(rolesItem);
    return this;
  }

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

  public List<String> getRoles() {
    return roles;
  }



  public void setRoles(List<String> roles) {
    this.roles = roles;
  }


  public UserDto externalRoles(List<RoleDto> externalRoles) {
    
    this.externalRoles = externalRoles;
    return this;
  }

  public UserDto addExternalRolesItem(RoleDto externalRolesItem) {
    if (this.externalRoles == null) {
      this.externalRoles = new ArrayList<RoleDto>();
    }
    this.externalRoles.add(externalRolesItem);
    return this;
  }

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

  public List<RoleDto> getExternalRoles() {
    return externalRoles;
  }



  public void setExternalRoles(List<RoleDto> externalRoles) {
    this.externalRoles = externalRoles;
  }


  public UserDto securedEntities(List<SecuredEntityDto> securedEntities) {
    
    this.securedEntities = securedEntities;
    return this;
  }

  public UserDto addSecuredEntitiesItem(SecuredEntityDto securedEntitiesItem) {
    if (this.securedEntities == null) {
      this.securedEntities = new ArrayList<SecuredEntityDto>();
    }
    this.securedEntities.add(securedEntitiesItem);
    return this;
  }

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

  public List<SecuredEntityDto> getSecuredEntities() {
    return securedEntities;
  }



  public void setSecuredEntities(List<SecuredEntityDto> securedEntities) {
    this.securedEntities = securedEntities;
  }


  public UserDto role(String role) {
    
    this.role = role;
    return this;
  }

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

  public String getRole() {
    return role;
  }



  public void setRole(String role) {
    this.role = role;
  }


  public UserDto userLevel(String userLevel) {
    
    this.userLevel = userLevel;
    return this;
  }

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

  public String getUserLevel() {
    return userLevel;
  }



  public void setUserLevel(String userLevel) {
    this.userLevel = userLevel;
  }


  public UserDto createdAt(OffsetDateTime createdAt) {
    
    this.createdAt = createdAt;
    return this;
  }

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

  public OffsetDateTime getCreatedAt() {
    return createdAt;
  }



  public void setCreatedAt(OffsetDateTime createdAt) {
    this.createdAt = createdAt;
  }


  public UserDto lastLoginDate(OffsetDateTime lastLoginDate) {
    
    this.lastLoginDate = lastLoginDate;
    return this;
  }

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

  public OffsetDateTime getLastLoginDate() {
    return lastLoginDate;
  }



  public void setLastLoginDate(OffsetDateTime lastLoginDate) {
    this.lastLoginDate = lastLoginDate;
  }


  public UserDto permissions(List<String> permissions) {
    
    this.permissions = permissions;
    return this;
  }

  public UserDto addPermissionsItem(String permissionsItem) {
    if (this.permissions == null) {
      this.permissions = new ArrayList<String>();
    }
    this.permissions.add(permissionsItem);
    return this;
  }

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

  public List<String> getPermissions() {
    return permissions;
  }



  public void setPermissions(List<String> permissions) {
    this.permissions = permissions;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    UserDto userDto = (UserDto) o;
    return Objects.equals(this.username, userDto.username) &&
        Objects.equals(this.password, userDto.password) &&
        Objects.equals(this.email, userDto.email) &&
        Objects.equals(this.firstName, userDto.firstName) &&
        Objects.equals(this.lastName, userDto.lastName) &&
        Objects.equals(this.roles, userDto.roles) &&
        Objects.equals(this.externalRoles, userDto.externalRoles) &&
        Objects.equals(this.securedEntities, userDto.securedEntities) &&
        Objects.equals(this.role, userDto.role) &&
        Objects.equals(this.userLevel, userDto.userLevel) &&
        Objects.equals(this.createdAt, userDto.createdAt) &&
        Objects.equals(this.lastLoginDate, userDto.lastLoginDate) &&
        Objects.equals(this.permissions, userDto.permissions);
  }

  @Override
  public int hashCode() {
    return Objects.hash(username, password, email, firstName, lastName, roles, externalRoles, securedEntities, role, userLevel, createdAt, lastLoginDate, permissions);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class UserDto {\n");
    sb.append("    username: ").append(toIndentedString(username)).append("\n");
    sb.append("    password: ").append(toIndentedString(password)).append("\n");
    sb.append("    email: ").append(toIndentedString(email)).append("\n");
    sb.append("    firstName: ").append(toIndentedString(firstName)).append("\n");
    sb.append("    lastName: ").append(toIndentedString(lastName)).append("\n");
    sb.append("    roles: ").append(toIndentedString(roles)).append("\n");
    sb.append("    externalRoles: ").append(toIndentedString(externalRoles)).append("\n");
    sb.append("    securedEntities: ").append(toIndentedString(securedEntities)).append("\n");
    sb.append("    role: ").append(toIndentedString(role)).append("\n");
    sb.append("    userLevel: ").append(toIndentedString(userLevel)).append("\n");
    sb.append("    createdAt: ").append(toIndentedString(createdAt)).append("\n");
    sb.append("    lastLoginDate: ").append(toIndentedString(lastLoginDate)).append("\n");
    sb.append("    permissions: ").append(toIndentedString(permissions)).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    ");
  }

}

