// 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"

	"github.com/oracle/oci-go-sdk/v65/cims"
	"github.com/oracle/oci-go-sdk/v65/common"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
)

func ExampleCreateIncident() {
	// 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 := cims.NewIncidentClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

	// Create a request and dependent object(s).

	req := cims.CreateIncidentRequest{Domainid: common.String("EXAMPLE-domainid-Value"),
		Homeregion:      common.String("EXAMPLE-homeregion-Value"),
		Idtoken:         common.String("EXAMPLE-idtoken-Value"),
		Ocid:            common.String("EXAMPLE-ocid-Value"),
		OpcRequestId:    common.String("QAQSJADQM36JAMQW24JI<unique_ID>"),
		Bearertoken:     common.String("EXAMPLE-bearertoken-Value"),
		Bearertokentype: common.String("EXAMPLE-bearertokentype-Value"),
		CreateIncidentDetails: cims.CreateIncident{CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
			Contacts: []cims.Contact{cims.Contact{Email: common.String("EXAMPLE-email-Value"),
				ContactEmail: common.String("EXAMPLE-contactEmail-Value"),
				ContactName:  common.String("EXAMPLE-contactName-Value"),
				ContactPhone: common.String("EXAMPLE-contactPhone-Value"),
				ContactType:  cims.ContactContactTypeManager}},
			Csi:         common.String("EXAMPLE-csi-Value"),
			ProblemType: cims.ProblemTypeTech,
			Referrer:    common.String("EXAMPLE-referrer-Value"),
			Ticket: &cims.CreateTicketDetails{ContextualData: &cims.ContextualData{ClientId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-clientId-Value"),
				Payload:       common.String("EXAMPLE-payload-Value"),
				SchemaName:    common.String("EXAMPLE-schemaName-Value"),
				SchemaVersion: common.String("EXAMPLE-schemaVersion-Value")},
				Description: common.String("EXAMPLE-description-Value"),
				ResourceList: []cims.CreateResourceDetails{cims.CreateResourceDetails{Item: cims.CreateAccountItemDetails{IssueType: &cims.CreateIssueTypeDetails{IssueTypeKey: common.String("EXAMPLE-issueTypeKey-Value")},
					Name:        common.String("EXAMPLE-name-Value"),
					SubCategory: &cims.CreateSubCategoryDetails{SubCategoryKey: common.String("EXAMPLE-subCategoryKey-Value")},
					Category:    &cims.CreateCategoryDetails{CategoryKey: common.String("EXAMPLE-categoryKey-Value")}},
					Region: common.String("EXAMPLE-region-Value")}},
				Severity: cims.CreateTicketDetailsSeverityHighest,
				Title:    common.String("EXAMPLE-title-Value")}}}

	// Send the request using the service client
	resp, err := client.CreateIncident(context.Background(), req)
	helpers.FatalIfError(err)

	// Retrieve value from the response.
	fmt.Println(resp)
}