Exemple #1
0
 /// <summary>Snippet for ListInfoTypes</summary>
 public void ListInfoTypes_RequestObject()
 {
     // Snippet: ListInfoTypes(ListInfoTypesRequest,CallSettings)
     // Create client
     DlpServiceClient dlpServiceClient = DlpServiceClient.Create();
     // Initialize request argument(s)
     ListInfoTypesRequest request = new ListInfoTypesRequest();
     // Make the request
     ListInfoTypesResponse response = dlpServiceClient.ListInfoTypes(request);
     // End snippet
 }
        public async Task ListInfoTypesAsync()
        {
            Mock <DlpService.DlpServiceClient> mockGrpcClient = new Mock <DlpService.DlpServiceClient>(MockBehavior.Strict);
            ListInfoTypesRequest  request          = new ListInfoTypesRequest();
            ListInfoTypesResponse expectedResponse = new ListInfoTypesResponse();

            mockGrpcClient.Setup(x => x.ListInfoTypesAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <ListInfoTypesResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            DlpServiceClient      client   = new DlpServiceClientImpl(mockGrpcClient.Object, null);
            ListInfoTypesResponse response = await client.ListInfoTypesAsync(request);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemple #3
0
        /// <summary>Snippet for ListInfoTypesAsync</summary>
        public async Task ListInfoTypesAsync_RequestObject()
        {
            // Snippet: ListInfoTypesAsync(ListInfoTypesRequest,CallSettings)
            // Additional: ListInfoTypesAsync(ListInfoTypesRequest,CancellationToken)
            // Create client
            DlpServiceClient dlpServiceClient = await DlpServiceClient.CreateAsync();

            // Initialize request argument(s)
            ListInfoTypesRequest request = new ListInfoTypesRequest();
            // Make the request
            ListInfoTypesResponse response = await dlpServiceClient.ListInfoTypesAsync(request);

            // End snippet
        }
        public void ListInfoTypes()
        {
            Mock <DlpService.DlpServiceClient> mockGrpcClient = new Mock <DlpService.DlpServiceClient>(MockBehavior.Strict);
            ListInfoTypesRequest  request          = new ListInfoTypesRequest();
            ListInfoTypesResponse expectedResponse = new ListInfoTypesResponse();

            mockGrpcClient.Setup(x => x.ListInfoTypes(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            DlpServiceClient      client   = new DlpServiceClientImpl(mockGrpcClient.Object, null);
            ListInfoTypesResponse response = client.ListInfoTypes(request);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async Task ListInfoTypesAsync_RequestObject()
        {
            // Snippet: ListInfoTypesAsync(ListInfoTypesRequest,CallSettings)
            // Create client
            DlpServiceClient dlpServiceClient = await DlpServiceClient.CreateAsync();

            // Initialize request argument(s)
            ListInfoTypesRequest request = new ListInfoTypesRequest
            {
                Category     = "PII",
                LanguageCode = "en",
            };
            // Make the request
            ListInfoTypesResponse response = await dlpServiceClient.ListInfoTypesAsync(request);

            // End snippet
        }