// 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 ExampleUpdateUserDefinedFunction() {
	// 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 objectValue interface{}
	objectValue = "EXAMPLE-objectValue-Value"
	var refValue interface{}
	refValue = "EXAMPLE-refValue-Value"
	var rootObjectValue interface{}
	rootObjectValue = "EXAMPLE-rootObjectValue-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	var rootObjectDefaultValue interface{}
	rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
	var type_ interface{}
	type_ = "EXAMPLE-type-Value"
	var wrappedType interface{}
	wrappedType = "EXAMPLE-wrappedType-Value"
	req := dataintegration.UpdateUserDefinedFunctionRequest{IfMatch: common.String("EXAMPLE-ifMatch-Value"),
		OpcRequestId: common.String("R7APEBXMM5SXS0IPY4RA<unique_ID>"),
		UpdateUserDefinedFunctionDetails: dataintegration.UpdateUserDefinedFunctionDetails{Description: common.String("EXAMPLE-description-Value"),
			Expr: &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{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_M55iG": dataintegration.ConfigParameterValue{IntValue: common.Int(806),
						ObjectValue:     &objectValue,
						ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value")}}},
				ExprString:   common.String("EXAMPLE-exprString-Value"),
				Key:          common.String("EXAMPLE-key-Value"),
				ModelType:    common.String("EXAMPLE-modelType-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(446)},
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			RegistryMetadata: &dataintegration.RegistryMetadata{Key: common.String("EXAMPLE-key-Value"),
				Labels:          []string{"EXAMPLE--Value"},
				RegistryVersion: common.Int(49),
				AggregatorKey:   common.String("EXAMPLE-aggregatorKey-Value"),
				IsFavorite:      common.Bool(false)},
			Signatures: []dataintegration.FunctionSignature{dataintegration.FunctionSignature{Arguments: []dataintegration.TypedObject{dataintegration.Parameter{IsInput: common.Bool(true),
				Name:                  common.String("EXAMPLE-name-Value"),
				DefaultValue:          &defaultValue,
				Description:           common.String("EXAMPLE-description-Value"),
				OutputAggregationType: dataintegration.ParameterOutputAggregationTypeMin,
				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_3Lk6R": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
					ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
					RefValue:        &refValue,
					RootObjectValue: &rootObjectValue,
					StringValue:     common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(515)}},
					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"),
				RootObjectDefaultValue: &rootObjectDefaultValue,
				Type:                   &type_,
				TypeName:               common.String("EXAMPLE-typeName-Value"),
				UsedFor:                common.String("EXAMPLE-usedFor-Value"),
				IsOutput:               common.Bool(false),
				Key:                    common.String("EXAMPLE-key-Value"),
				ObjectStatus:           common.Int(42)}},
				Description:  common.String("EXAMPLE-description-Value"),
				Key:          common.String("EXAMPLE-key-Value"),
				Name:         common.String("EXAMPLE-name-Value"),
				ModelType:    dataintegration.FunctionSignatureModelTypeDisFunctionSignature,
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(557),
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				RetType: &dataintegration.ConfiguredType{ConfigDefinition: &dataintegration.ConfigDefinition{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(564),
					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_eknKB": dataintegration.ConfigParameterDefinition{Description: common.String("EXAMPLE-description-Value"),
						IsClassFieldValue: common.Bool(false),
						IsStatic:          common.Bool(false),
						ParameterName:     common.String("EXAMPLE-parameterName-Value"),
						ParameterType: dataintegration.JavaType{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
							Name:         common.String("EXAMPLE-name-Value"),
							ObjectStatus: common.Int(310),
							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"),
							JavaTypeName: common.String("EXAMPLE-javaTypeName-Value"),
							Key:          common.String("EXAMPLE-key-Value")},
						ClassFieldName: common.String("EXAMPLE-classFieldName-Value"),
						DefaultValue:   &defaultValue}},
					IsContained: common.Bool(false),
					Key:         common.String("EXAMPLE-key-Value")},
					Key:          common.String("EXAMPLE-key-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(279),
					WrappedType:  &wrappedType,
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_yKqVm": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(973),
						ObjectValue:     &objectValue}},
						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"),
					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")}}}},
			Identifier:    common.String("EXAMPLE-identifier-Value"),
			ObjectStatus:  common.Int(279),
			ObjectVersion: common.Int(304),
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")}},
		UserDefinedFunctionKey: common.String("EXAMPLE-userDefinedFunctionKey-Value"),
		WorkspaceId:            common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value")}

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

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