示例#1
0
        /// <summary>
        /// Creates a <see cref="ZoneOperationsClient"/> 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="ZoneOperationsSettings"/>.</param>
        /// <returns>The created <see cref="ZoneOperationsClient"/>.</returns>
        internal static ZoneOperationsClient Create(grpccore::CallInvoker callInvoker, ZoneOperationsSettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            ZoneOperations.ZoneOperationsClient grpcClient = new ZoneOperations.ZoneOperationsClient(callInvoker);
            return(new ZoneOperationsClientImpl(grpcClient, settings));
        }
示例#2
0
        /// <summary>
        /// Constructs a client wrapper for the ZoneOperations service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="ZoneOperationsSettings"/> used within this client.</param>
        public ZoneOperationsClientImpl(ZoneOperations.ZoneOperationsClient grpcClient, ZoneOperationsSettings settings)
        {
            GrpcClient = grpcClient;
            ZoneOperationsSettings effectiveSettings = settings ?? ZoneOperationsSettings.GetDefault();
            gaxgrpc::ClientHelper  clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callDelete = clientHelper.BuildApiCall <DeleteZoneOperationRequest, DeleteZoneOperationResponse>(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("zone", request => request.Zone).WithGoogleRequestParam("operation", request => request.Operation);
            Modify_ApiCall(ref _callDelete);
            Modify_DeleteApiCall(ref _callDelete);
            _callGet = clientHelper.BuildApiCall <GetZoneOperationRequest, Operation>(grpcClient.GetAsync, grpcClient.Get, effectiveSettings.GetSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("zone", request => request.Zone).WithGoogleRequestParam("operation", request => request.Operation);
            Modify_ApiCall(ref _callGet);
            Modify_GetApiCall(ref _callGet);
            _callList = clientHelper.BuildApiCall <ListZoneOperationsRequest, OperationList>(grpcClient.ListAsync, grpcClient.List, effectiveSettings.ListSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("zone", request => request.Zone);
            Modify_ApiCall(ref _callList);
            Modify_ListApiCall(ref _callList);
            _callWait = clientHelper.BuildApiCall <WaitZoneOperationRequest, Operation>(grpcClient.WaitAsync, grpcClient.Wait, effectiveSettings.WaitSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("zone", request => request.Zone).WithGoogleRequestParam("operation", request => request.Operation);
            Modify_ApiCall(ref _callWait);
            Modify_WaitApiCall(ref _callWait);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
示例#3
0
 partial void OnConstruction(ZoneOperations.ZoneOperationsClient grpcClient, ZoneOperationsSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);