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 Details

    • PrivilegeResource

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

    • db

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

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

      public String collection()
      Get the collection property: The collection name the role is applied.
      Returns:
      the collection value.
    • withCollection

      public PrivilegeResource withCollection(String collection)
      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

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

      public static PrivilegeResource fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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.