Delen via


CosmosPermissionProperties Class

  • java.lang.Object
    • com.azure.cosmos.models.CosmosPermissionProperties

public final class CosmosPermissionProperties

The type Cosmos permission properties.

Constructor Summary

Constructor Description
CosmosPermissionProperties()

Initialize a permission object.

Method Summary

Modifier and Type Method and Description
String getContainerName()

Gets the name of the Cosmos container as the parent resource which is associated with this permission object.

String getETag()

Get the entity tag associated with the resource.

String getId()

Gets the name of the resource.

PermissionMode getPermissionMode()

Gets the permission mode.

ContainerChildResourceType getResourceKind()

Gets the kind of resource that has a Cosmos container as the parent resource which is associated with this permission object.

String getResourceName()

Gets the name of resource that has a Cosmos container as the parent resource which is associated with this permission object.

PartitionKey getResourcePartitionKey()

Gets the resource partition key associated with this permission object.

Instant getTimestamp()

Get the last modified timestamp associated with the resource.

String getToken()

Gets the access token granting the defined permission.

CosmosPermissionProperties setContainerName(String containerName)

Sets the name of the Cosmos container as the parent resource which is associated with this permission object.

CosmosPermissionProperties setId(String id)

Sets the name of the permission resource.

CosmosPermissionProperties setPermissionMode(PermissionMode permissionMode)

Sets the permission mode.

CosmosPermissionProperties setResourcePartitionKey(PartitionKey partitionKey)

Sets the resource partition key associated with this permission object.

CosmosPermissionProperties setResourcePath(ContainerChildResourceType resourceKind, String resourceName)

Sets the resource path represented by the name and kind of a resource that has a Cosmos container as the parent resource which is associated with this permission object.

Methods inherited from java.lang.Object

Constructor Details

CosmosPermissionProperties

public CosmosPermissionProperties()

Initialize a permission object.

Method Details

getContainerName

public String getContainerName()

Gets the name of the Cosmos container as the parent resource which is associated with this permission object.

Returns:

the name of the Cosmos container representing the parent resource.

getETag

public String getETag()

Get the entity tag associated with the resource. This is only relevant when getting response from the server.

Returns:

the Cosmos ETAG property or null if the permission object was not yet registered with the Cosmos service (when executing a create, upsert or replace operation) or if it was changed through one of the setter methods.

getId

public String getId()

Gets the name of the resource.

Returns:

the name of the resource.

getPermissionMode

public PermissionMode getPermissionMode()

Gets the permission mode.

Returns:

the permission mode.

getResourceKind

public ContainerChildResourceType getResourceKind()

Gets the kind of resource that has a Cosmos container as the parent resource which is associated with this permission object.

Returns:

the kind of resource that has a Cosmos container as parent resource.

getResourceName

public String getResourceName()

Gets the name of resource that has a Cosmos container as the parent resource which is associated with this permission object.

Returns:

the name of resource that has a Cosmos container as the parent resource.

getResourcePartitionKey

public PartitionKey getResourcePartitionKey()

Gets the resource partition key associated with this permission object.

Returns:

the partition key.

getTimestamp

public Instant getTimestamp()

Get the last modified timestamp associated with the resource. This is only relevant when getting response from the server.

Returns:

the timestamp or null if the permission object was not yet registered with the Cosmos service (when executing a create, upsert or replace operation) or if it was changed through one of the setter methods.

getToken

public String getToken()

Gets the access token granting the defined permission.

Returns:

the access token or null if the permission object was not yet registered with the Cosmos service (when executing a create, upsert or replace operation) or if it was changed through one of the setter methods.

setContainerName

public CosmosPermissionProperties setContainerName(String containerName)

Sets the name of the Cosmos container as the parent resource which is associated with this permission object.

Parameters:

containerName - the name of the Cosmos container representing the parent resource.

Returns:

the current CosmosPermissionProperties object.

setId

public CosmosPermissionProperties setId(String id)

Sets the name of the permission resource.

Parameters:

id - the name of the resource.

Returns:

the current CosmosPermissionProperties object

setPermissionMode

public CosmosPermissionProperties setPermissionMode(PermissionMode permissionMode)

Sets the permission mode.

Parameters:

permissionMode - the permission mode.

Returns:

the current CosmosPermissionProperties object

setResourcePartitionKey

public CosmosPermissionProperties setResourcePartitionKey(PartitionKey partitionKey)

Sets the resource partition key associated with this permission object.

Parameters:

partitionKey - the partition key.

Returns:

the current CosmosPermissionProperties object.

setResourcePath

public CosmosPermissionProperties setResourcePath(ContainerChildResourceType resourceKind, String resourceName)

Sets the resource path represented by the name and kind of a resource that has a Cosmos container as the parent resource which is associated with this permission object.

Parameters:

resourceKind - the kind of resource that has a Cosmos container as parent resource.
resourceName - the name of resource that has a Cosmos container as the parent resource.

Returns:

the current CosmosPermissionProperties object.

Applies to