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

package main

import (
	"context"
	"fmt"
	"time"

	"github.com/oracle/oci-go-sdk/v65/common"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
	"github.com/oracle/oci-go-sdk/v65/opsi"
)

func ExampleIngestSqlPlanLines() {
	// 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.
	client, err := opsi.NewOperationsInsightsClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

	// Create a request and dependent object(s).

	req := opsi.IngestSqlPlanLinesRequest{OpcRequestId: common.String("RXFTFYCO0CPRAYX1K41K<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		DatabaseId:    common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value"),
		Id:            common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value"),
		IfMatch:       common.String("EXAMPLE-ifMatch-Value"),
		IngestSqlPlanLinesDetails: opsi.IngestSqlPlanLinesDetails{Items: []opsi.SqlPlanLine{opsi.SqlPlanLine{OtherTag: common.String("EXAMPLE-otherTag-Value"),
			ParentIdentifier:    common.Int64(766),
			SearchColumns:       common.Int64(894),
			SqlIdentifier:       common.String("EXAMPLE-sqlIdentifier-Value"),
			TimeCollected:       &common.SDKTime{Time: time.Now()},
			TempSpace:           common.Int64(813),
			Cardinality:         common.Int64(76),
			Identifier:          common.Int64(22),
			ObjectName:          common.String("EXAMPLE-objectName-Value"),
			Operation:           common.String("EXAMPLE-operation-Value"),
			Cost:                common.Int64(333),
			FilterPredicates:    common.String("EXAMPLE-filterPredicates-Value"),
			IoCost:              common.Int64(151),
			ObjectInstance:      common.Int64(928),
			PlanHash:            common.Int64(713),
			Distribution:        common.String("EXAMPLE-distribution-Value"),
			ObjectAlias:         common.String("EXAMPLE-objectAlias-Value"),
			Optimizer:           common.String("EXAMPLE-optimizer-Value"),
			Options:             common.String("EXAMPLE-options-Value"),
			PartitionStart:      common.String("EXAMPLE-partitionStart-Value"),
			Version:             common.Float32(7651.434),
			ObjectNode:          common.String("EXAMPLE-objectNode-Value"),
			Position:            common.Int64(532),
			Projection:          common.String("EXAMPLE-projection-Value"),
			PartitionIdentifier: common.Int64(283),
			AccessPredicates:    common.String("EXAMPLE-accessPredicates-Value"),
			Bytes:               common.Int64(738),
			Depth:               common.Int64(229),
			ElapsedTimeInSec:    common.Float32(253.6881),
			ObjectType:          common.String("EXAMPLE-objectType-Value"),
			Other:               common.String("EXAMPLE-other-Value"),
			OtherXML:            common.String("EXAMPLE-otherXML-Value"),
			PartitionStop:       common.String("EXAMPLE-partitionStop-Value"),
			Remark:              common.String("EXAMPLE-remark-Value"),
			CpuCost:             common.Int64(156),
			ObjectOwner:         common.String("EXAMPLE-objectOwner-Value"),
			QblockName:          common.String("EXAMPLE-qblockName-Value")}}}}

	// Send the request using the service client
	resp, err := client.IngestSqlPlanLines(context.Background(), req)
	helpers.FatalIfError(err)

	// Retrieve value from the response.
	fmt.Println(resp)
}