예제 #1
0
 /// <summary>Snippet for Delete</summary>
 public void Delete()
 {
     // Snippet: Delete(string, string, CallSettings)
     // Create client
     GlobalOperationsClient globalOperationsClient = GlobalOperationsClient.Create();
     // Initialize request argument(s)
     string project   = "";
     string operation = "";
     // Make the request
     DeleteGlobalOperationResponse response = globalOperationsClient.Delete(project, operation);
     // End snippet
 }
예제 #2
0
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteAsync()
        {
            // Snippet: DeleteAsync(string, string, CallSettings)
            // Additional: DeleteAsync(string, string, CancellationToken)
            // Create client
            GlobalOperationsClient globalOperationsClient = await GlobalOperationsClient.CreateAsync();

            // Initialize request argument(s)
            string project   = "";
            string operation = "";
            // Make the request
            DeleteGlobalOperationResponse response = await globalOperationsClient.DeleteAsync(project, operation);

            // End snippet
        }
예제 #3
0
 /// <summary>Snippet for Delete</summary>
 public void DeleteRequestObject()
 {
     // Snippet: Delete(DeleteGlobalOperationRequest, CallSettings)
     // Create client
     GlobalOperationsClient globalOperationsClient = GlobalOperationsClient.Create();
     // Initialize request argument(s)
     DeleteGlobalOperationRequest request = new DeleteGlobalOperationRequest
     {
         Operation = "",
         Project   = "",
     };
     // Make the request
     DeleteGlobalOperationResponse response = globalOperationsClient.Delete(request);
     // End snippet
 }
예제 #4
0
        public void Delete()
        {
            moq::Mock <GlobalOperations.GlobalOperationsClient> mockGrpcClient = new moq::Mock <GlobalOperations.GlobalOperationsClient>(moq::MockBehavior.Strict);
            DeleteGlobalOperationRequest request = new DeleteGlobalOperationRequest
            {
                Operation = "operation615a23f7",
                Project   = "projectaa6ff846",
            };
            DeleteGlobalOperationResponse expectedResponse = new DeleteGlobalOperationResponse {
            };

            mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            GlobalOperationsClient        client   = new GlobalOperationsClientImpl(mockGrpcClient.Object, null);
            DeleteGlobalOperationResponse response = client.Delete(request.Project, request.Operation);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
예제 #5
0
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteRequestObjectAsync()
        {
            // Snippet: DeleteAsync(DeleteGlobalOperationRequest, CallSettings)
            // Additional: DeleteAsync(DeleteGlobalOperationRequest, CancellationToken)
            // Create client
            GlobalOperationsClient globalOperationsClient = await GlobalOperationsClient.CreateAsync();

            // Initialize request argument(s)
            DeleteGlobalOperationRequest request = new DeleteGlobalOperationRequest
            {
                Operation = "",
                Project   = "",
            };
            // Make the request
            DeleteGlobalOperationResponse response = await globalOperationsClient.DeleteAsync(request);

            // End snippet
        }
예제 #6
0
        public async stt::Task DeleteAsync()
        {
            moq::Mock <GlobalOperations.GlobalOperationsClient> mockGrpcClient = new moq::Mock <GlobalOperations.GlobalOperationsClient>(moq::MockBehavior.Strict);
            DeleteGlobalOperationRequest request = new DeleteGlobalOperationRequest
            {
                Operation = "operation615a23f7",
                Project   = "projectaa6ff846",
            };
            DeleteGlobalOperationResponse expectedResponse = new DeleteGlobalOperationResponse {
            };

            mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <DeleteGlobalOperationResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            GlobalOperationsClient        client = new GlobalOperationsClientImpl(mockGrpcClient.Object, null);
            DeleteGlobalOperationResponse responseCallSettings = await client.DeleteAsync(request.Project, request.Operation, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            DeleteGlobalOperationResponse responseCancellationToken = await client.DeleteAsync(request.Project, request.Operation, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }