/*
 * Cloudera Manager API
 * <h1>Cloudera Manager API v57</h1>       <p>Introduced in Cloudera Manager 7.13.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>
 *
 * OpenAPI spec version: 7.13.1
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package com.cloudera.api.swagger.model;

import java.util.Objects;
import java.util.Arrays;
import com.cloudera.api.swagger.model.ApiAuthRoleRef;
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.v3.oas.annotations.media.Schema;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
 * This is the model for user information in the API, v18 and beyond. &lt;p&gt; Note that any method that returns user information will not contain any password information. The password property is only used when creating or updating users.
 */
@Schema(description = "This is the model for user information in the API, v18 and beyond. <p> Note that any method that returns user information will not contain any password information. The password property is only used when creating or updating users.")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

public class ApiUser2 {
  @SerializedName("name")
  private String name = null;

  @SerializedName("password")
  private String password = null;

  @SerializedName("authRoles")
  private List<ApiAuthRoleRef> authRoles = null;

  @SerializedName("pwHash")
  private String pwHash = null;

  @SerializedName("pwSalt")
  private java.math.BigDecimal pwSalt = null;

  @SerializedName("pwLogin")
  private Boolean pwLogin = null;

  public ApiUser2 name(String name) {
    this.name = name;
    return this;
  }

   /**
   * The username, which is unique within a Cloudera Manager installation.
   * @return name
  **/
  @Schema(description = "The username, which is unique within a Cloudera Manager installation.")
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

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

   /**
   * Returns the user password. &lt;p&gt; Passwords are not returned when querying user information, so this property will always be empty when reading information from a server.
   * @return password
  **/
  @Schema(description = "Returns the user password. <p> Passwords are not returned when querying user information, so this property will always be empty when reading information from a server.")
  public String getPassword() {
    return password;
  }

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

  public ApiUser2 authRoles(List<ApiAuthRoleRef> authRoles) {
    this.authRoles = authRoles;
    return this;
  }

  public ApiUser2 addAuthRolesItem(ApiAuthRoleRef authRolesItem) {
    if (this.authRoles == null) {
      this.authRoles = new ArrayList<>();
    }
    this.authRoles.add(authRolesItem);
    return this;
  }

   /**
   * A list of ApiAuthRole that this user possesses.
   * @return authRoles
  **/
  @Schema(description = "A list of ApiAuthRole that this user possesses.")
  public List<ApiAuthRoleRef> getAuthRoles() {
    return authRoles;
  }

  public void setAuthRoles(List<ApiAuthRoleRef> authRoles) {
    this.authRoles = authRoles;
  }

  public ApiUser2 pwHash(String pwHash) {
    this.pwHash = pwHash;
    return this;
  }

   /**
   * NOTE: Optional. Only available in the \&quot;export\&quot; view.
   * @return pwHash
  **/
  @Schema(description = "NOTE: Optional. Only available in the \"export\" view.")
  public String getPwHash() {
    return pwHash;
  }

  public void setPwHash(String pwHash) {
    this.pwHash = pwHash;
  }

  public ApiUser2 pwSalt(java.math.BigDecimal pwSalt) {
    this.pwSalt = pwSalt;
    return this;
  }

   /**
   * NOTE: Optional. Only available in the \&quot;export\&quot; view.
   * @return pwSalt
  **/
  @Schema(description = "NOTE: Optional. Only available in the \"export\" view.")
  public java.math.BigDecimal getPwSalt() {
    return pwSalt;
  }

  public void setPwSalt(java.math.BigDecimal pwSalt) {
    this.pwSalt = pwSalt;
  }

  public ApiUser2 pwLogin(Boolean pwLogin) {
    this.pwLogin = pwLogin;
    return this;
  }

   /**
   * NOTE: Optional. Only available in the \&quot;export\&quot; view.
   * @return pwLogin
  **/
  @Schema(description = "NOTE: Optional. Only available in the \"export\" view.")
  public Boolean isPwLogin() {
    return pwLogin;
  }

  public void setPwLogin(Boolean pwLogin) {
    this.pwLogin = pwLogin;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiUser2 apiUser2 = (ApiUser2) o;
    return Objects.equals(this.name, apiUser2.name) &&
        Objects.equals(this.password, apiUser2.password) &&
        Objects.equals(this.authRoles, apiUser2.authRoles) &&
        Objects.equals(this.pwHash, apiUser2.pwHash) &&
        Objects.equals(this.pwSalt, apiUser2.pwSalt) &&
        Objects.equals(this.pwLogin, apiUser2.pwLogin);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, password, authRoles, pwHash, pwSalt, pwLogin);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiUser2 {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    password: ").append(toIndentedString(password)).append("\n");
    sb.append("    authRoles: ").append(toIndentedString(authRoles)).append("\n");
    sb.append("    pwHash: ").append(toIndentedString(pwHash)).append("\n");
    sb.append("    pwSalt: ").append(toIndentedString(pwSalt)).append("\n");
    sb.append("    pwLogin: ").append(toIndentedString(pwLogin)).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    ");
  }

}
