// 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).

import * as opsi from "oci-opsi";
import common = require("oci-common");

// 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.

const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();

(async () => {
    try {
     // Create a service client
     const client = new opsi.OperationsInsightsClient({ authenticationDetailsProvider: provider });

     // Create a request and dependent object(s).
	const  ingestSqlPlanLinesDetails = {
		items: [{
				version: 7459.838,
				sqlIdentifier: "EXAMPLE-sqlIdentifier-Value",
				planHash: 504,
				forceMatchingSignature: "EXAMPLE-forceMatchingSignature-Value",
				timeGenerated: new Date("Mon Apr 23 15:33:00 UTC 2001"),
				timeCollected: new Date("Mon Jan 29 04:49:35 UTC 2035"),
				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: 640,
				objectType: "EXAMPLE-objectType-Value",
				optimizer: "EXAMPLE-optimizer-Value",
				searchColumns: 726,
				identifier: 406,
				parentIdentifier: 261,
				depth: 2,
				position: 105,
				cost: 816,
				cardinality: 792,
				bytes: 296,
				other: "EXAMPLE-other-Value",
				otherTag: "EXAMPLE-otherTag-Value",
				partitionStart: "EXAMPLE-partitionStart-Value",
				partitionStop: "EXAMPLE-partitionStop-Value",
				partitionIdentifier: 630,
				distribution: "EXAMPLE-distribution-Value",
				cpuCost: 508,
				ioCost: 588,
				tempSpace: 948,
				accessPredicates: "EXAMPLE-accessPredicates-Value",
				filterPredicates: "EXAMPLE-filterPredicates-Value",
				projection: "EXAMPLE-projection-Value",
				qblockName: "EXAMPLE-qblockName-Value",
				elapsedTimeInSec: 8347.631,
				otherXML: "EXAMPLE-otherXML-Value",

				}
				],

		}

	const ingestSqlPlanLinesRequest: opsi.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: "NQBTBH5MZ8Q6LU8GJKMR<unique_ID>",
	ifMatch: "EXAMPLE-ifMatch-Value",
	opcRetryToken: "EXAMPLE-opcRetryToken-Value",

		}; 


     // Send request to the Client.
     const ingestSqlPlanLinesResponse = await client.ingestSqlPlanLines(ingestSqlPlanLinesRequest);
     }
     catch (error) {
         console.log("ingestSqlPlanLines Failed with error  " + error);
     }
})();