コード例 #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
 }
コード例 #2
0
 public void ListInfoTypes()
 {
     // Snippet: ListInfoTypes(string,string,CallSettings)
     // Create client
     DlpServiceClient dlpServiceClient = DlpServiceClient.Create();
     // Initialize request argument(s)
     string category     = "PII";
     string languageCode = "en";
     // Make the request
     ListInfoTypesResponse response = dlpServiceClient.ListInfoTypes(category, languageCode);
     // End snippet
 }
コード例 #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
        }
コード例 #4
0
        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();
        }
コード例 #5
0
        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();
        }
コード例 #6
0
        public async Task ListInfoTypesAsync()
        {
            // Snippet: ListInfoTypesAsync(string,string,CallSettings)
            // Additional: ListInfoTypesAsync(string,string,CancellationToken)
            // Create client
            DlpServiceClient dlpServiceClient = await DlpServiceClient.CreateAsync();

            // Initialize request argument(s)
            string category     = "PII";
            string languageCode = "en";
            // Make the request
            ListInfoTypesResponse response = await dlpServiceClient.ListInfoTypesAsync(category, languageCode);

            // End snippet
        }
コード例 #7
0
        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
        }