public sealed class CallSettings
Settings 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<Metadata>, WriteOptions, ContextPropagationToken)
public CallSettings(CancellationToken? cancellationToken, Expiration expiration, RetrySettings retry, Action<Metadata> headerMutation, WriteOptions writeOptions, ContextPropagationToken propagationToken)
Constructs an instance with the specified settings.
cancellationToken
expiration
retry
writeOptions
propagationToken
CallSettings(CancellationToken?, Expiration, RetrySettings, Action<Metadata>, WriteOptions, ContextPropagationToken, Action<Metadata>, Action<Metadata>)
public CallSettings(CancellationToken? cancellationToken, Expiration expiration, RetrySettings retry, Action<Metadata> headerMutation, WriteOptions writeOptions, ContextPropagationToken propagationToken, Action<Metadata> responseMetadataHandler, Action<Metadata> trailingMetadataHandler)
Constructs an instance with the specified settings.
cancellationToken
expiration
retry
writeOptions
propagationToken
Properties
CancellationToken
public CancellationToken? CancellationToken { get; }
Cancellation token that can be used for cancelling the call.
Expiration
public Expiration Expiration { get; }
The expiration for the call (either a timeout or a deadline), or null for the default expiration.
HeaderMutation
public Action<Metadata> HeaderMutation { get; }
Delegate to mutate the metadata which will be sent at the start of the call, typically to add custom headers.
PropagationToken
public ContextPropagationToken PropagationToken { get; }
ContextPropagationToken for propagating settings from a parent call.
ResponseMetadataHandler
public Action<Metadata> ResponseMetadataHandler { get; }
Delegate to receive the metadata associated with a response.
Retry
public RetrySettings Retry { get; }
RetrySettings to use, or null for default retry behavior.
TrailingMetadataHandler
public Action<Metadata> TrailingMetadataHandler { get; }
Delegate to receive the metadata sent after the response.
WriteOptions
public WriteOptions WriteOptions { get; }
WriteOptions that will be used for the call.
Methods
FromCancellationToken(CancellationToken)
public static CallSettings FromCancellationToken(CancellationToken cancellationToken)
Creates a CallSettings for the specified cancellation token.
cancellationToken
FromExpiration(Expiration)
public static CallSettings FromExpiration(Expiration expiration)
Creates a CallSettings
for the specified call expiration, or returns null
if expiration
is null.
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.
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.
escapedHeaderValue
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.
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.
FromHeaderMutation(Action<Metadata>)
public static CallSettings FromHeaderMutation(Action<Metadata> headerMutation)
Creates a CallSettings
for the specified header mutation, or returns null
if headerMutation
is null.
FromResponseMetadataHandler(Action<Metadata>)
public static CallSettings FromResponseMetadataHandler(Action<Metadata> responseMetadataHandler)
Creates a CallSettings
for the specified response metadata handler, or returns null
if responseMetadataHandler
is null.
FromRetry(RetrySettings)
public static CallSettings FromRetry(RetrySettings retry)
Creates a CallSettings
for the specified retry settings, or returns null
if retry
is null.
FromTrailingMetadataHandler(Action<Metadata>)
public static CallSettings FromTrailingMetadataHandler(Action<Metadata> trailingMetadataHandler)
Creates a CallSettings
for the specified trailing metadata handler, or returns null
if trailingMetadataHandler
is null.