/// <summary> /// Constructs a client wrapper for the LookupService service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="LookupServiceSettings"/> used within this client.</param> public LookupServiceClientImpl(LookupService.LookupServiceClient grpcClient, LookupServiceSettings settings) { GrpcClient = grpcClient; LookupServiceSettings effectiveSettings = settings ?? LookupServiceSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callResolveService = clientHelper.BuildApiCall <ResolveServiceRequest, ResolveServiceResponse>(grpcClient.ResolveServiceAsync, grpcClient.ResolveService, effectiveSettings.ResolveServiceSettings).WithGoogleRequestParam("name", request => request.Name); Modify_ApiCall(ref _callResolveService); Modify_ResolveServiceApiCall(ref _callResolveService); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
/// <summary> /// Creates a <see cref="LookupServiceClient"/> 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="LookupServiceSettings"/>.</param> /// <returns>The created <see cref="LookupServiceClient"/>.</returns> internal static LookupServiceClient Create(grpccore::CallInvoker callInvoker, LookupServiceSettings settings = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpcinter::Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor); } LookupService.LookupServiceClient grpcClient = new LookupService.LookupServiceClient(callInvoker); return(new LookupServiceClientImpl(grpcClient, settings)); }
partial void OnConstruction(LookupService.LookupServiceClient grpcClient, LookupServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);