/// <summary>Snippet for DeleteDlpJob</summary> public void DeleteDlpJob_RequestObject() { // Snippet: DeleteDlpJob(DeleteDlpJobRequest,CallSettings) // Create client DlpServiceClient dlpServiceClient = DlpServiceClient.Create(); // Initialize request argument(s) DeleteDlpJobRequest request = new DeleteDlpJobRequest { DlpJobName = new DlpJobName("[PROJECT]", "[DLP_JOB]"), }; // Make the request dlpServiceClient.DeleteDlpJob(request); // End snippet }
public async Task DeleteDlpJobAsync() { Mock <DlpService.DlpServiceClient> mockGrpcClient = new Mock <DlpService.DlpServiceClient>(MockBehavior.Strict); DeleteDlpJobRequest request = new DeleteDlpJobRequest { DlpJobName = new DlpJobName("[PROJECT]", "[DLP_JOB]"), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteDlpJobAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <Empty>(Task.FromResult(expectedResponse), null, null, null, null)); DlpServiceClient client = new DlpServiceClientImpl(mockGrpcClient.Object, null); await client.DeleteDlpJobAsync(request); mockGrpcClient.VerifyAll(); }
public void DeleteDlpJob() { Mock <DlpService.DlpServiceClient> mockGrpcClient = new Mock <DlpService.DlpServiceClient>(MockBehavior.Strict); DeleteDlpJobRequest request = new DeleteDlpJobRequest { DlpJobName = new DlpJobName("[PROJECT]", "[DLP_JOB]"), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteDlpJob(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); DlpServiceClient client = new DlpServiceClientImpl(mockGrpcClient.Object, null); client.DeleteDlpJob(request); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for DeleteDlpJobAsync</summary> public async Task DeleteDlpJobAsync_RequestObject() { // Snippet: DeleteDlpJobAsync(DeleteDlpJobRequest,CallSettings) // Additional: DeleteDlpJobAsync(DeleteDlpJobRequest,CancellationToken) // Create client DlpServiceClient dlpServiceClient = await DlpServiceClient.CreateAsync(); // Initialize request argument(s) DeleteDlpJobRequest request = new DeleteDlpJobRequest { DlpJobName = new DlpJobName("[PROJECT]", "[DLP_JOB]"), }; // Make the request await dlpServiceClient.DeleteDlpJobAsync(request); // End snippet }