# 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
loggingingestion_client =
  OCI::Loggingingestion::LoggingClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
put_logs_response =
  loggingingestion_client.put_logs(
    'ocid1.test.oc1..<unique_ID>EXAMPLE-logId-Value',
    OCI::Loggingingestion::Models::PutLogsDetails.new(
      specversion: 'EXAMPLE-specversion-Value',
      log_entry_batches: [
        OCI::Loggingingestion::Models::LogEntryBatch.new(
          entries: [
            OCI::Loggingingestion::Models::LogEntry.new(
              data: 'EXAMPLE-data-Value',
              id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value',
              time: DateTime.parse('2044-09-12T12:57:10.178Z')
            )
          ],
          source: 'EXAMPLE-source-Value',
          type: 'EXAMPLE-type-Value',
          defaultlogentrytime: DateTime.parse('2038-04-28T02:40:07.255Z'),
          subject: 'EXAMPLE-subject-Value'
        )
      ]
    )
  )

# Get the data from response
puts "#{put_logs_response.headers}"