// 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 headers interface{}
	headers = "EXAMPLE-headers-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	var rootObjectDefaultValue interface{}
	rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
	var type_ interface{}
	type_ = "EXAMPLE-type-Value"
	req := dataintegration.UpdateTaskRequest{TaskKey: common.String("EXAMPLE-taskKey-Value"),
		UpdateTaskDetails: dataintegration.UpdateTaskFromRestTask{AdditionalProperties: common.String("EXAMPLE-additionalProperties-Value"),
			MethodType: dataintegration.UpdateTaskFromRestTaskMethodTypeGet,
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			AuthConfig: dataintegration.ResourcePrincipalAuthConfig{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")},
				ResourcePrincipalSource: dataintegration.ResourcePrincipalAuthConfigResourcePrincipalSourceWorkspace,
				Key:                     common.String("EXAMPLE-key-Value")},
			Endpoint: &dataintegration.Expression{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_BvYt3": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
					RefValue:        &refValue,
					RootObjectValue: &rootObjectValue,
					StringValue:     common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(557),
					ObjectValue:     &objectValue}},
					ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
						Parent: common.String("EXAMPLE-parent-Value")}},
				ExprString:   common.String("EXAMPLE-exprString-Value"),
				Key:          common.String("EXAMPLE-key-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(177)},
			Headers:     &headers,
			ApiCallMode: dataintegration.UpdateTaskFromRestTaskApiCallModeAsyncOciWorkrequest,
			AuthDetails: &dataintegration.AuthDetails{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")},
				Key: common.String("EXAMPLE-key-Value")},
			Identifier:          common.String("EXAMPLE-identifier-Value"),
			IsConcurrentAllowed: common.Bool(false),
			ObjectVersion:       common.Int(387),
			OpConfigValues: &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_vdQww": dataintegration.ConfigParameterValue{RefValue: &refValue,
					RootObjectValue: &rootObjectValue,
					StringValue:     common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(717),
					ObjectValue:     &objectValue,
					ParameterValue:  common.String("EXAMPLE-parameterValue-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(322)},
			TypedExpressions: []dataintegration.TypedExpression{dataintegration.TypedExpression{Description: common.String("EXAMPLE-description-Value"),
				Key: common.String("EXAMPLE-key-Value"),
				ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_vlfo1": dataintegration.ConfigParameterValue{IntValue: common.Int(954),
					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")}},
				Expression:   common.String("EXAMPLE-expression-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				Name:         common.String("EXAMPLE-name-Value"),
				ObjectStatus: common.Int(788),
				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")}},
			CancelMethodType: dataintegration.UpdateTaskFromRestTaskCancelMethodTypePut,
			Description:      common.String("EXAMPLE-description-Value"),
			ExecuteRestCallConfig: &dataintegration.ExecuteRestCallConfig{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_htqSI": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
				StringValue:    common.String("EXAMPLE-stringValue-Value"),
				IntValue:       common.Int(756),
				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")}},
				MethodType:     dataintegration.ExecuteRestCallConfigMethodTypePatch,
				RequestHeaders: map[string]string{"EXAMPLE_KEY_itA1o": "EXAMPLE_VALUE_BpeowZnwmh3iebr1bs3Q"}},
			CancelRestCallConfig: &dataintegration.CancelRestCallConfig{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_ImfrQ": dataintegration.ConfigParameterValue{IntValue: common.Int(926),
				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")}},
				MethodType:     dataintegration.CancelRestCallConfigMethodTypePut,
				RequestHeaders: map[string]string{"EXAMPLE_KEY_0YVCx": "EXAMPLE_VALUE_24Hk25lmf9Zr7qlQFgTH"}},
			InputPorts: []dataintegration.InputPort{dataintegration.InputPort{Description: common.String("EXAMPLE-description-Value"),
				ObjectStatus: common.Int(340),
				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_3LFBl": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(351),
					ObjectValue:     &objectValue,
					ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
					RefValue:        &refValue,
					RootObjectValue: &rootObjectValue}},
					ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
						Parent: common.String("EXAMPLE-parent-Value")}},
				Fields: []dataintegration.TypedObject{dataintegration.TypedExpression{Expression: common.String("EXAMPLE-expression-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(984),
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_DSPKH": dataintegration.ConfigParameterValue{IntValue: common.Int(915),
						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")}},
					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")},
					Type: common.String("EXAMPLE-type-Value")}},
				Key:          common.String("EXAMPLE-key-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				Name:         common.String("EXAMPLE-name-Value"),
				PortType:     dataintegration.InputPortPortTypeModel}},
			PollRestCallConfig: &dataintegration.PollRestCallConfig{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_BTQjT": dataintegration.ConfigParameterValue{RefValue: &refValue,
				RootObjectValue: &rootObjectValue,
				StringValue:     common.String("EXAMPLE-stringValue-Value"),
				IntValue:        common.Int(193),
				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")}},
				MethodType:     dataintegration.PollRestCallConfigMethodTypePut,
				RequestHeaders: map[string]string{"EXAMPLE_KEY_TkFLc": "EXAMPLE_VALUE_WBvG82MfaBMZjTp2M8Og"}},
			Key:          common.String("EXAMPLE-key-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			ObjectStatus: common.Int(965),
			CancelEndpoint: &dataintegration.Expression{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(403),
				ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
					Parent: common.String("EXAMPLE-parent-Value")},
				ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_eIG9k": dataintegration.ConfigParameterValue{IntValue: common.Int(653),
					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")}},
				ExprString: common.String("EXAMPLE-exprString-Value"),
				Key:        common.String("EXAMPLE-key-Value")},
			JsonData:     common.String("EXAMPLE-jsonData-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			OutputPorts: []dataintegration.OutputPort{dataintegration.OutputPort{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_4wjDZ": dataintegration.ConfigParameterValue{IntValue: common.Int(254),
				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")}},
				Description:  common.String("EXAMPLE-description-Value"),
				Name:         common.String("EXAMPLE-name-Value"),
				ObjectStatus: common.Int(158),
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				PortType: dataintegration.OutputPortPortTypeControl,
				Fields: []dataintegration.TypedObject{dataintegration.DynamicInputField{Type: dataintegration.CompositeType{Key: common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(380),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					ConfigDefinition: &dataintegration.ConfigDefinition{Key: common.String("EXAMPLE-key-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						Name:         common.String("EXAMPLE-name-Value"),
						ObjectStatus: common.Int(788),
						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_mcZxF": dataintegration.ConfigParameterDefinition{ClassFieldName: common.String("EXAMPLE-classFieldName-Value"),
							DefaultValue:      &defaultValue,
							Description:       common.String("EXAMPLE-description-Value"),
							IsClassFieldValue: common.Bool(false),
							IsStatic:          common.Bool(true),
							ParameterName:     common.String("EXAMPLE-parameterName-Value")}},
						IsContained: common.Bool(false)},
					Description: common.String("EXAMPLE-description-Value")},
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_TqQ7f": dataintegration.ConfigParameterValue{IntValue: common.Int(825),
						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")}},
					Description: common.String("EXAMPLE-description-Value"),
					Key:         common.String("EXAMPLE-key-Value"),
					Labels:      []string{"EXAMPLE--Value"},
					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"),
					ObjectStatus: common.Int(765)}},
				Key:          common.String("EXAMPLE-key-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value")}},
			Parameters: []dataintegration.Parameter{dataintegration.Parameter{ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				Name:                   common.String("EXAMPLE-name-Value"),
				TypeName:               common.String("EXAMPLE-typeName-Value"),
				Description:            common.String("EXAMPLE-description-Value"),
				ModelVersion:           common.String("EXAMPLE-modelVersion-Value"),
				RootObjectDefaultValue: &rootObjectDefaultValue,
				Type:                   &type_,
				UsedFor:                common.String("EXAMPLE-usedFor-Value"),
				ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_RDUER": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(728),
					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")}},
				ObjectStatus:          common.Int(814),
				OutputAggregationType: dataintegration.ParameterOutputAggregationTypeSum,
				DefaultValue:          &defaultValue,
				IsInput:               common.Bool(false),
				IsOutput:              common.Bool(false),
				Key:                   common.String("EXAMPLE-key-Value")}}},
		WorkspaceId:  common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value"),
		IfMatch:      common.String("EXAMPLE-ifMatch-Value"),
		OpcRequestId: common.String("WPFEXXGRW94BW82JG5AJ<unique_ID>")}

	// 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)
}