Class CallSettings (3.2.0)

public sealed class CallSettings

Settings to determine how an RPC operates. This type is immutable.

Inheritance

Object > CallSettings

Namespace

Google.Api.Gax.Grpc

Assembly

Google.Api.Gax.Grpc.dll

Constructors

CallSettings(Nullable<CancellationToken>, CallCredentials, Expiration, RetrySettings, Action<Metadata>, WriteOptions, ContextPropagationToken)

[Obsolete("This is obsolete as it allows per-call credentials to be specified. Please use an alternative overload and see https://github.com/googleapis/gax-dotnet/blob/master/docs/PER_CALL_CREDENTIAL.md for more information.")]
public CallSettings(CancellationToken? cancellationToken, CallCredentials credentials, Expiration expiration, RetrySettings retry, Action<Metadata> headerMutation, WriteOptions writeOptions, ContextPropagationToken propagationToken)

Obsolete. This is obsolete as it allows per-call credentials to be specified. Please use CallSettings(Nullable<CancellationToken>, Expiration, RetrySettings, Action<Metadata>, WriteOptions, ContextPropagationToken), and see https://github.com/googleapis/gax-dotnet/blob/master/docs/PER_CALL_CREDENTIAL.md for more information. Constructs an instance with the specified settings.

Parameters
NameDescription
cancellationTokenNullable<CancellationToken>

Cancellation token that can be used for cancelling the call.

credentialsCallCredentials

Credentials to use for the call.

expirationExpiration

Expiration to use, or null for default expiration behavior.

retryRetrySettings

Retry to use, or null for default retry behavior.

headerMutationAction<Metadata>

Action to modify the headers to send at the beginning of the call.

writeOptionsWriteOptions

that will be used for the call.

propagationTokenContextPropagationToken

for propagating settings from a parent call.

CallSettings(Nullable<CancellationToken>, CallCredentials, Expiration, RetrySettings, Action<Metadata>, WriteOptions, ContextPropagationToken, Action<Metadata>, Action<Metadata>)

[Obsolete("This is obsolete as it allows per-call credentials to be specified. Please use an alternative overload and see https://github.com/googleapis/gax-dotnet/blob/master/docs/PER_CALL_CREDENTIAL.md for more information.")]
public CallSettings(CancellationToken? cancellationToken, CallCredentials credentials, Expiration expiration, RetrySettings retry, Action<Metadata> headerMutation, WriteOptions writeOptions, ContextPropagationToken propagationToken, Action<Metadata> responseMetadataHandler, Action<Metadata> trailingMetadataHandler)

Obsolete. This is obsolete as it allows per-call credentials to be specified. Please use CallSettings(Nullable<CancellationToken>, Expiration, RetrySettings, Action<Metadata>, WriteOptions, ContextPropagationToken, Action<Metadata>, Action<Metadata>), and see https://github.com/googleapis/gax-dotnet/blob/master/docs/PER_CALL_CREDENTIAL.md for more information. Constructs an instance with the specified settings.

Parameters
NameDescription
cancellationTokenNullable<CancellationToken>

Cancellation token that can be used for cancelling the call.

credentialsCallCredentials

Credentials to use for the call.

expirationExpiration

Expiration to use, or null for default expiration behavior.

retryRetrySettings

Retry to use, or null for default retry behavior.

headerMutationAction<Metadata>

Action to modify the headers to send at the beginning of the call.

writeOptionsWriteOptions

that will be used for the call.

propagationTokenContextPropagationToken

for propagating settings from a parent call.

responseMetadataHandlerAction<Metadata>

Action to invoke when response metadata is received.

trailingMetadataHandlerAction<Metadata>

Action to invoke when trailing metadata is received.

CallSettings(Nullable<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.

Parameters
NameDescription
cancellationTokenNullable<CancellationToken>

Cancellation token that can be used for cancelling the call.

expirationExpiration

Expiration to use, or null for default expiration behavior.

retryRetrySettings

Retry to use, or null for default retry behavior.

headerMutationAction<Metadata>

Action to modify the headers to send at the beginning of the call.

writeOptionsWriteOptions

that will be used for the call.

propagationTokenContextPropagationToken

for propagating settings from a parent call.

CallSettings(Nullable<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.

Parameters
NameDescription
cancellationTokenNullable<CancellationToken>

Cancellation token that can be used for cancelling the call.

expirationExpiration

Expiration to use, or null for default expiration behavior.

retryRetrySettings

Retry to use, or null for default retry behavior.

headerMutationAction<Metadata>

Action to modify the headers to send at the beginning of the call.

writeOptionsWriteOptions

that will be used for the call.

propagationTokenContextPropagationToken

for propagating settings from a parent call.

responseMetadataHandlerAction<Metadata>

Action to invoke when response metadata is received.

trailingMetadataHandlerAction<Metadata>

Action 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
TypeDescription
Nullable<CancellationToken>

Credentials

[Obsolete("https://github.com/googleapis/gax-dotnet/blob/master/PER_CALL_CREDENTIAL.md")]
public CallCredentials Credentials { get; }

Credentials to use for the call.

Property Value
TypeDescription
CallCredentials

Expiration

public Expiration Expiration { get; }

The expiration for the call (either a timeout or a deadline), or null for the default expiration.

Property Value
TypeDescription
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.

Property Value
TypeDescription
Action<Metadata>

PropagationToken

public ContextPropagationToken PropagationToken { get; }

for propagating settings from a parent call.

Property Value
TypeDescription
ContextPropagationToken

ResponseMetadataHandler

public Action<Metadata> ResponseMetadataHandler { get; }

Delegate to receive the metadata associated with a response.

Property Value
TypeDescription
Action<Metadata>

Retry

public RetrySettings Retry { get; }

RetrySettings to use, or null for default retry behavior.

Property Value
TypeDescription
RetrySettings

TrailingMetadataHandler

public Action<Metadata> TrailingMetadataHandler { get; }

Delegate to receive the metadata sent after the response.

Property Value
TypeDescription
Action<Metadata>

WriteOptions

public WriteOptions WriteOptions { get; }

that will be used for the call.

Property Value
TypeDescription
WriteOptions

Methods

FromCallCredentials(CallCredentials)

[Obsolete("https://github.com/googleapis/gax-dotnet/blob/master/PER_CALL_CREDENTIAL.md")]
public static CallSettings FromCallCredentials(CallCredentials credentials)

Obsolete. See: https://github.com/googleapis/gax-dotnet/blob/master/PER_CALL_CREDENTIAL.md Creates a CallSettings for the specified call credentials, or returns null if credentials is null.

Parameter
NameDescription
credentialsCallCredentials

The call credentials for the new settings.

Returns
TypeDescription
CallSettings

A new instance, or null if credentials is null.

FromCancellationToken(CancellationToken)

public static CallSettings FromCancellationToken(CancellationToken cancellationToken)

Creates a CallSettings for the specified cancellation token.

Parameter
NameDescription
cancellationTokenCancellationToken

The cancellation token for the new settings.

Returns
TypeDescription
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
NameDescription
expirationExpiration

The call timing for the new settings.

Returns
TypeDescription
CallSettings

A new instance or 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.

Parameter
NameDescription
fieldMaskString

The field mask for the request. Must not be null.

Returns
TypeDescription
CallSettings

A new instance.

Remarks

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.

FromHeader(String, String)

public static CallSettings FromHeader(string name, string value)

Creates a CallSettings for the specified header name and value.

Parameters
NameDescription
nameString

The name of the header to add. Must not be null.

valueString

The value of the header to add. Must not be null.

Returns
TypeDescription
CallSettings

A new instance.

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.

Parameter
NameDescription
headerMutationAction<Metadata>

Action to modify the headers to send at the beginning of the call.

Returns
TypeDescription
CallSettings

A new instance, or 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.

Parameter
NameDescription
responseMetadataHandlerAction<Metadata>

Action to receive response metadata when the call completes.

Returns
TypeDescription
CallSettings

A new instance, or 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.

Parameter
NameDescription
retryRetrySettings

The call timing for the new settings.

Returns
TypeDescription
CallSettings

A new instance or 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.

Parameter
NameDescription
trailingMetadataHandlerAction<Metadata>

Action to receive trailing metadata when the call completes.

Returns
TypeDescription
CallSettings

A new instance, or null if trailingMetadataHandler is null..

Extension Methods