public sealed class CallSettingsSettings to determine how an RPC operates. This type is immutable.
Namespace
Google.Api.Gax.GrpcAssembly
Google.Api.Gax.Grpc.dll
Constructors
CallSettings(CancellationToken?, Expiration, RetrySettings, Action, WriteOptions, ContextPropagationToken)
public CallSettings(CancellationToken? cancellationToken, Expiration expiration, RetrySettings retry, Action headerMutation, WriteOptions writeOptions, ContextPropagationToken propagationToken) Constructs an instance with the specified settings.
| Parameters | |
|---|---|
| Name | Description |
cancellationToken |
CancellationTokenCancellation token that can be used for cancelling the call. |
expiration |
ExpirationExpiration to use, or null for default expiration behavior. |
retry |
RetrySettingsRetry to use, or null for default retry behavior. |
headerMutation |
ActionMetadataAction to modify the headers to send at the beginning of the call. |
writeOptions |
WriteOptionsWriteOptions that will be used for the call. |
propagationToken |
ContextPropagationTokenContextPropagationToken for propagating settings from a parent call. |
CallSettings(CancellationToken?, Expiration, RetrySettings, Action, WriteOptions, ContextPropagationToken, Action, Action)
public CallSettings(CancellationToken? cancellationToken, Expiration expiration, RetrySettings retry, Action headerMutation, WriteOptions writeOptions, ContextPropagationToken propagationToken, Action responseMetadataHandler, Action trailingMetadataHandler) Constructs an instance with the specified settings.
| Parameters | |
|---|---|
| Name | Description |
cancellationToken |
CancellationTokenCancellation token that can be used for cancelling the call. |
expiration |
ExpirationExpiration to use, or null for default expiration behavior. |
retry |
RetrySettingsRetry to use, or null for default retry behavior. |
headerMutation |
ActionMetadataAction to modify the headers to send at the beginning of the call. |
writeOptions |
WriteOptionsWriteOptions that will be used for the call. |
propagationToken |
ContextPropagationTokenContextPropagationToken for propagating settings from a parent call. |
responseMetadataHandler |
ActionMetadataAction to invoke when response metadata is received. |
trailingMetadataHandler |
ActionMetadataAction to invoke when trailing metadata is received. |
Properties
CancellationToken
public CancellationToken? CancellationToken { get; }Cancellation token that can be used for cancelling the call.
| Property Value | |
|---|---|
| Type | Description |
CancellationToken |
|
Expiration
public Expiration Expiration { get; }The expiration for the call (either a timeout or a deadline), or null for the default expiration.
| Property Value | |
|---|---|
| Type | Description |
Expiration |
|
HeaderMutation
public Action HeaderMutation { get; } Delegate to mutate the metadata which will be sent at the start of the call, typically to add custom headers.
| Property Value | |
|---|---|
| Type | Description |
ActionMetadata |
|
PropagationToken
public ContextPropagationToken PropagationToken { get; }ContextPropagationToken for propagating settings from a parent call.
| Property Value | |
|---|---|
| Type | Description |
ContextPropagationToken |
|
ResponseMetadataHandler
public Action ResponseMetadataHandler { get; } Delegate to receive the metadata associated with a response.
| Property Value | |
|---|---|
| Type | Description |
ActionMetadata |
|
Retry
public RetrySettings Retry { get; }RetrySettings to use, or null for default retry behavior.
| Property Value | |
|---|---|
| Type | Description |
RetrySettings |
|
TrailingMetadataHandler
public Action TrailingMetadataHandler { get; } Delegate to receive the metadata sent after the response.
| Property Value | |
|---|---|
| Type | Description |
ActionMetadata |
|
WriteOptions
public WriteOptions WriteOptions { get; }WriteOptions that will be used for the call.
| Property Value | |
|---|---|
| Type | Description |
WriteOptions |
|
Methods
FromCancellationToken(CancellationToken)
public static CallSettings FromCancellationToken(CancellationToken cancellationToken)Creates a CallSettings for the specified cancellation token.
| Parameter | |
|---|---|
| Name | Description |
cancellationToken |
CancellationTokenThe cancellation token for the new settings. |
| Returns | |
|---|---|
| Type | Description |
CallSettings |
A new instance. |
FromExpiration(Expiration)
public static CallSettings FromExpiration(Expiration expiration)Creates a CallSettings for the specified call expiration, or returns null
if expiration is null.
| Parameter | |
|---|---|
| Name | Description |
expiration |
ExpirationThe call timing for the new settings. |
| Returns | |
|---|---|
| Type | Description |
CallSettings |
A new instance or null if |
FromFieldMask(string)
public static CallSettings FromFieldMask(string fieldMask)Creates a CallSettings that will include a field mask in the request, to limit which fields are returned in the response.
| Parameter | |
|---|---|
| Name | Description |
fieldMask |
stringThe field mask for the request. Must not be null. |
| Returns | |
|---|---|
| Type | Description |
CallSettings |
A new instance. |
The precise effect on the request is not guaranteed: it may be through a header or a side-channel, for example. Likewise the effect of combining multiple settings containing field masks is not specified.
FromGoogleRequestParamsHeader(string)
public static CallSettings FromGoogleRequestParamsHeader(string escapedHeaderValue)Creates a CallSettings which applies an x-goog-request-params header with the specified escaped header value.
| Parameter | |
|---|---|
| Name | Description |
escapedHeaderValue |
stringThe value of the x-goog-request-params header. Must be escaped. Must not be null or empty. |
| Returns | |
|---|---|
| Type | Description |
CallSettings |
A CallSettings which applies the appropriate header. |
This method is intended to be called from API-specific client libraries; it would be very unusual for it to be appropriate to call from application code.
FromGoogleRequestParamsHeader(string, string)
public static CallSettings FromGoogleRequestParamsHeader(string parameterName, string value)Creates a CallSettings which applies an x-goog-request-params header with the specified parameter name and value.
| Parameters | |
|---|---|
| Name | Description |
parameterName |
stringThe name of the parameter. Must not be null. |
value |
stringThe value of the parameter, which may be null. A null value is equivalent to providing an empty string. |
| Returns | |
|---|---|
| Type | Description |
CallSettings |
A CallSettings which applies the appropriate header with a single parameter. |
The value is URL-encoded; it is expected that parameterName is already URL-encoded.
This method is intended to be called from API-specific client libraries; it would be very unusual for it to be appropriate to call from application code.
FromHeader(string, string)
public static CallSettings FromHeader(string name, string value)Creates a CallSettings for the specified header name and value.
| Parameters | |
|---|---|
| Name | Description |
name |
stringThe name of the header to add. Must not be null. |
value |
stringThe value of the header to add. Must not be null. |
| Returns | |
|---|---|
| Type | Description |
CallSettings |
A new instance. |
FromHeaderMutation(Action)
public static CallSettings FromHeaderMutation(Action headerMutation) Creates a CallSettings for the specified header mutation, or returns null
if headerMutation is null.
| Parameter | |
|---|---|
| Name | Description |
headerMutation |
ActionMetadataAction to modify the headers to send at the beginning of the call. |
| Returns | |
|---|---|
| Type | Description |
CallSettings |
A new instance, or null if |
FromResponseMetadataHandler(Action)
public static CallSettings FromResponseMetadataHandler(Action responseMetadataHandler) Creates a CallSettings for the specified response metadata handler, or returns null
if responseMetadataHandler is null.
| Parameter | |
|---|---|
| Name | Description |
responseMetadataHandler |
ActionMetadataAction to receive response metadata when the call completes. |
| Returns | |
|---|---|
| Type | Description |
CallSettings |
A new instance, or null if |
FromRetry(RetrySettings)
public static CallSettings FromRetry(RetrySettings retry)Creates a CallSettings for the specified retry settings, or returns null
if retry is null.
| Parameter | |
|---|---|
| Name | Description |
retry |
RetrySettingsThe call timing for the new settings. |
| Returns | |
|---|---|
| Type | Description |
CallSettings |
A new instance or null if |
FromTrailingMetadataHandler(Action)
public static CallSettings FromTrailingMetadataHandler(Action trailingMetadataHandler) Creates a CallSettings for the specified trailing metadata handler, or returns null
if trailingMetadataHandler is null.
| Parameter | |
|---|---|
| Name | Description |
trailingMetadataHandler |
ActionMetadataAction to receive trailing metadata when the call completes. |
| Returns | |
|---|---|
| Type | Description |
CallSettings |
A new instance, or null if |