/// <summary> /// Creates a <see cref="Controller2Client"/> 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="Controller2Settings"/>.</param> /// <returns>The created <see cref="Controller2Client"/>.</returns> internal static Controller2Client Create(grpccore::CallInvoker callInvoker, Controller2Settings settings = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpcinter::Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor); } Controller2.Controller2Client grpcClient = new Controller2.Controller2Client(callInvoker); return(new Controller2ClientImpl(grpcClient, settings)); }
/// <summary> /// Constructs a client wrapper for the Controller2 service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="Controller2Settings"/> used within this client </param> public Controller2ClientImpl(Controller2.Controller2Client grpcClient, Controller2Settings settings) { GrpcClient = grpcClient; Controller2Settings effectiveSettings = settings ?? Controller2Settings.GetDefault(); ClientHelper clientHelper = new ClientHelper(effectiveSettings); _callRegisterDebuggee = clientHelper.BuildApiCall <RegisterDebuggeeRequest, RegisterDebuggeeResponse>( GrpcClient.RegisterDebuggeeAsync, GrpcClient.RegisterDebuggee, effectiveSettings.RegisterDebuggeeSettings); _callListActiveBreakpoints = clientHelper.BuildApiCall <ListActiveBreakpointsRequest, ListActiveBreakpointsResponse>( GrpcClient.ListActiveBreakpointsAsync, GrpcClient.ListActiveBreakpoints, effectiveSettings.ListActiveBreakpointsSettings); _callUpdateActiveBreakpoint = clientHelper.BuildApiCall <UpdateActiveBreakpointRequest, UpdateActiveBreakpointResponse>( GrpcClient.UpdateActiveBreakpointAsync, GrpcClient.UpdateActiveBreakpoint, effectiveSettings.UpdateActiveBreakpointSettings); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
/// <summary> /// Constructs a client wrapper for the Controller2 service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="Controller2Settings"/> used within this client.</param> public Controller2ClientImpl(Controller2.Controller2Client grpcClient, Controller2Settings settings) { GrpcClient = grpcClient; Controller2Settings effectiveSettings = settings ?? Controller2Settings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callRegisterDebuggee = clientHelper.BuildApiCall <RegisterDebuggeeRequest, RegisterDebuggeeResponse>(grpcClient.RegisterDebuggeeAsync, grpcClient.RegisterDebuggee, effectiveSettings.RegisterDebuggeeSettings); Modify_ApiCall(ref _callRegisterDebuggee); Modify_RegisterDebuggeeApiCall(ref _callRegisterDebuggee); _callListActiveBreakpoints = clientHelper.BuildApiCall <ListActiveBreakpointsRequest, ListActiveBreakpointsResponse>(grpcClient.ListActiveBreakpointsAsync, grpcClient.ListActiveBreakpoints, effectiveSettings.ListActiveBreakpointsSettings).WithGoogleRequestParam("debuggee_id", request => request.DebuggeeId); Modify_ApiCall(ref _callListActiveBreakpoints); Modify_ListActiveBreakpointsApiCall(ref _callListActiveBreakpoints); _callUpdateActiveBreakpoint = clientHelper.BuildApiCall <UpdateActiveBreakpointRequest, UpdateActiveBreakpointResponse>(grpcClient.UpdateActiveBreakpointAsync, grpcClient.UpdateActiveBreakpoint, effectiveSettings.UpdateActiveBreakpointSettings).WithGoogleRequestParam("debuggee_id", request => request.DebuggeeId).WithGoogleRequestParam("breakpoint.id", request => request.Breakpoint?.Id); Modify_ApiCall(ref _callUpdateActiveBreakpoint); Modify_UpdateActiveBreakpointApiCall(ref _callUpdateActiveBreakpoint); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
partial void OnConstruction(Controller2.Controller2Client grpcClient, Controller2Settings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
/// <summary> /// Creates a <see cref="Controller2Client"/> which uses the specified channel for remote operations. /// </summary> /// <param name="channel">The <see cref="Channel"/> for remote operations. Must not be null.</param> /// <param name="settings">Optional <see cref="Controller2Settings"/>.</param> /// <returns>The created <see cref="Controller2Client"/>.</returns> public static Controller2Client Create(Channel channel, Controller2Settings settings = null) { GaxPreconditions.CheckNotNull(channel, nameof(channel)); Controller2.Controller2Client grpcClient = new Controller2.Controller2Client(channel); return(new Controller2ClientImpl(grpcClient, settings)); }