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

require 'oci'
require 'date'

# Create a default config using DEFAULT profile in default location
# Refer to https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File for more info
config = OCI::ConfigFileLoader.load_config

# Initialize service client with default config file
opsi_client = OCI::Opsi::OperationsInsightsClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
ingest_sql_plan_lines_response =
  opsi_client.ingest_sql_plan_lines(
    OCI::Opsi::Models::IngestSqlPlanLinesDetails.new(
      items: [
        OCI::Opsi::Models::SqlPlanLine.new(
          sql_identifier: 'EXAMPLE-sqlIdentifier-Value',
          plan_hash: 195,
          time_collected: DateTime.parse('2040-02-14T14:15:44.159Z'),
          operation: 'EXAMPLE-operation-Value',
          identifier: 97,
          version: 3884.5234,
          remark: 'EXAMPLE-remark-Value',
          options: 'EXAMPLE-options-Value',
          object_node: 'EXAMPLE-objectNode-Value',
          object_owner: 'EXAMPLE-objectOwner-Value',
          object_name: 'EXAMPLE-objectName-Value',
          object_alias: 'EXAMPLE-objectAlias-Value',
          object_instance: 527,
          object_type: 'EXAMPLE-objectType-Value',
          optimizer: 'EXAMPLE-optimizer-Value',
          search_columns: 421,
          parent_identifier: 593,
          depth: 82,
          position: 911,
          cost: 494,
          cardinality: 297,
          bytes: 54,
          other: 'EXAMPLE-other-Value',
          other_tag: 'EXAMPLE-otherTag-Value',
          partition_start: 'EXAMPLE-partitionStart-Value',
          partition_stop: 'EXAMPLE-partitionStop-Value',
          partition_identifier: 204,
          distribution: 'EXAMPLE-distribution-Value',
          cpu_cost: 317,
          io_cost: 900,
          temp_space: 993,
          access_predicates: 'EXAMPLE-accessPredicates-Value',
          filter_predicates: 'EXAMPLE-filterPredicates-Value',
          projection: 'EXAMPLE-projection-Value',
          qblock_name: 'EXAMPLE-qblockName-Value',
          elapsed_time_in_sec: 1693.6154,
          other_xml: 'EXAMPLE-otherXML-Value'
        )
      ]
    )
  )

# Get the data from response
puts "#{ingest_sql_plan_lines_response.data}"