/*
 * Cloudera Manager API
 * <h1>Cloudera Manager API v50</h1>       <p>Introduced in Cloudera Manager 7.8.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>
 *
 * OpenAPI spec version: 7.8.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 com.cloudera.api.swagger.model.ApiAuthRoleRef;
import com.cloudera.api.swagger.model.ApiClusterRef;
import com.cloudera.api.swagger.model.ApiExternalUserMappingRef;
import com.cloudera.api.swagger.model.ApiUser2Ref;
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;

/**
 * This is the model for user role scope in the API since v18. This is used to support granular permissions.
 */
@ApiModel(description = "This is the model for user role scope in the API since v18. This is used to support granular permissions.")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2022-11-17T16:38:34.097Z")
public class ApiAuthRole {
  @SerializedName("displayName")
  private String displayName = null;

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

  @SerializedName("clusters")
  private List<ApiClusterRef> clusters = null;

  @SerializedName("users")
  private List<ApiUser2Ref> users = null;

  @SerializedName("externalUserMappings")
  private List<ApiExternalUserMappingRef> externalUserMappings = null;

  @SerializedName("baseRole")
  private ApiAuthRoleRef baseRole = null;

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

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

  public ApiAuthRole displayName(String displayName) {
    this.displayName = displayName;
    return this;
  }

   /**
   * 
   * @return displayName
  **/
  @ApiModelProperty(value = "")
  public String getDisplayName() {
    return displayName;
  }

  public void setDisplayName(String displayName) {
    this.displayName = displayName;
  }

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

   /**
   * 
   * @return name
  **/
  @ApiModelProperty(value = "")
  public String getName() {
    return name;
  }

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

  public ApiAuthRole clusters(List<ApiClusterRef> clusters) {
    this.clusters = clusters;
    return this;
  }

  public ApiAuthRole addClustersItem(ApiClusterRef clustersItem) {
    if (this.clusters == null) {
      this.clusters = new ArrayList<ApiClusterRef>();
    }
    this.clusters.add(clustersItem);
    return this;
  }

   /**
   * 
   * @return clusters
  **/
  @ApiModelProperty(value = "")
  public List<ApiClusterRef> getClusters() {
    return clusters;
  }

  public void setClusters(List<ApiClusterRef> clusters) {
    this.clusters = clusters;
  }

  public ApiAuthRole users(List<ApiUser2Ref> users) {
    this.users = users;
    return this;
  }

  public ApiAuthRole addUsersItem(ApiUser2Ref usersItem) {
    if (this.users == null) {
      this.users = new ArrayList<ApiUser2Ref>();
    }
    this.users.add(usersItem);
    return this;
  }

   /**
   * 
   * @return users
  **/
  @ApiModelProperty(value = "")
  public List<ApiUser2Ref> getUsers() {
    return users;
  }

  public void setUsers(List<ApiUser2Ref> users) {
    this.users = users;
  }

  public ApiAuthRole externalUserMappings(List<ApiExternalUserMappingRef> externalUserMappings) {
    this.externalUserMappings = externalUserMappings;
    return this;
  }

  public ApiAuthRole addExternalUserMappingsItem(ApiExternalUserMappingRef externalUserMappingsItem) {
    if (this.externalUserMappings == null) {
      this.externalUserMappings = new ArrayList<ApiExternalUserMappingRef>();
    }
    this.externalUserMappings.add(externalUserMappingsItem);
    return this;
  }

   /**
   * 
   * @return externalUserMappings
  **/
  @ApiModelProperty(value = "")
  public List<ApiExternalUserMappingRef> getExternalUserMappings() {
    return externalUserMappings;
  }

  public void setExternalUserMappings(List<ApiExternalUserMappingRef> externalUserMappings) {
    this.externalUserMappings = externalUserMappings;
  }

  public ApiAuthRole baseRole(ApiAuthRoleRef baseRole) {
    this.baseRole = baseRole;
    return this;
  }

   /**
   * A role this user possesses. In Cloudera Enterprise Datahub Edition, possible values are: &lt;ul&gt; &lt;li&gt;&lt;b&gt;ROLE_ADMIN&lt;/b&gt;&lt;/li&gt; &lt;li&gt;&lt;b&gt;ROLE_USER&lt;/b&gt;&lt;/li&gt; &lt;li&gt;&lt;b&gt;ROLE_LIMITED&lt;/b&gt;: Added in Cloudera Manager 5.0&lt;/li&gt; &lt;li&gt;&lt;b&gt;ROLE_OPERATOR&lt;/b&gt;: Added in Cloudera Manager 5.1&lt;/li&gt; &lt;li&gt;&lt;b&gt;ROLE_CONFIGURATOR&lt;/b&gt;: Added in Cloudera Manager 5.1&lt;/li&gt; &lt;li&gt;&lt;b&gt;ROLE_CLUSTER_ADMIN&lt;/b&gt;: Added in Cloudera Manager 5.2&lt;/li&gt; &lt;li&gt;&lt;b&gt;ROLE_BDR_ADMIN&lt;/b&gt;: Added in Cloudera Manager 5.2&lt;/li&gt; &lt;li&gt;&lt;b&gt;ROLE_NAVIGATOR_ADMIN&lt;/b&gt;: Added in Cloudera Manager 5.2&lt;/li&gt; &lt;li&gt;&lt;b&gt;ROLE_USER_ADMIN&lt;/b&gt;: Added in Cloudera Manager 5.2&lt;/li&gt; &lt;li&gt;&lt;b&gt;ROLE_KEY_ADMIN&lt;/b&gt;: Added in Cloudera Manager 5.5&lt;/li&gt; &lt;/ul&gt; An empty role implies ROLE_USER. &lt;p&gt;
   * @return baseRole
  **/
  @ApiModelProperty(value = "A role this user possesses. In Cloudera Enterprise Datahub Edition, possible values are: <ul> <li><b>ROLE_ADMIN</b></li> <li><b>ROLE_USER</b></li> <li><b>ROLE_LIMITED</b>: Added in Cloudera Manager 5.0</li> <li><b>ROLE_OPERATOR</b>: Added in Cloudera Manager 5.1</li> <li><b>ROLE_CONFIGURATOR</b>: Added in Cloudera Manager 5.1</li> <li><b>ROLE_CLUSTER_ADMIN</b>: Added in Cloudera Manager 5.2</li> <li><b>ROLE_BDR_ADMIN</b>: Added in Cloudera Manager 5.2</li> <li><b>ROLE_NAVIGATOR_ADMIN</b>: Added in Cloudera Manager 5.2</li> <li><b>ROLE_USER_ADMIN</b>: Added in Cloudera Manager 5.2</li> <li><b>ROLE_KEY_ADMIN</b>: Added in Cloudera Manager 5.5</li> </ul> An empty role implies ROLE_USER. <p>")
  public ApiAuthRoleRef getBaseRole() {
    return baseRole;
  }

  public void setBaseRole(ApiAuthRoleRef baseRole) {
    this.baseRole = baseRole;
  }

  public ApiAuthRole uuid(String uuid) {
    this.uuid = uuid;
    return this;
  }

   /**
   * Readonly. The UUID of the authRole. &lt;p&gt;
   * @return uuid
  **/
  @ApiModelProperty(value = "Readonly. The UUID of the authRole. <p>")
  public String getUuid() {
    return uuid;
  }

  public void setUuid(String uuid) {
    this.uuid = uuid;
  }

  public ApiAuthRole isCustom(Boolean isCustom) {
    this.isCustom = isCustom;
    return this;
  }

   /**
   * 
   * @return isCustom
  **/
  @ApiModelProperty(value = "")
  public Boolean getIsCustom() {
    return isCustom;
  }

  public void setIsCustom(Boolean isCustom) {
    this.isCustom = isCustom;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiAuthRole apiAuthRole = (ApiAuthRole) o;
    return Objects.equals(this.displayName, apiAuthRole.displayName) &&
        Objects.equals(this.name, apiAuthRole.name) &&
        Objects.equals(this.clusters, apiAuthRole.clusters) &&
        Objects.equals(this.users, apiAuthRole.users) &&
        Objects.equals(this.externalUserMappings, apiAuthRole.externalUserMappings) &&
        Objects.equals(this.baseRole, apiAuthRole.baseRole) &&
        Objects.equals(this.uuid, apiAuthRole.uuid) &&
        Objects.equals(this.isCustom, apiAuthRole.isCustom);
  }

  @Override
  public int hashCode() {
    return Objects.hash(displayName, name, clusters, users, externalUserMappings, baseRole, uuid, isCustom);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiAuthRole {\n");
    
    sb.append("    displayName: ").append(toIndentedString(displayName)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    clusters: ").append(toIndentedString(clusters)).append("\n");
    sb.append("    users: ").append(toIndentedString(users)).append("\n");
    sb.append("    externalUserMappings: ").append(toIndentedString(externalUserMappings)).append("\n");
    sb.append("    baseRole: ").append(toIndentedString(baseRole)).append("\n");
    sb.append("    uuid: ").append(toIndentedString(uuid)).append("\n");
    sb.append("    isCustom: ").append(toIndentedString(isCustom)).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    ");
  }
  
}

