// 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 ListIndicatorsExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var listIndicatorsRequest = new Oci.ThreatintelligenceService.Requests.ListIndicatorsRequest
{
CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
ThreatTypeName = new List<string>
{
"EXAMPLE--Value"
},
Type = Oci.ThreatintelligenceService.Models.IndicatorType.IpAddress,
Value = "EXAMPLE-value-Value",
ConfidenceGreaterThanOrEqualTo = 14,
TimeUpdatedGreaterThanOrEqualTo = DateTime.Parse("12/08/2037 12:10:14"),
TimeUpdatedLessThan = DateTime.Parse("05/17/2005 08:55:42"),
TimeLastSeenGreaterThanOrEqualTo = DateTime.Parse("09/09/2012 19:54:29"),
TimeLastSeenLessThan = DateTime.Parse("04/27/2040 08:24:03"),
TimeCreatedGreaterThanOrEqualTo = DateTime.Parse("09/14/2036 16:27:25"),
TimeCreatedLessThan = DateTime.Parse("09/10/2004 20:28:53"),
Limit = 16,
Page = "EXAMPLE-page-Value",
SortOrder = Oci.ThreatintelligenceService.Models.SortOrder.Desc,
SortBy = Oci.ThreatintelligenceService.Requests.ListIndicatorsRequest.SortByEnum.TimeUpdated,
OpcRequestId = "YCGAOX0JHMYEYDTV6SIP<unique_ID>"
};
// 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.ListIndicators(listIndicatorsRequest);
// Retrieve value from the response.
var itemsValue = response.IndicatorSummaryCollection.Items;
}
}
catch (Exception e)
{
Console.WriteLine($"ListIndicators Failed with {e.Message}");
throw e;
}
}
}
}