/// <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> public BasicClientImpl(Basic.BasicClient grpcClient, BasicSettings settings) { GrpcClient = grpcClient; BasicSettings effectiveSettings = settings ?? BasicSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callAMethod = clientHelper.BuildApiCall <Request, Response>(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> /// <returns>The created <see cref="BasicClient"/>.</returns> internal static BasicClient Create(grpccore::CallInvoker callInvoker, BasicSettings settings = 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)); }
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);