Class GrpcChannelOptions (3.2.0)

public sealed class GrpcChannelOptions : IEquatable<GrpcChannelOptions>

Portable abstraction of channel options

Inheritance

Object > GrpcChannelOptions

Namespace

Google.Api.Gax.Grpc

Assembly

Google.Api.Gax.Grpc.dll

Properties

CustomOptions

public IReadOnlyList<GrpcChannelOptions.CustomOption> CustomOptions { get; }

Immutable list of custom options. This is never null, but may be empty.

Property Value
TypeDescription
IReadOnlyList<GrpcChannelOptions.CustomOption>

Empty

public static GrpcChannelOptions Empty { get; }

An empty set of channel options.

Property Value
TypeDescription
GrpcChannelOptions

EnableServiceConfigResolution

public bool? EnableServiceConfigResolution { get; }

If non-null, explicitly enables or disables service configuration resolution.

Property Value
TypeDescription
Nullable<Boolean>

KeepAliveTime

public TimeSpan? KeepAliveTime { get; }

If non-null, explicitly specifies the keep-alive period for the channel.

Property Value
TypeDescription
Nullable<TimeSpan>

MaxReceiveMessageSize

public int? MaxReceiveMessageSize { get; }

If non-null, explicitly specifies the maximum size in bytes that can be received from the client, per response.

Property Value
TypeDescription
Nullable<Int32>

MaxSendMessageSize

public int? MaxSendMessageSize { get; }

If non-null, explicitly specifies the maximum size in bytes that can be sent from the client, per request.

Property Value
TypeDescription
Nullable<Int32>

PrimaryUserAgent

public string PrimaryUserAgent { get; }

If non-null, explicitly specifies the primary user agent for the channel.

Property Value
TypeDescription
String

Methods

Equals(GrpcChannelOptions)

public bool Equals(GrpcChannelOptions other)
Parameter
NameDescription
otherGrpcChannelOptions
Returns
TypeDescription
Boolean

Equals(Object)

public override bool Equals(object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
Boolean
Overrides

GetHashCode()

public override int GetHashCode()
Returns
TypeDescription
Int32
Overrides

MergedWith(GrpcChannelOptions)

public GrpcChannelOptions MergedWith(GrpcChannelOptions overlaidOptions)

Returns a new object, with options from this object merged with overlaidOptions. If an option is non-null in both objects, the one from overlaidOptions takes priority.

Parameter
NameDescription
overlaidOptionsGrpcChannelOptions

The overlaid options. Must not be null.

Returns
TypeDescription
GrpcChannelOptions

The new merged options.

WithCustomOption(GrpcChannelOptions.CustomOption)

public GrpcChannelOptions WithCustomOption(GrpcChannelOptions.CustomOption option)

Returns a new instance with the same options as this one, but with a new integer-valued GrpcChannelOptions.CustomOption at the end of CustomOptions.

Parameter
NameDescription
optionGrpcChannelOptions.CustomOption

The additional custom option to include. Must not be null.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithCustomOption(String, Int32)

public GrpcChannelOptions WithCustomOption(string name, int value)

Returns a new instance with the same options as this one, but with a new integer-valued GrpcChannelOptions.CustomOption at the end of CustomOptions.

Parameters
NameDescription
nameString

The name of the new custom option. Must not be null.

valueInt32

The value of the new custom option.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithCustomOption(String, String)

public GrpcChannelOptions WithCustomOption(string name, string value)

Returns a new instance with the same options as this one, but with a new string-valued GrpcChannelOptions.CustomOption at the end of CustomOptions.

Parameters
NameDescription
nameString

The name of the new custom option. Must not be null.

valueString

The value of the new custom option. Must not be null.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithEnableServiceConfigResolution(Boolean)

public GrpcChannelOptions WithEnableServiceConfigResolution(bool enableServiceConfigResolution)

Returns a new instance with the same options as this one, but with EnableServiceConfigResolution set to enableServiceConfigResolution.

Parameter
NameDescription
enableServiceConfigResolutionBoolean

The new option for enabling service config resolution.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithKeepAliveTime(TimeSpan)

public GrpcChannelOptions WithKeepAliveTime(TimeSpan keepAliveTime)

Returns a new instance with the same options as this one, but with KeepAliveTime set to keepAliveTime.

Parameter
NameDescription
keepAliveTimeTimeSpan

The new keep-alive time.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithMaxReceiveMessageSize(Int32)

public GrpcChannelOptions WithMaxReceiveMessageSize(int maxReceiveMessageSize)

Returns a new instance with the same options as this one, but with MaxReceiveMessageSize set to maxReceiveMessageSize.

Parameter
NameDescription
maxReceiveMessageSizeInt32

The new maximum receive message size, in bytes.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithMaxSendMessageSize(Int32)

public GrpcChannelOptions WithMaxSendMessageSize(int maxSendMessageSize)

Returns a new instance with the same options as this one, but with MaxSendMessageSize set to maxSendMessageSize.

Parameter
NameDescription
maxSendMessageSizeInt32

The new maximum send message size, in bytes.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithPrimaryUserAgent(String)

public GrpcChannelOptions WithPrimaryUserAgent(string primaryUserAgent)

Returns a new instance with the same options as this one, but with PrimaryUserAgent set to primaryUserAgent.

Parameter
NameDescription
primaryUserAgentString

The new primary user agent. Must not be null.

Returns
TypeDescription
GrpcChannelOptions

The new options.