Class Role
java.lang.Object
com.azure.resourcemanager.cosmos.models.Role
- All Implemented Interfaces:
com.azure.json.JsonSerializable<Role>
The set of roles permitted through this Role Definition.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondb()
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.role()
Get the role property: The role name.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) void
validate()
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
Get the db property: The database name the role is applied.- Returns:
- the db value.
-
withDb
Set the db property: The database name the role is applied.- Parameters:
db
- the db value to set.- Returns:
- the Role object itself.
-
role
Get the role property: The role name.- Returns:
- the role value.
-
withRole
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
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<Role>
- Throws:
IOException
-
fromJson
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.
-