/// <summary>Snippet for DeleteWorkflowTemplate</summary>
        public void DeleteWorkflowTemplate_RequestObject()
        {
            // Snippet: DeleteWorkflowTemplate(DeleteWorkflowTemplateRequest,CallSettings)
            // Create client
            WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.Create();
            // Initialize request argument(s)
            DeleteWorkflowTemplateRequest request = new DeleteWorkflowTemplateRequest
            {
                WorkflowTemplateName = new WorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"),
            };

            // Make the request
            workflowTemplateServiceClient.DeleteWorkflowTemplate(request);
            // End snippet
        }
        /// <summary>Snippet for DeleteWorkflowTemplateAsync</summary>
        public async Task DeleteWorkflowTemplateAsync_RequestObject()
        {
            // Snippet: DeleteWorkflowTemplateAsync(DeleteWorkflowTemplateRequest,CallSettings)
            // Additional: DeleteWorkflowTemplateAsync(DeleteWorkflowTemplateRequest,CancellationToken)
            // Create client
            WorkflowTemplateServiceClient workflowTemplateServiceClient = await WorkflowTemplateServiceClient.CreateAsync();

            // Initialize request argument(s)
            DeleteWorkflowTemplateRequest request = new DeleteWorkflowTemplateRequest
            {
                WorkflowTemplateName = new WorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"),
            };
            // Make the request
            await workflowTemplateServiceClient.DeleteWorkflowTemplateAsync(request);

            // End snippet
        }
        public void DeleteWorkflowTemplateResourceNames()
        {
            moq::Mock <WorkflowTemplateService.WorkflowTemplateServiceClient> mockGrpcClient = new moq::Mock <WorkflowTemplateService.WorkflowTemplateServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            DeleteWorkflowTemplateRequest request = new DeleteWorkflowTemplateRequest
            {
                WorkflowTemplateName = WorkflowTemplateName.FromProjectRegionWorkflowTemplate("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteWorkflowTemplate(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            WorkflowTemplateServiceClient client = new WorkflowTemplateServiceClientImpl(mockGrpcClient.Object, null);

            client.DeleteWorkflowTemplate(request.WorkflowTemplateName);
            mockGrpcClient.VerifyAll();
        }
Exemple #4
0
        public async Task DeleteWorkflowTemplateAsync2()
        {
            Mock <WorkflowTemplateService.WorkflowTemplateServiceClient> mockGrpcClient = new Mock <WorkflowTemplateService.WorkflowTemplateServiceClient>(MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient())
            .Returns(new Mock <Operations.OperationsClient>().Object);
            DeleteWorkflowTemplateRequest request = new DeleteWorkflowTemplateRequest
            {
                WorkflowTemplateName = new WorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"),
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.DeleteWorkflowTemplateAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <Empty>(Task.FromResult(expectedResponse), null, null, null, null));
            WorkflowTemplateServiceClient client = new WorkflowTemplateServiceClientImpl(mockGrpcClient.Object, null);
            await client.DeleteWorkflowTemplateAsync(request);

            mockGrpcClient.VerifyAll();
        }
Exemple #5
0
        public void DeleteWorkflowTemplate2()
        {
            Mock <WorkflowTemplateService.WorkflowTemplateServiceClient> mockGrpcClient = new Mock <WorkflowTemplateService.WorkflowTemplateServiceClient>(MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient())
            .Returns(new Mock <Operations.OperationsClient>().Object);
            DeleteWorkflowTemplateRequest request = new DeleteWorkflowTemplateRequest
            {
                WorkflowTemplateName = new WorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"),
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.DeleteWorkflowTemplate(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            WorkflowTemplateServiceClient client = new WorkflowTemplateServiceClientImpl(mockGrpcClient.Object, null);

            client.DeleteWorkflowTemplate(request);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task DeleteWorkflowTemplateResourceNamesAsync()
        {
            moq::Mock <WorkflowTemplateService.WorkflowTemplateServiceClient> mockGrpcClient = new moq::Mock <WorkflowTemplateService.WorkflowTemplateServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            DeleteWorkflowTemplateRequest request = new DeleteWorkflowTemplateRequest
            {
                WorkflowTemplateName = WorkflowTemplateName.FromProjectRegionWorkflowTemplate("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteWorkflowTemplateAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            WorkflowTemplateServiceClient client = new WorkflowTemplateServiceClientImpl(mockGrpcClient.Object, null);
            await client.DeleteWorkflowTemplateAsync(request.WorkflowTemplateName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            await client.DeleteWorkflowTemplateAsync(request.WorkflowTemplateName, st::CancellationToken.None);

            mockGrpcClient.VerifyAll();
        }