// 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{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{CpuCost: common.Int64(720),
			Options:                common.String("EXAMPLE-options-Value"),
			Projection:             common.String("EXAMPLE-projection-Value"),
			SqlIdentifier:          common.String("EXAMPLE-sqlIdentifier-Value"),
			FilterPredicates:       common.String("EXAMPLE-filterPredicates-Value"),
			ObjectOwner:            common.String("EXAMPLE-objectOwner-Value"),
			Optimizer:              common.String("EXAMPLE-optimizer-Value"),
			ObjectName:             common.String("EXAMPLE-objectName-Value"),
			QblockName:             common.String("EXAMPLE-qblockName-Value"),
			TimeGenerated:          &common.SDKTime{Time: time.Now()},
			ForceMatchingSignature: common.String("EXAMPLE-forceMatchingSignature-Value"),
			Identifier:             common.Int64(400),
			IoCost:                 common.Int64(296),
			ElapsedTimeInSec:       common.Float32(1208.775),
			ObjectInstance:         common.Int64(675),
			ParentIdentifier:       common.Int64(610),
			PartitionIdentifier:    common.Int64(148),
			Position:               common.Int64(643),
			Bytes:                  common.Int64(13),
			Cardinality:            common.Int64(509),
			Depth:                  common.Int64(661),
			SearchColumns:          common.Int64(540),
			Distribution:           common.String("EXAMPLE-distribution-Value"),
			PlanHash:               common.Int64(293),
			Remark:                 common.String("EXAMPLE-remark-Value"),
			PartitionStop:          common.String("EXAMPLE-partitionStop-Value"),
			TimeCollected:          &common.SDKTime{Time: time.Now()},
			Cost:                   common.Int64(776),
			ObjectAlias:            common.String("EXAMPLE-objectAlias-Value"),
			ObjectType:             common.String("EXAMPLE-objectType-Value"),
			PartitionStart:         common.String("EXAMPLE-partitionStart-Value"),
			TempSpace:              common.Int64(929),
			Operation:              common.String("EXAMPLE-operation-Value"),
			Other:                  common.String("EXAMPLE-other-Value"),
			OtherTag:               common.String("EXAMPLE-otherTag-Value"),
			Version:                common.Float32(5309.5234),
			AccessPredicates:       common.String("EXAMPLE-accessPredicates-Value"),
			ObjectNode:             common.String("EXAMPLE-objectNode-Value"),
			OtherXML:               common.String("EXAMPLE-otherXML-Value")}}},
		OpcRequestId: common.String("FWXCCVKVKR24RLICUC55<unique_ID>")}

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