// This is an automatically generated code sample.
// To make this code sample work in your Oracle Cloud tenancy,
// please replace the values for any parameters whose current values do not fit
// your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
// boolean, number, and enum parameters with values not fitting your use case).
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Oci.ThreatintelligenceService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Threatintelligence
{
public class SummarizeIndicatorsExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var summarizeIndicatorsDetails = new Oci.ThreatintelligenceService.Models.SummarizeIndicatorsDetails
{
IndicatorType = Oci.ThreatintelligenceService.Models.IndicatorType.FileName,
IndicatorValue = "EXAMPLE-indicatorValue-Value",
ThreatTypes = new List<string>
{
"EXAMPLE--Value"
},
ConfidenceGreaterThanOrEqualTo = 25,
TimeUpdatedGreaterThanOrEqualTo = DateTime.Parse("03/01/2040 13:19:25"),
TimeUpdatedLessThan = DateTime.Parse("11/04/2016 12:44:20"),
TimeLastSeenGreaterThanOrEqualTo = DateTime.Parse("08/11/2001 20:45:29"),
TimeLastSeenLessThan = DateTime.Parse("06/27/2029 23:20:56"),
TimeCreatedGreaterThanOrEqualTo = DateTime.Parse("09/27/2014 08:22:02"),
TimeCreatedLessThan = DateTime.Parse("12/09/2041 12:36:05"),
IndicatorSeenBy = "EXAMPLE-indicatorSeenBy-Value",
Malware = "EXAMPLE-malware-Value",
ThreatActor = "EXAMPLE-threatActor-Value",
SortOrder = Oci.ThreatintelligenceService.Models.SortOrder.Asc,
SortBy = Oci.ThreatintelligenceService.Models.SummarizeIndicatorsDetails.SortByEnum.Confidence
};
var summarizeIndicatorsRequest = new Oci.ThreatintelligenceService.Requests.SummarizeIndicatorsRequest
{
CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
SummarizeIndicatorsDetails = summarizeIndicatorsDetails,
OpcRequestId = "PQQJKXCSJQ2YEPZIJUSM<unique_ID>",
Limit = 376,
Page = "EXAMPLE-page-Value"
};
// Create a default authentication provider that uses the DEFAULT
// profile in the configuration file.
// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
var provider = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
try
{
// Create a service client and send the request.
using (var client = new ThreatintelClient(provider, new ClientConfiguration()))
{
var response = await client.SummarizeIndicators(summarizeIndicatorsRequest);
// Retrieve value from the response.
var itemsValue = response.IndicatorSummaryCollection.Items;
}
}
catch (Exception e)
{
Console.WriteLine($"SummarizeIndicators Failed with {e.Message}");
throw e;
}
}
}
}