// 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/common"
	"github.com/oracle/oci-go-sdk/v65/dataintegration"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
)

func ExampleCreateTask() {
	// 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 := dataintegration.NewDataIntegrationClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

	// Create a request and dependent object(s).
	var rootObjectValue interface{}
	rootObjectValue = "EXAMPLE-rootObjectValue-Value"
	var simpleValue interface{}
	simpleValue = "EXAMPLE-simpleValue-Value"
	var refValue interface{}
	refValue = "EXAMPLE-refValue-Value"
	var objectValue interface{}
	objectValue = "EXAMPLE-objectValue-Value"
	var operation interface{}
	operation = "EXAMPLE-operation-Value"
	var rootObjectDefaultValue interface{}
	rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	var type_ interface{}
	type_ = "EXAMPLE-type-Value"
	req := dataintegration.CreateTaskRequest{CreateTaskDetails: dataintegration.CreateTaskFromSqlTask{ConfigProviderDelegate: &dataintegration.CreateConfigProvider{Bindings: map[string]dataintegration.ParameterValue{"EXAMPLE_KEY_DQ51q": dataintegration.ParameterValue{RootObjectValue: &rootObjectValue,
		SimpleValue: &simpleValue}}},
		OpConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_Yu7rv": dataintegration.ConfigParameterValue{RefValue: &refValue,
			RootObjectValue: &rootObjectValue,
			StringValue:     common.String("EXAMPLE-stringValue-Value"),
			IntValue:        common.Int(637),
			ObjectValue:     &objectValue,
			ParameterValue:  common.String("EXAMPLE-parameterValue-Value")}},
			ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
				Parent: common.String("EXAMPLE-parent-Value")}},
		RegistryMetadata: &dataintegration.RegistryMetadata{Key: common.String("EXAMPLE-key-Value"),
			Labels:          []string{"EXAMPLE--Value"},
			RegistryVersion: common.Int(436),
			AggregatorKey:   common.String("EXAMPLE-aggregatorKey-Value"),
			IsFavorite:      common.Bool(false)},
		ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
		Operation:    &operation,
		OutputPorts: []dataintegration.OutputPort{dataintegration.OutputPort{Fields: []dataintegration.TypedObject{dataintegration.DerivedField{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_HCBFP": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
			StringValue:    common.String("EXAMPLE-stringValue-Value"),
			IntValue:       common.Int(564),
			ObjectValue:    &objectValue,
			ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
			RefValue:       &refValue}},
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
			Description: common.String("EXAMPLE-description-Value"),
			Expr: &dataintegration.Expression{ExprString: common.String("EXAMPLE-exprString-Value"),
				Key:          common.String("EXAMPLE-key-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(904),
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_LTByO": dataintegration.ConfigParameterValue{IntValue: common.Int(417),
					ObjectValue:     &objectValue,
					ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
					RefValue:        &refValue,
					RootObjectValue: &rootObjectValue,
					StringValue:     common.String("EXAMPLE-stringValue-Value")}},
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}}},
			IsUseInferredType: common.Bool(true),
			Key:               common.String("EXAMPLE-key-Value"),
			Labels:            []string{"EXAMPLE--Value"},
			ModelVersion:      common.String("EXAMPLE-modelVersion-Value"),
			Name:              common.String("EXAMPLE-name-Value"),
			ObjectStatus:      common.Int(189),
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			Type: common.String("EXAMPLE-type-Value")}},
			Key:  common.String("EXAMPLE-key-Value"),
			Name: common.String("EXAMPLE-name-Value"),
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			PortType: dataintegration.OutputPortPortTypeControl,
			ConfigValues: &dataintegration.ConfigValues{ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_OysNd": dataintegration.ConfigParameterValue{IntValue: common.Int(745),
					ObjectValue:     &objectValue,
					ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
					RefValue:        &refValue,
					RootObjectValue: &rootObjectValue,
					StringValue:     common.String("EXAMPLE-stringValue-Value")}}},
			Description:  common.String("EXAMPLE-description-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			ObjectStatus: common.Int(217)}},
		Name: common.String("EXAMPLE-name-Value"),
		Parameters: []dataintegration.Parameter{dataintegration.Parameter{Key: common.String("EXAMPLE-key-Value"),
			ObjectStatus: common.Int(804),
			ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_oxubz": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
				ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
				RefValue:        &refValue,
				RootObjectValue: &rootObjectValue,
				StringValue:     common.String("EXAMPLE-stringValue-Value"),
				IntValue:        common.Int(12)}},
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
			IsInput:                common.Bool(true),
			RootObjectDefaultValue: &rootObjectDefaultValue,
			DefaultValue:           &defaultValue,
			Description:            common.String("EXAMPLE-description-Value"),
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			TypeName:              common.String("EXAMPLE-typeName-Value"),
			IsOutput:              common.Bool(false),
			ModelVersion:          common.String("EXAMPLE-modelVersion-Value"),
			Name:                  common.String("EXAMPLE-name-Value"),
			OutputAggregationType: dataintegration.ParameterOutputAggregationTypeCount,
			Type:                  &type_,
			UsedFor:               common.String("EXAMPLE-usedFor-Value")}},
		Script: &dataintegration.Script{ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
			RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			Key:          common.String("EXAMPLE-key-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			ObjectStatus: common.Int(859)},
		Identifier: common.String("EXAMPLE-identifier-Value"),
		InputPorts: []dataintegration.InputPort{dataintegration.InputPort{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_1Kmru": dataintegration.ConfigParameterValue{IntValue: common.Int(870),
			ObjectValue:     &objectValue,
			ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
			RefValue:        &refValue,
			RootObjectValue: &rootObjectValue,
			StringValue:     common.String("EXAMPLE-stringValue-Value")}},
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
			ObjectStatus: common.Int(3),
			Key:          common.String("EXAMPLE-key-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			PortType:    dataintegration.InputPortPortTypeData,
			Description: common.String("EXAMPLE-description-Value"),
			Fields: []dataintegration.TypedObject{dataintegration.DynamicProxyField{Name: common.String("EXAMPLE-name-Value"),
				ObjectStatus: common.Int(595),
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				Description:  common.String("EXAMPLE-description-Value"),
				Labels:       []string{"EXAMPLE--Value"},
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				Type: dataintegration.MapType{ContainsNull: common.Bool(true),
					Description:      common.String("EXAMPLE-description-Value"),
					Key:              common.String("EXAMPLE-key-Value"),
					ModelVersion:     common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus:     common.Int(335),
					ValueElementType: common.String("EXAMPLE-valueElementType-Value"),
					KeyElementType:   common.String("EXAMPLE-keyElementType-Value"),
					Name:             common.String("EXAMPLE-name-Value"),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
				ConfigValues: &dataintegration.ConfigValues{ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_aMHqo": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
						StringValue:    common.String("EXAMPLE-stringValue-Value"),
						IntValue:       common.Int(988),
						ObjectValue:    &objectValue,
						ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
						RefValue:       &refValue}}},
				Key: common.String("EXAMPLE-key-Value")}}}},
		ObjectStatus: common.Int(92),
		ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
			RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
		SqlScriptType:       dataintegration.CreateTaskFromSqlTaskSqlScriptTypeSqlCode,
		Description:         common.String("EXAMPLE-description-Value"),
		IsConcurrentAllowed: common.Bool(false),
		Key:                 common.String("EXAMPLE-key-Value")},
		OpcRequestId:  common.String("0ABT87JQGVGXR7CCR4VJ<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		WorkspaceId:   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value")}

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

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