Table of Contents

Class StoredProcedureResponse<TValue>

Namespace
Microsoft.Azure.Documents.Client
Assembly
Microsoft.Azure.Documents.Client.dll

Represents the response returned from a database stored procedure in the Azure Cosmos DB service. Wraps the response body and headers.

public class StoredProcedureResponse<TValue> : IStoredProcedureResponse<TValue>

Type Parameters

TValue

The returned value type of the stored procedure.

Inheritance
StoredProcedureResponse<TValue>
Implements
Inherited Members
Extension Methods

Remarks

Stored procedures can return any string output via the getContext().getResponse().setBody() method. This response body could be a serialized JSON object, or any other type. Within the .NET SDK, you can deserialize the response into a corresponding TValue type.

Constructors

StoredProcedureResponse()

Constructor exposed for mocking purposes in Azure Cosmos DB service.

public StoredProcedureResponse()

Properties

ActivityId

Gets the Activity ID of the request from the Azure Cosmos DB service.

public string ActivityId { get; }

Property Value

string

The Activity ID of the request.

Remarks

Every request is traced with a globally unique ID. Include activity ID in tracing application failures and when contacting Azure Cosmos DB support

CurrentResourceQuotaUsage

Gets the delimited string containing the usage of each resource type within the collection from the Azure Cosmos DB service.

public string CurrentResourceQuotaUsage { get; }

Property Value

string

The delimited string containing the number of used units per resource type within the collection.

IsRUPerMinuteUsed

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

public bool IsRUPerMinuteUsed { get; }

Property Value

bool

True if this request is served from RUs/minute capacity. Otherwise, false.

MaxResourceQuota

Gets the delimited string containing the quota of each resource type within the collection from the Azure Cosmos DB service.

public string MaxResourceQuota { get; }

Property Value

string

The delimited string containing the number of used units per resource type within the collection.

RequestCharge

Gets the number of normalized Azure Cosmos DB request units (RUs) charged from Azure Cosmos DB service.

public double RequestCharge { get; }

Property Value

double

The number of normalized Azure Cosmos DB request units (RUs) charged.

Response

Gets the response of a stored procedure, serialized into the given type from the Azure Cosmos DB service.

public TValue Response { get; }

Property Value

TValue

The response of a stored procedure, serialized into the given type.

ResponseHeaders

Gets the headers associated with the response from the Azure Cosmos DB service.

public NameValueCollection ResponseHeaders { get; }

Property Value

NameValueCollection

Headers associated with the response.

Remarks

Provides access to all HTTP response headers returned from the Azure Cosmos DB API.

ScriptLog

Gets the output from stored procedure console.log() statements.

public string ScriptLog { get; }

Property Value

string

Output from console.log() statements in a stored procedure.

See Also

SessionToken

Gets the token for use with session consistency requests from the Azure Cosmos DB service.

public string SessionToken { get; }

Property Value

string

The token for use with session consistency requests.

StatusCode

Gets the request completion status code from the Azure Cosmos DB service.

public HttpStatusCode StatusCode { get; }

Property Value

HttpStatusCode

The request completion status code

Operators

implicit operator TValue(StoredProcedureResponse<TValue>)

Gets the resource implicitly from Azure Cosmos DB service.

public static implicit operator TValue(StoredProcedureResponse<TValue> source)

Parameters

source StoredProcedureResponse<TValue>

Stored procedure response.

Returns

TValue

The returned resource.