Exemple #1
0
 /// <summary>Snippet for ReidentifyContent</summary>
 public void ReidentifyContent_RequestObject()
 {
     // Snippet: ReidentifyContent(ReidentifyContentRequest,CallSettings)
     // Create client
     DlpServiceClient dlpServiceClient = DlpServiceClient.Create();
     // Initialize request argument(s)
     ReidentifyContentRequest request = new ReidentifyContentRequest
     {
         ParentAsProjectName = new ProjectName("[PROJECT]"),
     };
     // Make the request
     ReidentifyContentResponse response = dlpServiceClient.ReidentifyContent(request);
     // End snippet
 }
        public async Task ReidentifyContentAsync()
        {
            Mock <DlpService.DlpServiceClient> mockGrpcClient = new Mock <DlpService.DlpServiceClient>(MockBehavior.Strict);
            ReidentifyContentRequest           request        = new ReidentifyContentRequest
            {
                ParentAsProjectName = new ProjectName("[PROJECT]"),
            };
            ReidentifyContentResponse expectedResponse = new ReidentifyContentResponse();

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

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

            // Initialize request argument(s)
            ReidentifyContentRequest request = new ReidentifyContentRequest
            {
                ParentAsProjectName = new ProjectName("[PROJECT]"),
            };
            // Make the request
            ReidentifyContentResponse response = await dlpServiceClient.ReidentifyContentAsync(request);

            // End snippet
        }
        public void ReidentifyContent()
        {
            Mock <DlpService.DlpServiceClient> mockGrpcClient = new Mock <DlpService.DlpServiceClient>(MockBehavior.Strict);
            ReidentifyContentRequest           request        = new ReidentifyContentRequest
            {
                ParentAsProjectName = new ProjectName("[PROJECT]"),
            };
            ReidentifyContentResponse expectedResponse = new ReidentifyContentResponse();

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

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }