ResourceResponse<TResource> ResourceResponse<TResource> ResourceResponse<TResource> Class

Definition

Represents the template class used by methods returning single objects in the Azure Cosmos DB service.

public class ResourceResponse<TResource> : Microsoft.Azure.Documents.Client.ResourceResponseBase, Microsoft.Azure.Documents.Client.IResourceResponse<TResource> where TResource : Resourcenew()
type ResourceResponse<'Resource (requires 'Resource :> Resource and 'Resource : (new : unit -> 'Resource))> = class
    inherit ResourceResponseBase
    interface IResourceResponse<'Resource (requires 'Resource :> Resource and 'Resource : (new : unit -> 'Resource))>
    interface IResourceResponseBase
Public Class ResourceResponse(Of TResource)
Inherits ResourceResponseBase
Implements IResourceResponse(Of TResource)

Type Parameters

TResource

the resource type.

Inheritance
ResourceResponse<TResource>ResourceResponse<TResource>ResourceResponse<TResource>
Implements

Examples

The following example extracts the request units consumed, activity ID and StatusCode from a CreateDocumentAsync call.


ResourceResponse<Document> response = await client.CreateDocumentAsync(collectionLink, document);
Console.WriteLine(response.RequestCharge);
Console.WriteLine(response.ActivityId); 
Console.WriteLine(response.StatusCode); // HttpStatusCode.Created or 201

Remarks

All responses from creates, reads, updates and deletes of Azure Cosmos DB resources return the response wrapped in a

ResourceResponse object. This contains the metadata from the response headers from the Azure Cosmos DB call including

the request units (RequestCharge), activity ID and quotas/usage of resources.

Constructors

ResourceResponse<TResource>() ResourceResponse<TResource>() ResourceResponse<TResource>()

Constructor exposed for mocking purposes for the Azure Cosmos DB service.

ResourceResponse<TResource>(TResource) ResourceResponse<TResource>(TResource) ResourceResponse<TResource>(TResource)

Constructor exposed for mocking purposes for the Azure Cosmos DB service.

Properties

ActivityId ActivityId ActivityId

Gets the activity ID for the request from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
CollectionQuota CollectionQuota CollectionQuota

Gets the maximum quota for collection resources within an account from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
CollectionSizeQuota CollectionSizeQuota CollectionSizeQuota

Gets the maximum size of a collection in kilobytes from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
CollectionSizeUsage CollectionSizeUsage CollectionSizeUsage

Gets the current size of a collection in kilobytes from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
CollectionUsage CollectionUsage CollectionUsage

Gets the current number of collection resources within the account from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
ContentLocation ContentLocation ContentLocation

The content parent location, for example, dbs/foo/colls/bar in the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
CurrentResourceQuotaUsage CurrentResourceQuotaUsage CurrentResourceQuotaUsage

Gets the current size of this entity from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
DatabaseQuota DatabaseQuota DatabaseQuota

Gets the maximum quota for database resources within the account from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
DatabaseUsage DatabaseUsage DatabaseUsage

Gets the current number of database resources within the account from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
DocumentQuota DocumentQuota DocumentQuota

Gets the maximum size of a documents within a collection in kilobytes from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
DocumentUsage DocumentUsage DocumentUsage

Gets the current size of documents within a collection in kilobytes from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
IndexTransformationProgress IndexTransformationProgress IndexTransformationProgress

Gets the progress of an index transformation, if one is underway from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
IsRUPerMinuteUsed IsRUPerMinuteUsed IsRUPerMinuteUsed

Gets the flag associated with the response from the Azure Cosmos DB service whether this request is served from Request Units(RUs)/minute capacity or not.

(Inherited from ResourceResponseBase)
LazyIndexingProgress LazyIndexingProgress LazyIndexingProgress

Gets the progress of lazy indexing from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
MaxResourceQuota MaxResourceQuota MaxResourceQuota

Gets the maximum size limit for this entity from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
PermissionQuota PermissionQuota PermissionQuota

Gets the maximum quota for permission resources within an account from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
PermissionUsage PermissionUsage PermissionUsage

Gets the current number of permission resources within the account from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
RequestCharge RequestCharge RequestCharge

Gets the request charge for this request from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
RequestDiagnosticsString RequestDiagnosticsString RequestDiagnosticsString

Gets the diagnostics information for the current request to Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
RequestLatency RequestLatency RequestLatency

Gets the end-to-end request latency for the current request to Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
Resource Resource Resource

Gets the resource returned in the response from the Azure Cosmos DB service.

ResponseHeaders ResponseHeaders ResponseHeaders

Gets the response headers from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
ResponseStream ResponseStream ResponseStream

Gets the underlying stream of the response from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
SessionToken SessionToken SessionToken

Gets the session token for use in sesssion consistency reads from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
StatusCode StatusCode StatusCode

Gets the HTTP status code associated with the response from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
StoredProceduresQuota StoredProceduresQuota StoredProceduresQuota

Gets the maximum quota of stored procedures for a collection from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
StoredProceduresUsage StoredProceduresUsage StoredProceduresUsage

Gets the current number of stored procedures for a collection from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
TriggersQuota TriggersQuota TriggersQuota

Gets the maximum quota of triggers for a collection from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
TriggersUsage TriggersUsage TriggersUsage

Gets the current number of triggers for a collection from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
UserDefinedFunctionsQuota UserDefinedFunctionsQuota UserDefinedFunctionsQuota

Gets the maximum quota of user defined functions for a collection from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
UserDefinedFunctionsUsage UserDefinedFunctionsUsage UserDefinedFunctionsUsage

Gets the current number of user defined functions for a collection from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
UserQuota UserQuota UserQuota

Gets the maximum quota for user resources within an account from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
UserUsage UserUsage UserUsage

Gets the current number of user resources within the account from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)

Operators

Implicit(ResourceResponse<TResource> to TResource) Implicit(ResourceResponse<TResource> to TResource) Implicit(ResourceResponse<TResource> to TResource)

Returns the resource in the response implicitly from the Azure Cosmos DB service.

Applies to

See also