All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.rockset.client.model.CreateRoleRequest Maven / Gradle / Ivy

There is a newer version: 0.13.0
Show newest version
/*
 * REST API
 * Rockset's REST API allows for creating and managing all resources in Rockset. Each supported endpoint is documented below.  All requests must be authorized with a Rockset API key, which can be created in the [Rockset console](https://console.rockset.com). The API key must be provided as `ApiKey ` in the `Authorization` request header. For example: ``` Authorization: ApiKey aB35kDjg93J5nsf4GjwMeErAVd832F7ad4vhsW1S02kfZiab42sTsfW5Sxt25asT ```  All endpoints are only accessible via https.  Build something awesome!
 *
 * OpenAPI spec version: v1
 * 
 *
 * 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.rockset.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 com.rockset.client.model.Privilege;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * CreateRoleRequest
 */
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2023-08-08T22:21:01.705Z")
public class CreateRoleRequest {
  @SerializedName("description")
  private String description = null;

  @SerializedName("privileges")
  private List privileges = null;

  @SerializedName("role_name")
  private String roleName = null;

  public CreateRoleRequest description(String description) {
    this.description = description;
    return this;
  }

   /**
   * Description for the role.
   * @return description
  **/

@JsonProperty("description")
@ApiModelProperty(example = "Role with read and write privileges to all collections.", value = "Description for the role.")
  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public CreateRoleRequest privileges(List privileges) {
    this.privileges = privileges;
    return this;
  }

  public CreateRoleRequest addPrivilegesItem(Privilege privilegesItem) {
    if (this.privileges == null) {
      this.privileges = new ArrayList();
    }
    this.privileges.add(privilegesItem);
    return this;
  }

   /**
   * List of privileges that will be associated with the role.
   * @return privileges
  **/

@JsonProperty("privileges")
@ApiModelProperty(value = "List of privileges that will be associated with the role.")
  public List getPrivileges() {
    return privileges;
  }

  public void setPrivileges(List privileges) {
    this.privileges = privileges;
  }

  public CreateRoleRequest roleName(String roleName) {
    this.roleName = roleName;
    return this;
  }

   /**
   * Unique identifier for the role.
   * @return roleName
  **/

@JsonProperty("role_name")
@ApiModelProperty(example = "read_write", value = "Unique identifier for the role.")
  public String getRoleName() {
    return roleName;
  }

  public void setRoleName(String roleName) {
    this.roleName = roleName;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CreateRoleRequest createRoleRequest = (CreateRoleRequest) o;
    return Objects.equals(this.description, createRoleRequest.description) &&
        Objects.equals(this.privileges, createRoleRequest.privileges) &&
        Objects.equals(this.roleName, createRoleRequest.roleName);
  }

  @Override
  public int hashCode() {
    return Objects.hash(description, privileges, roleName);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CreateRoleRequest {\n");
    
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    privileges: ").append(toIndentedString(privileges)).append("\n");
    sb.append("    roleName: ").append(toIndentedString(roleName)).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    ");
  }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy