Class MongoDBCollectionResource
java.lang.Object
com.azure.resourcemanager.cosmos.models.MongoDBCollectionResource
- All Implemented Interfaces:
com.azure.json.JsonSerializable<MongoDBCollectionResource>
- Direct Known Subclasses:
MongoDBCollectionGetPropertiesResource
public class MongoDBCollectionResource
extends Object
implements com.azure.json.JsonSerializable<MongoDBCollectionResource>
Cosmos DB MongoDB collection resource object.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of MongoDBCollectionResource class. -
Method Summary
Modifier and TypeMethodDescriptionGet the analyticalStorageTtl property: Analytical TTL.Get the createMode property: Enum to indicate the mode of resource creation.static MongoDBCollectionResource
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of MongoDBCollectionResource from the JsonReader.id()
Get the id property: Name of the Cosmos DB MongoDB collection.indexes()
Get the indexes property: List of index keys.Get the restoreParameters property: Parameters to indicate the information about the restore.shardKey()
Get the shardKey property: A key-value pair of shard keys to be applied for the request.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) void
validate()
Validates the instance.withAnalyticalStorageTtl
(Integer analyticalStorageTtl) Set the analyticalStorageTtl property: Analytical TTL.withCreateMode
(CreateMode createMode) Set the createMode property: Enum to indicate the mode of resource creation.Set the id property: Name of the Cosmos DB MongoDB collection.withIndexes
(List<MongoIndex> indexes) Set the indexes property: List of index keys.withRestoreParameters
(ResourceRestoreParameters restoreParameters) Set the restoreParameters property: Parameters to indicate the information about the restore.withShardKey
(Map<String, String> shardKey) Set the shardKey property: A key-value pair of shard keys to be applied for the request.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
-
MongoDBCollectionResource
public MongoDBCollectionResource()Creates an instance of MongoDBCollectionResource class.
-
-
Method Details
-
id
Get the id property: Name of the Cosmos DB MongoDB collection.- Returns:
- the id value.
-
withId
Set the id property: Name of the Cosmos DB MongoDB collection.- Parameters:
id
- the id value to set.- Returns:
- the MongoDBCollectionResource object itself.
-
shardKey
Get the shardKey property: A key-value pair of shard keys to be applied for the request.- Returns:
- the shardKey value.
-
withShardKey
Set the shardKey property: A key-value pair of shard keys to be applied for the request.- Parameters:
shardKey
- the shardKey value to set.- Returns:
- the MongoDBCollectionResource object itself.
-
indexes
Get the indexes property: List of index keys.- Returns:
- the indexes value.
-
withIndexes
Set the indexes property: List of index keys.- Parameters:
indexes
- the indexes value to set.- Returns:
- the MongoDBCollectionResource object itself.
-
analyticalStorageTtl
Get the analyticalStorageTtl property: Analytical TTL.- Returns:
- the analyticalStorageTtl value.
-
withAnalyticalStorageTtl
Set the analyticalStorageTtl property: Analytical TTL.- Parameters:
analyticalStorageTtl
- the analyticalStorageTtl value to set.- Returns:
- the MongoDBCollectionResource object itself.
-
restoreParameters
Get the restoreParameters property: Parameters to indicate the information about the restore.- Returns:
- the restoreParameters value.
-
withRestoreParameters
Set the restoreParameters property: Parameters to indicate the information about the restore.- Parameters:
restoreParameters
- the restoreParameters value to set.- Returns:
- the MongoDBCollectionResource object itself.
-
createMode
Get the createMode property: Enum to indicate the mode of resource creation.- Returns:
- the createMode value.
-
withCreateMode
Set the createMode property: Enum to indicate the mode of resource creation.- Parameters:
createMode
- the createMode value to set.- Returns:
- the MongoDBCollectionResource 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<MongoDBCollectionResource>
- Throws:
IOException
-
fromJson
public static MongoDBCollectionResource fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of MongoDBCollectionResource from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of MongoDBCollectionResource if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException
- If the deserialized JSON object was missing any required properties.IOException
- If an error occurs while reading the MongoDBCollectionResource.
-