public class ClientHelperCommon helper code shared by clients. This class is primarily expected to be used from generated code.
Namespace
Google.Api.Gax.GrpcAssembly
Google.Api.Gax.Grpc.dll
Constructors
ClientHelper(Options)
public ClientHelper(ClientHelper.Options options)Constructs a helper from the given options. See the properties in ClientHelper.Options for validity constraints.
| Parameter | |
|---|---|
| Name | Description |
options |
ClientHelperOptionsThe options for the helper. |
ClientHelper(ServiceSettingsBase, ILogger)
public ClientHelper(ServiceSettingsBase settings, ILogger logger)Constructs a helper from the given settings. Behavior is undefined if settings are changed after construction.
| Parameters | |
|---|---|
| Name | Description |
settings |
ServiceSettingsBaseThe service settings. |
logger |
ILoggerThe logger to use for API calls |
This constructor will be removed in the next major version of GAX.
Properties
Clock
public IClock Clock { get; }The clock used for timing of retries and deadlines. This is never null; if the clock isn't specified in the settings, this property will return the SystemClock instance.
| Property Value | |
|---|---|
| Type | Description |
IClock |
|
Logger
public ILogger Logger { get; }The logger used by this instance, or null if it does not perform logging.
| Property Value | |
|---|---|
| Type | Description |
ILogger |
|
Scheduler
public IScheduler Scheduler { get; }The scheduler used for delays of retries. This is never null; if the scheduler isn't specified in the settings, this property will return the SystemScheduler instance.
| Property Value | |
|---|---|
| Type | Description |
IScheduler |
|
Methods
BuildApiCall<TRequest, TResponse>(string, Func<CallOptions, AsyncClientStreamingCall<TRequest, TResponse>>, CallSettings, ClientStreamingSettings)
public ApiClientStreamingCall<TRequest, TResponse> BuildApiCall<TRequest, TResponse>(string methodName, Func<CallOptions, AsyncClientStreamingCall<TRequest, TResponse>> grpcCall, CallSettings perMethodCallSettings, ClientStreamingSettings streamingSettings) where TRequest : class, IMessage<TRequest> where TResponse : class, IMessage<TResponse>Builds an ApiClientStreamingCall given a suitable underlying client streaming call.
| Parameters | |
|---|---|
| Name | Description |
methodName |
stringThe underlying method name, for diagnostic purposes. |
grpcCall |
FuncCallOptionsAsyncClientStreamingCallThe underlying gRPC client streaming call. |
perMethodCallSettings |
CallSettingsThe default method call settings. |
streamingSettings |
ClientStreamingSettingsThe default streaming settings. |
| Returns | |
|---|---|
| Type | Description |
ApiClientStreamingCall |
An API call to proxy to the RPC calls |
| Type Parameters | |
|---|---|
| Name | Description |
TRequest |
Request type, which must be a protobuf message. |
TResponse |
Response type, which must be a protobuf message. |
BuildApiCall<TRequest, TResponse>(string, Func<CallOptions, AsyncDuplexStreamingCall<TRequest, TResponse>>, CallSettings, BidirectionalStreamingSettings)
public ApiBidirectionalStreamingCall<TRequest, TResponse> BuildApiCall<TRequest, TResponse>(string methodName, Func<CallOptions, AsyncDuplexStreamingCall<TRequest, TResponse>> grpcCall, CallSettings perMethodCallSettings, BidirectionalStreamingSettings streamingSettings) where TRequest : class, IMessage<TRequest> where TResponse : class, IMessage<TResponse>Builds an ApiBidirectionalStreamingCall given a suitable underlying duplex call.
| Parameters | |
|---|---|
| Name | Description |
methodName |
stringThe underlying method name, for diagnostic purposes. |
grpcCall |
FuncCallOptionsAsyncDuplexStreamingCallThe underlying gRPC duplex streaming call. |
perMethodCallSettings |
CallSettingsThe default method call settings. |
streamingSettings |
BidirectionalStreamingSettingsThe default streaming settings. |
| Returns | |
|---|---|
| Type | Description |
ApiBidirectionalStreamingCall |
An API call to proxy to the RPC calls |
| Type Parameters | |
|---|---|
| Name | Description |
TRequest |
Request type, which must be a protobuf message. |
TResponse |
Response type, which must be a protobuf message. |
BuildApiCall<TRequest, TResponse>(string, Func<TRequest, CallOptions, AsyncServerStreamingCall<TResponse>>, CallSettings)
public ApiServerStreamingCall<TRequest, TResponse> BuildApiCall<TRequest, TResponse>(string methodName, Func<TRequest, CallOptions, AsyncServerStreamingCall<TResponse>> grpcCall, CallSettings perMethodCallSettings) where TRequest : class, IMessage<TRequest> where TResponse : class, IMessage<TResponse>Builds an ApiServerStreamingCall given a suitable underlying server streaming call.
| Parameters | |
|---|---|
| Name | Description |
methodName |
stringThe underlying method name, for diagnostic purposes. |
grpcCall |
FuncCallOptionsAsyncServerStreamingCallThe underlying gRPC server streaming call. |
perMethodCallSettings |
CallSettingsThe default method call settings. |
| Returns | |
|---|---|
| Type | Description |
ApiServerStreamingCall |
An API call to proxy to the RPC calls |
| Type Parameters | |
|---|---|
| Name | Description |
TRequest |
Request type, which must be a protobuf message. |
TResponse |
Response type, which must be a protobuf message. |
BuildApiCall<TRequest, TResponse>(string, Func<TRequest, CallOptions, AsyncUnaryCall<TResponse>>, Func<TRequest, CallOptions, TResponse>, CallSettings)
public ApiCall<TRequest, TResponse> BuildApiCall<TRequest, TResponse>(string methodName, Func<TRequest, CallOptions, AsyncUnaryCall<TResponse>> asyncGrpcCall, Func<TRequest, CallOptions, TResponse> syncGrpcCall, CallSettings perMethodCallSettings) where TRequest : class, IMessage<TRequest> where TResponse : class, IMessage<TResponse>Builds an ApiCall given suitable underlying async and sync calls.
| Parameters | |
|---|---|
| Name | Description |
methodName |
stringThe underlying method name, for diagnostic purposes. |
asyncGrpcCall |
FuncCallOptionsAsyncUnaryCallThe underlying synchronous gRPC call. |
syncGrpcCall |
FuncCallOptionsThe underlying asynchronous gRPC call. |
perMethodCallSettings |
CallSettingsThe default method call settings. |
| Returns | |
|---|---|
| Type | Description |
ApiCall |
An API call to proxy to the RPC calls |
| Type Parameters | |
|---|---|
| Name | Description |
TRequest |
Request type, which must be a protobuf message. |
TResponse |
Response type, which must be a protobuf message. |