private ServiceControllerSettings(ServiceControllerSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); CheckSettings = existing.CheckSettings; ReportSettings = existing.ReportSettings; OnCopy(existing); }
/// <summary> /// Constructs a client wrapper for the ServiceController service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="ServiceControllerSettings"/> used within this client.</param> public ServiceControllerClientImpl(ServiceController.ServiceControllerClient grpcClient, ServiceControllerSettings settings) { GrpcClient = grpcClient; ServiceControllerSettings effectiveSettings = settings ?? ServiceControllerSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callCheck = clientHelper.BuildApiCall <CheckRequest, CheckResponse>(grpcClient.CheckAsync, grpcClient.Check, effectiveSettings.CheckSettings).WithGoogleRequestParam("service_name", request => request.ServiceName); Modify_ApiCall(ref _callCheck); Modify_CheckApiCall(ref _callCheck); _callReport = clientHelper.BuildApiCall <ReportRequest, ReportResponse>(grpcClient.ReportAsync, grpcClient.Report, effectiveSettings.ReportSettings).WithGoogleRequestParam("service_name", request => request.ServiceName); Modify_ApiCall(ref _callReport); Modify_ReportApiCall(ref _callReport); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
partial void OnCopy(ServiceControllerSettings existing);
partial void OnConstruction(ServiceController.ServiceControllerClient grpcClient, ServiceControllerSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
/// <summary> /// Creates a <see cref="ServiceControllerClient"/> 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="ServiceControllerSettings"/>.</param> /// <returns>The created <see cref="ServiceControllerClient"/>.</returns> internal static ServiceControllerClient Create(grpccore::CallInvoker callInvoker, ServiceControllerSettings settings = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpcinter::Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor); } ServiceController.ServiceControllerClient grpcClient = new ServiceController.ServiceControllerClient(callInvoker); return(new ServiceControllerClientImpl(grpcClient, settings)); }