// 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 type_ interface{}
	type_ = "EXAMPLE-type-Value"
	var rootObjectDefaultValue interface{}
	rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
	req := dataintegration.UpdateTaskRequest{UpdateTaskDetails: dataintegration.UpdateTaskFromOciDataflowTask{OutputPorts: []dataintegration.OutputPort{dataintegration.OutputPort{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")},
		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_4oV2p": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
				RefValue:        &refValue,
				RootObjectValue: &rootObjectValue,
				StringValue:     common.String("EXAMPLE-stringValue-Value"),
				IntValue:        common.Int(849),
				ObjectValue:     &objectValue}}},
		Description:  common.String("EXAMPLE-description-Value"),
		ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
		ObjectStatus: common.Int(708),
		PortType:     dataintegration.OutputPortPortTypeModel}},
		ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
			RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
		ExecutorShapeDetails: &dataintegration.ShapeDetails{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_4lgXK": dataintegration.ConfigParameterValue{IntValue: common.Int(460),
			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"),
		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_6hskC": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
				RefValue:        &refValue,
				RootObjectValue: &rootObjectValue,
				StringValue:     common.String("EXAMPLE-stringValue-Value"),
				IntValue:        common.Int(116),
				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"),
		InputPorts: []dataintegration.InputPort{dataintegration.InputPort{Name: common.String("EXAMPLE-name-Value"),
			ObjectStatus: common.Int(547),
			Description:  common.String("EXAMPLE-description-Value"),
			Key:          common.String("EXAMPLE-key-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			PortType: dataintegration.InputPortPortTypeControl,
			ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_3oWIU": dataintegration.ConfigParameterValue{IntValue: common.Int(517),
				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")}},
			Fields: []dataintegration.TypedObject{dataintegration.MaterializedDynamicField{ObjectStatus: common.Int(270),
				Scope: common.String("EXAMPLE-scope-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_tT0KP": dataintegration.ConfigParameterValue{RefValue: &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(243),
						ObjectValue:     &objectValue,
						ParameterValue:  common.String("EXAMPLE-parameterValue-Value")}}},
				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")},
				Type: &dataintegration.MaterializedCompositeType{ConfigDefinition: &dataintegration.ConfigDefinition{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(951),
					ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
						Parent: common.String("EXAMPLE-parent-Value")},
					ConfigParameterDefinitions: map[string]dataintegration.ConfigParameterDefinition{"EXAMPLE_KEY_40sm6": dataintegration.ConfigParameterDefinition{Description: common.String("EXAMPLE-description-Value"),
						IsClassFieldValue: common.Bool(false),
						IsStatic:          common.Bool(false),
						ParameterName:     common.String("EXAMPLE-parameterName-Value"),
						ParameterType: dataintegration.MapType{ValueElementType: common.String("EXAMPLE-valueElementType-Value"),
							ContainsNull: common.Bool(true),
							ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
							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"),
							Key:            common.String("EXAMPLE-key-Value"),
							KeyElementType: common.String("EXAMPLE-keyElementType-Value"),
							Name:           common.String("EXAMPLE-name-Value"),
							ObjectStatus:   common.Int(980)},
						ClassFieldName: common.String("EXAMPLE-classFieldName-Value"),
						DefaultValue:   &defaultValue}},
					IsContained: common.Bool(false),
					Key:         common.String("EXAMPLE-key-Value")},
					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")},
					PathNames:    []string{"EXAMPLE--Value"},
					Elements:     []string{"EXAMPLE--Value"},
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(745)},
				Key: common.String("EXAMPLE-key-Value")}}}},
		OpConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_c4Wua": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
			IntValue:        common.Int(891),
			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")}},
		Parameters: []dataintegration.Parameter{dataintegration.Parameter{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")},
			DefaultValue: &defaultValue,
			Description:  common.String("EXAMPLE-description-Value"),
			ObjectStatus: common.Int(873),
			Type:         &type_,
			TypeName:     common.String("EXAMPLE-typeName-Value"),
			ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_wQjIi": dataintegration.ConfigParameterValue{IntValue: common.Int(857),
				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")}},
			IsInput:                common.Bool(true),
			Key:                    common.String("EXAMPLE-key-Value"),
			RootObjectDefaultValue: &rootObjectDefaultValue,
			IsOutput:               common.Bool(true),
			OutputAggregationType:  dataintegration.ParameterOutputAggregationTypeMax,
			UsedFor:                common.String("EXAMPLE-usedFor-Value")}},
		RegistryMetadata: &dataintegration.RegistryMetadata{AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
			IsFavorite:      common.Bool(false),
			Key:             common.String("EXAMPLE-key-Value"),
			Labels:          []string{"EXAMPLE--Value"},
			RegistryVersion: common.Int(488)},
		ObjectStatus:  common.Int(513),
		ObjectVersion: common.Int(500),
		Description:   common.String("EXAMPLE-description-Value"),
		DriverShapeDetails: &dataintegration.ShapeDetails{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_iUumS": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
			RefValue:        &refValue,
			RootObjectValue: &rootObjectValue,
			StringValue:     common.String("EXAMPLE-stringValue-Value"),
			IntValue:        common.Int(41),
			ObjectValue:     &objectValue}},
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}}},
		IsConcurrentAllowed: common.Bool(false),
		ModelVersion:        common.String("EXAMPLE-modelVersion-Value"),
		Name:                common.String("EXAMPLE-name-Value")},
		WorkspaceId:  common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value"),
		IfMatch:      common.String("EXAMPLE-ifMatch-Value"),
		OpcRequestId: common.String("CS7NAN9DDP1YNZFYCFCS<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)
}