// 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.OpsiService;
using Oci.Common;
using Oci.Common.Auth;

namespace Oci.Sdk.DotNet.Example.Opsi
{
    public class IngestSqlPlanLinesExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var ingestSqlPlanLinesDetails = new Oci.OpsiService.Models.IngestSqlPlanLinesDetails
			{
				Items = new List<Oci.OpsiService.Models.SqlPlanLine>
				{
					new Oci.OpsiService.Models.SqlPlanLine
					{
						Version = (float)2351.6743,
						SqlIdentifier = "EXAMPLE-sqlIdentifier-Value",
						PlanHash = 898,
						ForceMatchingSignature = "EXAMPLE-forceMatchingSignature-Value",
						TimeGenerated = DateTime.Parse("07/22/2001 23:32:39"),
						TimeCollected = DateTime.Parse("09/05/2048 03:07:50"),
						Operation = "EXAMPLE-operation-Value",
						Remark = "EXAMPLE-remark-Value",
						Options = "EXAMPLE-options-Value",
						ObjectNode = "EXAMPLE-objectNode-Value",
						ObjectOwner = "EXAMPLE-objectOwner-Value",
						ObjectName = "EXAMPLE-objectName-Value",
						ObjectAlias = "EXAMPLE-objectAlias-Value",
						ObjectInstance = 331,
						ObjectType = "EXAMPLE-objectType-Value",
						Optimizer = "EXAMPLE-optimizer-Value",
						SearchColumns = 547,
						Identifier = 621,
						ParentIdentifier = 770,
						Depth = 5,
						Position = 726,
						Cost = 90,
						Cardinality = 407,
						Bytes = 667,
						Other = "EXAMPLE-other-Value",
						OtherTag = "EXAMPLE-otherTag-Value",
						PartitionStart = "EXAMPLE-partitionStart-Value",
						PartitionStop = "EXAMPLE-partitionStop-Value",
						PartitionIdentifier = 782,
						Distribution = "EXAMPLE-distribution-Value",
						CpuCost = 372,
						IoCost = 913,
						TempSpace = 962,
						AccessPredicates = "EXAMPLE-accessPredicates-Value",
						FilterPredicates = "EXAMPLE-filterPredicates-Value",
						Projection = "EXAMPLE-projection-Value",
						QblockName = "EXAMPLE-qblockName-Value",
						ElapsedTimeInSec = (float)7264.506,
						OtherXML = "EXAMPLE-otherXML-Value"
					}
				}
			};
			var ingestSqlPlanLinesRequest = new Oci.OpsiService.Requests.IngestSqlPlanLinesRequest
			{
				IngestSqlPlanLinesDetails = ingestSqlPlanLinesDetails,
				CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
				DatabaseId = "ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value",
				Id = "ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
				OpcRequestId = "RIATUQKLWJZYYWAELQ23<unique_ID>",
				IfMatch = "EXAMPLE-ifMatch-Value",
				OpcRetryToken = "EXAMPLE-opcRetryToken-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 OperationsInsightsClient(provider, new ClientConfiguration()))
				{
					var response = await client.IngestSqlPlanLines(ingestSqlPlanLinesRequest);
					// Retrieve value from the response.
					var messageValue = response.IngestSqlPlanLinesResponseDetails.Message;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"IngestSqlPlanLines Failed with {e.Message}");
                throw e;
            }
        }

    }
}