/// <summary> /// Creates a <see cref="ErrorGroupServiceClient"/> 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="ErrorGroupServiceSettings"/>.</param> /// <returns>The created <see cref="ErrorGroupServiceClient"/>.</returns> public static ErrorGroupServiceClient Create(grpccore::CallInvoker callInvoker, ErrorGroupServiceSettings settings = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpccore::Interceptors.Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpccore::Interceptors.CallInvokerExtensions.Intercept(callInvoker, interceptor); } ErrorGroupService.ErrorGroupServiceClient grpcClient = new ErrorGroupService.ErrorGroupServiceClient(callInvoker); return(new ErrorGroupServiceClientImpl(grpcClient, settings)); }
/// <summary> /// Constructs a client wrapper for the ErrorGroupService service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="ErrorGroupServiceSettings"/> used within this client </param> public ErrorGroupServiceClientImpl(ErrorGroupService.ErrorGroupServiceClient grpcClient, ErrorGroupServiceSettings settings) { this.GrpcClient = grpcClient; ErrorGroupServiceSettings effectiveSettings = settings ?? ErrorGroupServiceSettings.GetDefault(); _clientHelper = new ClientHelper(effectiveSettings); _callGetGroup = _clientHelper.BuildApiCall <GetGroupRequest, ErrorGroup>( GrpcClient.GetGroupAsync, GrpcClient.GetGroup, effectiveSettings.GetGroupSettings); _callUpdateGroup = _clientHelper.BuildApiCall <UpdateGroupRequest, ErrorGroup>( GrpcClient.UpdateGroupAsync, GrpcClient.UpdateGroup, effectiveSettings.UpdateGroupSettings); }
/// <summary> /// Constructs a client wrapper for the ErrorGroupService service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="ErrorGroupServiceSettings"/> used within this client.</param> public ErrorGroupServiceClientImpl(ErrorGroupService.ErrorGroupServiceClient grpcClient, ErrorGroupServiceSettings settings) { GrpcClient = grpcClient; ErrorGroupServiceSettings effectiveSettings = settings ?? ErrorGroupServiceSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callGetGroup = clientHelper.BuildApiCall <GetGroupRequest, ErrorGroup>(grpcClient.GetGroupAsync, grpcClient.GetGroup, effectiveSettings.GetGroupSettings).WithGoogleRequestParam("group_name", request => request.GroupName); Modify_ApiCall(ref _callGetGroup); Modify_GetGroupApiCall(ref _callGetGroup); _callUpdateGroup = clientHelper.BuildApiCall <UpdateGroupRequest, ErrorGroup>(grpcClient.UpdateGroupAsync, grpcClient.UpdateGroup, effectiveSettings.UpdateGroupSettings).WithGoogleRequestParam("group.name", request => request.Group?.Name); Modify_ApiCall(ref _callUpdateGroup); Modify_UpdateGroupApiCall(ref _callUpdateGroup); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
/// <summary> /// Constructs a client wrapper for the ErrorGroupService service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="ErrorGroupServiceSettings"/> used within this client.</param> public ErrorGroupServiceClientImpl(ErrorGroupService.ErrorGroupServiceClient grpcClient, ErrorGroupServiceSettings settings) { GrpcClient = grpcClient; ErrorGroupServiceSettings effectiveSettings = settings ?? ErrorGroupServiceSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callGetGroup = clientHelper.BuildApiCall <GetGroupRequest, ErrorGroup>(grpcClient.GetGroupAsync, grpcClient.GetGroup, effectiveSettings.GetGroupSettings).WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"group_name={(sysnet::WebUtility.UrlEncode(request.GroupName))}")); Modify_ApiCall(ref _callGetGroup); Modify_GetGroupApiCall(ref _callGetGroup); _callUpdateGroup = clientHelper.BuildApiCall <UpdateGroupRequest, ErrorGroup>(grpcClient.UpdateGroupAsync, grpcClient.UpdateGroup, effectiveSettings.UpdateGroupSettings).WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"group.name={(sysnet::WebUtility.UrlEncode(request.Group.Name))}")); Modify_ApiCall(ref _callUpdateGroup); Modify_UpdateGroupApiCall(ref _callUpdateGroup); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
partial void OnConstruction(ErrorGroupService.ErrorGroupServiceClient grpcClient, ErrorGroupServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
/// <summary> /// Creates a <see cref="ErrorGroupServiceClient"/> which uses the specified channel for remote operations. /// </summary> /// <param name="channel">The <see cref="grpccore::Channel"/> for remote operations. Must not be null.</param> /// <param name="settings">Optional <see cref="ErrorGroupServiceSettings"/>.</param> /// <returns>The created <see cref="ErrorGroupServiceClient"/>.</returns> public static ErrorGroupServiceClient Create(grpccore::Channel channel, ErrorGroupServiceSettings settings = null) { gax::GaxPreconditions.CheckNotNull(channel, nameof(channel)); ErrorGroupService.ErrorGroupServiceClient grpcClient = new ErrorGroupService.ErrorGroupServiceClient(channel); return(new ErrorGroupServiceClientImpl(grpcClient, settings)); }