// 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 ExampleUpdateTask() {
	// 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 refValue interface{}
	refValue = "EXAMPLE-refValue-Value"
	var rootObjectValue interface{}
	rootObjectValue = "EXAMPLE-rootObjectValue-Value"
	var objectValue interface{}
	objectValue = "EXAMPLE-objectValue-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	var wrappedType interface{}
	wrappedType = "EXAMPLE-wrappedType-Value"
	var type_ interface{}
	type_ = "EXAMPLE-type-Value"
	var rootObjectDefaultValue interface{}
	rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
	req := dataintegration.UpdateTaskRequest{UpdateTaskDetails: dataintegration.UpdateTaskFromOciDataflowTask{DataflowApplication: &dataintegration.DataflowApplication{ApplicationId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-applicationId-Value"),
		CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_U4ZDJ": dataintegration.ConfigParameterValue{RefValue: &refValue,
			RootObjectValue: &rootObjectValue,
			StringValue:     common.String("EXAMPLE-stringValue-Value"),
			IntValue:        common.Int(33),
			ObjectValue:     &objectValue,
			ParameterValue:  common.String("EXAMPLE-parameterValue-Value")}},
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}}},
		DriverShapeDetails: &dataintegration.ShapeDetails{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_m118G": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
			RefValue:        &refValue,
			RootObjectValue: &rootObjectValue,
			StringValue:     common.String("EXAMPLE-stringValue-Value"),
			IntValue:        common.Int(775),
			ObjectValue:     &objectValue}},
			ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
				Parent: common.String("EXAMPLE-parent-Value")}}},
		ObjectStatus: common.Int(909),
		OpConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_asHvv": dataintegration.ConfigParameterValue{IntValue: common.Int(862),
			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")}},
		InputPorts: []dataintegration.InputPort{dataintegration.InputPort{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_TpFs4": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
			ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
			RefValue:        &refValue,
			RootObjectValue: &rootObjectValue,
			StringValue:     common.String("EXAMPLE-stringValue-Value"),
			IntValue:        common.Int(990)}},
			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"),
			Fields: []dataintegration.TypedObject{dataintegration.PivotField{ObjectStatus: common.Int(618),
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				UseType: &dataintegration.ConfiguredType{ConfigDefinition: &dataintegration.ConfigDefinition{ConfigParameterDefinitions: map[string]dataintegration.ConfigParameterDefinition{"EXAMPLE_KEY_7ywY6": dataintegration.ConfigParameterDefinition{IsClassFieldValue: common.Bool(false),
					IsStatic:      common.Bool(true),
					ParameterName: common.String("EXAMPLE-parameterName-Value"),
					ParameterType: dataintegration.DerivedType{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						Name:         common.String("EXAMPLE-name-Value"),
						ObjectStatus: common.Int(58),
						ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
							Parent: common.String("EXAMPLE-parent-Value")},
						Description: common.String("EXAMPLE-description-Value"),
						Key:         common.String("EXAMPLE-key-Value")},
					ClassFieldName: common.String("EXAMPLE-classFieldName-Value"),
					DefaultValue:   &defaultValue,
					Description:    common.String("EXAMPLE-description-Value")}},
					IsContained:  common.Bool(true),
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(45),
					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"),
					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{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_uzCt7": dataintegration.ConfigParameterValue{IntValue: common.Int(901),
						ObjectValue:     &objectValue,
						ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value")}},
						ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
							Parent: common.String("EXAMPLE-parent-Value")}},
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(69),
					WrappedType:  &wrappedType},
				ColumnNamePattern: common.String("EXAMPLE-columnNamePattern-Value"),
				Key:               common.String("EXAMPLE-key-Value"),
				ModelVersion:      common.String("EXAMPLE-modelVersion-Value"),
				Name:              common.String("EXAMPLE-name-Value"),
				Type: dataintegration.MapType{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ValueElementType: common.String("EXAMPLE-valueElementType-Value"),
					ContainsNull:     common.Bool(true),
					Description:      common.String("EXAMPLE-description-Value"),
					Key:              common.String("EXAMPLE-key-Value"),
					KeyElementType:   common.String("EXAMPLE-keyElementType-Value"),
					Name:             common.String("EXAMPLE-name-Value"),
					ObjectStatus:     common.Int(219),
					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_v8p5N": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
					StringValue:    common.String("EXAMPLE-stringValue-Value"),
					IntValue:       common.Int(852),
					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{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(61),
					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_XWptO": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(643),
						ObjectValue:     &objectValue}},
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
					ExprString: common.String("EXAMPLE-exprString-Value"),
					Key:        common.String("EXAMPLE-key-Value")}}},
			Key:          common.String("EXAMPLE-key-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			ObjectStatus: common.Int(408),
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			PortType: dataintegration.InputPortPortTypeData}},
		Key:          common.String("EXAMPLE-key-Value"),
		ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
		Name:         common.String("EXAMPLE-name-Value"),
		OutputPorts: []dataintegration.OutputPort{dataintegration.OutputPort{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_l1Afq": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
			IntValue:        common.Int(0),
			ObjectValue:     &objectValue,
			ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
			RefValue:        &refValue,
			RootObjectValue: &rootObjectValue}},
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-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.OutputPortPortTypeControl,
			Description: common.String("EXAMPLE-description-Value"),
			Fields: []dataintegration.TypedObject{dataintegration.OutputField{Labels: []string{"EXAMPLE--Value"},
				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"),
				Description:  common.String("EXAMPLE-description-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				Name:         common.String("EXAMPLE-name-Value"),
				ObjectStatus: common.Int(624),
				Type: dataintegration.MaterializedCompositeType{Description: common.String("EXAMPLE-description-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")},
					ConfigDefinition: &dataintegration.ConfigDefinition{ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						ConfigParameterDefinitions: map[string]dataintegration.ConfigParameterDefinition{"EXAMPLE_KEY_SnrAW": dataintegration.ConfigParameterDefinition{IsStatic: common.Bool(false),
							ParameterName:     common.String("EXAMPLE-parameterName-Value"),
							ClassFieldName:    common.String("EXAMPLE-classFieldName-Value"),
							DefaultValue:      &defaultValue,
							Description:       common.String("EXAMPLE-description-Value"),
							IsClassFieldValue: common.Bool(true)}},
						IsContained:  common.Bool(true),
						Key:          common.String("EXAMPLE-key-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						Name:         common.String("EXAMPLE-name-Value"),
						ObjectStatus: common.Int(483)},
					Elements:     []string{"EXAMPLE--Value"},
					Key:          common.String("EXAMPLE-key-Value"),
					ObjectStatus: common.Int(447),
					PathNames:    []string{"EXAMPLE--Value"}},
				ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_2ucsp": dataintegration.ConfigParameterValue{IntValue: common.Int(187),
					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")}}}},
			Key:          common.String("EXAMPLE-key-Value"),
			ObjectStatus: common.Int(342)}},
		Parameters: []dataintegration.Parameter{dataintegration.Parameter{IsInput: common.Bool(true),
			ObjectStatus:          common.Int(318),
			OutputAggregationType: dataintegration.ParameterOutputAggregationTypeMax,
			ModelVersion:          common.String("EXAMPLE-modelVersion-Value"),
			Type:                  &type_,
			ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_Kbzb1": dataintegration.ConfigParameterValue{RefValue: &refValue,
				RootObjectValue: &rootObjectValue,
				StringValue:     common.String("EXAMPLE-stringValue-Value"),
				IntValue:        common.Int(0),
				ObjectValue:     &objectValue,
				ParameterValue:  common.String("EXAMPLE-parameterValue-Value")}},
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
			DefaultValue: &defaultValue,
			IsOutput:     common.Bool(true),
			Key:          common.String("EXAMPLE-key-Value"),
			TypeName:     common.String("EXAMPLE-typeName-Value"),
			UsedFor:      common.String("EXAMPLE-usedFor-Value"),
			Description:  common.String("EXAMPLE-description-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
				Parent: common.String("EXAMPLE-parent-Value")},
			RootObjectDefaultValue: &rootObjectDefaultValue}},
		ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
			RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
		RegistryMetadata: &dataintegration.RegistryMetadata{AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
			IsFavorite:      common.Bool(true),
			Key:             common.String("EXAMPLE-key-Value"),
			Labels:          []string{"EXAMPLE--Value"},
			RegistryVersion: common.Int(251)},
		Description: common.String("EXAMPLE-description-Value"),
		ExecutorShapeDetails: &dataintegration.ShapeDetails{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_IOKsT": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
			RefValue:        &refValue,
			RootObjectValue: &rootObjectValue,
			StringValue:     common.String("EXAMPLE-stringValue-Value"),
			IntValue:        common.Int(717),
			ObjectValue:     &objectValue}},
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}}},
		Identifier:          common.String("EXAMPLE-identifier-Value"),
		IsConcurrentAllowed: common.Bool(true),
		ObjectVersion:       common.Int(518)},
		WorkspaceId:  common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value"),
		IfMatch:      common.String("EXAMPLE-ifMatch-Value"),
		OpcRequestId: common.String("Z8DBISPEUO7DMNUJSVOO<unique_ID>"),
		TaskKey:      common.String("EXAMPLE-taskKey-Value")}

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

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