# 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'

# 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
cims_client = OCI::Cims::IncidentClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
create_incident_response =
  cims_client.create_incident(
    OCI::Cims::Models::CreateIncident.new(
      compartment_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
      ticket:
        OCI::Cims::Models::CreateTicketDetails.new(
          severity: 'MEDIUM',
          title: 'EXAMPLE-title-Value',
          description: 'EXAMPLE-description-Value',
          resource_list: [
            OCI::Cims::Models::CreateResourceDetails.new(
              item:
                OCI::Cims::Models::CreateLimitItemDetails.new(
                  type: 'limit',
                  category:
                    OCI::Cims::Models::CreateCategoryDetails.new(
                      category_key: 'EXAMPLE-categoryKey-Value'
                    ),
                  sub_category:
                    OCI::Cims::Models::CreateSubCategoryDetails.new(
                      sub_category_key: 'EXAMPLE-subCategoryKey-Value'
                    ),
                  issue_type:
                    OCI::Cims::Models::CreateIssueTypeDetails.new(
                      issue_type_key: 'EXAMPLE-issueTypeKey-Value'
                    ),
                  name: 'EXAMPLE-name-Value',
                  current_limit: 446,
                  current_usage: 611,
                  requested_limit: 642,
                  limit_status: 'APPROVED'
                ),
              region: 'EXAMPLE-region-Value'
            )
          ],
          contextual_data:
            OCI::Cims::Models::ContextualData.new(
              client_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-clientId-Value',
              schema_name: 'EXAMPLE-schemaName-Value',
              schema_version: 'EXAMPLE-schemaVersion-Value',
              payload: 'EXAMPLE-payload-Value'
            )
        ),
      problem_type: 'TECH',
      csi: 'EXAMPLE-csi-Value',
      contacts: [
        OCI::Cims::Models::Contact.new(
          contact_name: 'EXAMPLE-contactName-Value',
          contact_email: 'EXAMPLE-contactEmail-Value',
          email: 'EXAMPLE-email-Value',
          contact_phone: 'EXAMPLE-contactPhone-Value',
          contact_type: 'SECONDARY'
        )
      ],
      referrer: 'EXAMPLE-referrer-Value'
    )
  )

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