Bagikan melalui


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 : Resource, new()
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>
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>()

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

ResourceResponse<TResource>(TResource)

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

Properties

ActivityId

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

(Inherited from ResourceResponseBase)
CollectionQuota

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

(Inherited from ResourceResponseBase)
CollectionSizeQuota

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

(Inherited from ResourceResponseBase)
CollectionSizeUsage

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

(Inherited from ResourceResponseBase)
CollectionUsage

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

(Inherited from ResourceResponseBase)
ContentLocation

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

(Inherited from ResourceResponseBase)
CurrentResourceQuotaUsage

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

(Inherited from ResourceResponseBase)
DatabaseQuota

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

(Inherited from ResourceResponseBase)
DatabaseUsage

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

(Inherited from ResourceResponseBase)
DocumentQuota

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

(Inherited from ResourceResponseBase)
DocumentUsage

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

(Inherited from ResourceResponseBase)
IndexTransformationProgress

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

(Inherited from ResourceResponseBase)
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

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

(Inherited from ResourceResponseBase)
MaxResourceQuota

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

(Inherited from ResourceResponseBase)
PermissionQuota

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

(Inherited from ResourceResponseBase)
PermissionUsage

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

(Inherited from ResourceResponseBase)
RequestCharge

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

(Inherited from ResourceResponseBase)
RequestDiagnosticsString

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

(Inherited from ResourceResponseBase)
RequestLatency

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

(Inherited from ResourceResponseBase)
Resource

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

ResponseHeaders

Gets the response headers from the Azure Cosmos DB service.

(Inherited from ResourceResponseBase)
ResponseStream

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

(Inherited from ResourceResponseBase)
SessionToken

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

(Inherited from ResourceResponseBase)
StatusCode

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

(Inherited from ResourceResponseBase)
StoredProceduresQuota

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

(Inherited from ResourceResponseBase)
StoredProceduresUsage

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

(Inherited from ResourceResponseBase)
TriggersQuota

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

(Inherited from ResourceResponseBase)
TriggersUsage

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

(Inherited from ResourceResponseBase)
UserDefinedFunctionsQuota

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

(Inherited from ResourceResponseBase)
UserDefinedFunctionsUsage

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

(Inherited from ResourceResponseBase)
UserQuota

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

(Inherited from ResourceResponseBase)
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)

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

Applies to

See also