java.lang.Object
com.azure.resourcemanager.cosmos.models.Role
All Implemented Interfaces:
com.azure.json.JsonSerializable<Role>

public final class Role extends Object implements com.azure.json.JsonSerializable<Role>
The set of roles permitted through this Role Definition.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of Role class.
  • Method Summary

    Modifier and Type
    Method
    Description
    db()
    Get the db property: The database name the role is applied.
    static Role
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of Role from the JsonReader.
    Get the role property: The role name.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    Set the db property: The database name the role is applied.
    Set the role property: The role name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • Role

      public Role()
      Creates an instance of Role class.
  • Method Details

    • db

      public String db()
      Get the db property: The database name the role is applied.
      Returns:
      the db value.
    • withDb

      public Role withDb(String db)
      Set the db property: The database name the role is applied.
      Parameters:
      db - the db value to set.
      Returns:
      the Role object itself.
    • role

      public String role()
      Get the role property: The role name.
      Returns:
      the role value.
    • withRole

      public Role withRole(String role)
      Set the role property: The role name.
      Parameters:
      role - the role value to set.
      Returns:
      the Role object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<Role>
      Throws:
      IOException
    • fromJson

      public static Role fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of Role from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of Role if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the Role.