예제 #1
0
        public void DeletePageResourceNames()
        {
            moq::Mock <Pages.PagesClient> mockGrpcClient = new moq::Mock <Pages.PagesClient>(moq::MockBehavior.Strict);
            DeletePageRequest             request        = new DeletePageRequest
            {
                PageName = PageName.FromProjectLocationAgentFlowPage("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

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

            client.DeletePage(request.PageName);
            mockGrpcClient.VerifyAll();
        }
예제 #2
0
        /// <summary>Snippet for DeletePage</summary>
        public void DeletePageRequestObject()
        {
            // Snippet: DeletePage(DeletePageRequest, CallSettings)
            // Create client
            PagesClient pagesClient = PagesClient.Create();
            // Initialize request argument(s)
            DeletePageRequest request = new DeletePageRequest
            {
                PageName = PageName.FromProjectLocationAgentFlowPage("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"),
                Force    = false,
            };

            // Make the request
            pagesClient.DeletePage(request);
            // End snippet
        }
예제 #3
0
        public async stt::Task DeletePageResourceNamesAsync()
        {
            moq::Mock <Pages.PagesClient> mockGrpcClient = new moq::Mock <Pages.PagesClient>(moq::MockBehavior.Strict);
            DeletePageRequest             request        = new DeletePageRequest
            {
                PageName = PageName.FromProjectLocationAgentFlowPage("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

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

            await client.DeletePageAsync(request.PageName, st::CancellationToken.None);

            mockGrpcClient.VerifyAll();
        }
예제 #4
0
        /// <summary>Snippet for DeletePageAsync</summary>
        public async Task DeletePageRequestObjectAsync()
        {
            // Snippet: DeletePageAsync(DeletePageRequest, CallSettings)
            // Additional: DeletePageAsync(DeletePageRequest, CancellationToken)
            // Create client
            PagesClient pagesClient = await PagesClient.CreateAsync();

            // Initialize request argument(s)
            DeletePageRequest request = new DeletePageRequest
            {
                PageName = PageName.FromProjectLocationAgentFlowPage("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"),
                Force    = false,
            };
            // Make the request
            await pagesClient.DeletePageAsync(request);

            // End snippet
        }