/// <summary>Snippet for RedactContent</summary> public void RedactContent_RequestObject() { // Snippet: RedactContent(RedactContentRequest,CallSettings) // Create client DlpServiceClient dlpServiceClient = DlpServiceClient.Create(); // Initialize request argument(s) RedactContentRequest request = new RedactContentRequest { InspectConfig = new InspectConfig { InfoTypes = { new InfoType { Name = "EMAIL_ADDRESS", }, }, }, Items = { new ContentItem { Type = "text/plain", Value = "My email is [email protected].", }, }, }; // Make the request RedactContentResponse response = dlpServiceClient.RedactContent(request); // End snippet }
/// <summary>Snippet for RedactContent</summary> public void RedactContent2() { // Snippet: RedactContent(InspectConfig,IEnumerable<ContentItem>,IEnumerable<RedactContentRequest.Types.ImageRedactionConfig>,CallSettings) // Create client DlpServiceClient dlpServiceClient = DlpServiceClient.Create(); // Initialize request argument(s) InspectConfig inspectConfig = new InspectConfig { InfoTypes = { new InfoType { Name = "EMAIL_ADDRESS", }, }, }; IEnumerable <ContentItem> items = new[] { new ContentItem { Type = "text/plain", Value = "My email is [email protected].", }, }; IEnumerable <RedactContentRequest.Types.ImageRedactionConfig> imageRedactionConfigs = new List <RedactContentRequest.Types.ImageRedactionConfig>(); // Make the request RedactContentResponse response = dlpServiceClient.RedactContent(inspectConfig, items, imageRedactionConfigs); // End snippet }
public void RedactContent() { // Snippet: RedactContent(InspectConfig,IEnumerable<ContentItem>,IEnumerable<RedactContentRequest.Types.ReplaceConfig>,CallSettings) // Create client DlpServiceClient dlpServiceClient = DlpServiceClient.Create(); // Initialize request argument(s) InspectConfig inspectConfig = new InspectConfig(); IEnumerable <ContentItem> items = new List <ContentItem>(); IEnumerable <RedactContentRequest.Types.ReplaceConfig> replaceConfigs = new List <RedactContentRequest.Types.ReplaceConfig>(); // Make the request RedactContentResponse response = dlpServiceClient.RedactContent(inspectConfig, items, replaceConfigs); // End snippet }
public async Task RedactContentAsync() { // Snippet: RedactContentAsync(InspectConfig,IEnumerable<ContentItem>,IEnumerable<RedactContentRequest.Types.ReplaceConfig>,CallSettings) // Additional: RedactContentAsync(InspectConfig,IEnumerable<ContentItem>,IEnumerable<RedactContentRequest.Types.ReplaceConfig>,CancellationToken) // Create client DlpServiceClient dlpServiceClient = await DlpServiceClient.CreateAsync(); // Initialize request argument(s) InspectConfig inspectConfig = new InspectConfig(); IEnumerable <ContentItem> items = new List <ContentItem>(); IEnumerable <RedactContentRequest.Types.ReplaceConfig> replaceConfigs = new List <RedactContentRequest.Types.ReplaceConfig>(); // Make the request RedactContentResponse response = await dlpServiceClient.RedactContentAsync(inspectConfig, items, replaceConfigs); // End snippet }
public void RedactContent_RequestObject() { // Snippet: RedactContent(RedactContentRequest,CallSettings) // Create client DlpServiceClient dlpServiceClient = DlpServiceClient.Create(); // Initialize request argument(s) RedactContentRequest request = new RedactContentRequest { InspectConfig = new InspectConfig(), Items = { }, ReplaceConfigs = { }, }; // Make the request RedactContentResponse response = dlpServiceClient.RedactContent(request); // End snippet }
public async Task RedactContentAsync_RequestObject() { // Snippet: RedactContentAsync(RedactContentRequest,CallSettings) // Create client DlpServiceClient dlpServiceClient = await DlpServiceClient.CreateAsync(); // Initialize request argument(s) RedactContentRequest request = new RedactContentRequest { InspectConfig = new InspectConfig { InfoTypes = { new InfoType { Name = "EMAIL_ADDRESS", }, }, }, Items = { new ContentItem { Type = "text/plain", Value = "My email is [email protected].", }, }, ReplaceConfigs = { new RedactContentRequest.Types.ReplaceConfig { InfoType = new InfoType { Name = "EMAIL_ADDRESS", }, ReplaceWith = "REDACTED", }, }, }; // Make the request RedactContentResponse response = await dlpServiceClient.RedactContentAsync(request); // End snippet }
public async Task RedactContentAsync() { // Snippet: RedactContentAsync(InspectConfig,IEnumerable<ContentItem>,IEnumerable<RedactContentRequest.Types.ReplaceConfig>,CallSettings) // Additional: RedactContentAsync(InspectConfig,IEnumerable<ContentItem>,IEnumerable<RedactContentRequest.Types.ReplaceConfig>,CancellationToken) // Create client DlpServiceClient dlpServiceClient = await DlpServiceClient.CreateAsync(); // Initialize request argument(s) InspectConfig inspectConfig = new InspectConfig { InfoTypes = { new InfoType { Name = "EMAIL_ADDRESS", }, }, }; IEnumerable <ContentItem> items = new[] { new ContentItem { Type = "text/plain", Value = "My email is [email protected].", }, }; IEnumerable <RedactContentRequest.Types.ReplaceConfig> replaceConfigs = new[] { new RedactContentRequest.Types.ReplaceConfig { InfoType = new InfoType { Name = "EMAIL_ADDRESS", }, ReplaceWith = "REDACTED", }, }; // Make the request RedactContentResponse response = await dlpServiceClient.RedactContentAsync(inspectConfig, items, replaceConfigs); // End snippet }