// 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)8551.112,
						SqlIdentifier = "EXAMPLE-sqlIdentifier-Value",
						PlanHash = 644,
						ForceMatchingSignature = "EXAMPLE-forceMatchingSignature-Value",
						TimeGenerated = DateTime.Parse("08/13/2042 00:14:20"),
						TimeCollected = DateTime.Parse("02/08/2022 03:54:54"),
						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 = 560,
						ObjectType = "EXAMPLE-objectType-Value",
						Optimizer = "EXAMPLE-optimizer-Value",
						SearchColumns = 383,
						Identifier = 728,
						ParentIdentifier = 635,
						Depth = 838,
						Position = 604,
						Cost = 72,
						Cardinality = 311,
						Bytes = 884,
						Other = "EXAMPLE-other-Value",
						OtherTag = "EXAMPLE-otherTag-Value",
						PartitionStart = "EXAMPLE-partitionStart-Value",
						PartitionStop = "EXAMPLE-partitionStop-Value",
						PartitionIdentifier = 915,
						Distribution = "EXAMPLE-distribution-Value",
						CpuCost = 767,
						IoCost = 609,
						TempSpace = 436,
						AccessPredicates = "EXAMPLE-accessPredicates-Value",
						FilterPredicates = "EXAMPLE-filterPredicates-Value",
						Projection = "EXAMPLE-projection-Value",
						QblockName = "EXAMPLE-qblockName-Value",
						ElapsedTimeInSec = (float)5932.7793,
						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 = "2NVYPWQ2FIUMASUUM66X<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;
            }
        }

    }
}