# 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 'date'
require 'oci'

# 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
demand_signal_client =
  OCI::DemandSignal::OccDemandSignalClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
create_occ_demand_signal_response =
  demand_signal_client.create_occ_demand_signal(
    OCI::DemandSignal::Models::CreateOccDemandSignalDetails.new(
      occ_demand_signals: [
        OCI::DemandSignal::Models::OccDemandSignalData.new(
          resource_type: 'EXAMPLE-resourceType-Value',
          units: 'EXAMPLE-units-Value',
          values: [
            OCI::DemandSignal::Models::OccDemandSignalValue.new(
              time_expected: DateTime.parse('2042-08-21T14:34:49.771Z'),
              value: 5477.221,
              comments: 'EXAMPLE-comments-Value'
            )
          ]
        )
      ],
      is_active: true,
      compartment_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
      display_name: 'EXAMPLE-displayName-Value',
      freeform_tags: {
        'EXAMPLE_KEY_uGgIw' => 'EXAMPLE_VALUE_YitwO6BWMLKQn4Py16i6'
      },
      defined_tags: {
        'EXAMPLE_KEY_TPeNM' => { 'EXAMPLE_KEY_dI3iE' => 'EXAMPLE--Value' }
      }
    )
  )

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