/// <summary> /// Constructs a client wrapper for the Basic service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="BasicSettings"/> used within this client.</param> /// <param name="logger">Optional <see cref="mel::ILogger"/> to use within this client.</param> public BasicClientImpl(Basic.BasicClient grpcClient, BasicSettings settings, mel::ILogger logger) { GrpcClient = grpcClient; BasicSettings effectiveSettings = settings ?? BasicSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings, logger); _callAMethod = clientHelper.BuildApiCall <Request, Response>("AMethod", grpcClient.AMethodAsync, grpcClient.AMethod, effectiveSettings.AMethodSettings); Modify_ApiCall(ref _callAMethod); Modify_AMethodApiCall(ref _callAMethod); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
/// <summary> /// Creates a <see cref="BasicClient"/> which uses the specified call invoker for remote operations. /// </summary> /// <param name="callInvoker"> /// The <see cref="grpccore::CallInvoker"/> for remote operations. Must not be null. /// </param> /// <param name="settings">Optional <see cref="BasicSettings"/>.</param> /// <param name="logger">Optional <see cref="mel::ILogger"/>.</param> /// <returns>The created <see cref="BasicClient"/>.</returns> internal static BasicClient Create(grpccore::CallInvoker callInvoker, BasicSettings settings = null, mel::ILogger logger = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpcinter::Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor); } Basic.BasicClient grpcClient = new Basic.BasicClient(callInvoker); return(new BasicClientImpl(grpcClient, settings, logger)); }
partial void OnCopy(BasicSettings existing);
private BasicSettings(BasicSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AMethodSettings = existing.AMethodSettings; OnCopy(existing); }
partial void OnConstruction(Basic.BasicClient grpcClient, BasicSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);