Class PrivilegeResource
java.lang.Object
com.azure.resourcemanager.cosmos.models.PrivilegeResource
- All Implemented Interfaces:
com.azure.json.JsonSerializable<PrivilegeResource>
public final class PrivilegeResource
extends Object
implements com.azure.json.JsonSerializable<PrivilegeResource>
An Azure Cosmos DB Mongo DB Resource.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the collection property: The collection name the role is applied.db()Get the db property: The database name the role is applied.static PrivilegeResourcefromJson(com.azure.json.JsonReader jsonReader) Reads an instance of PrivilegeResource from the JsonReader.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withCollection(String collection) Set the collection property: The collection name the role is applied.Set the db property: The database name the role is applied.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
PrivilegeResource
public PrivilegeResource()Creates an instance of PrivilegeResource 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 PrivilegeResource object itself.
-
collection
Get the collection property: The collection name the role is applied.- Returns:
- the collection value.
-
withCollection
Set the collection property: The collection name the role is applied.- Parameters:
collection- the collection value to set.- Returns:
- the PrivilegeResource object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<PrivilegeResource>- Throws:
IOException
-
fromJson
Reads an instance of PrivilegeResource from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of PrivilegeResource 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 PrivilegeResource.
-