// 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 wrappedType interface{}
	wrappedType = "EXAMPLE-wrappedType-Value"
	var scope interface{}
	scope = "EXAMPLE-scope-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	req := dataintegration.UpdateUserDefinedFunctionRequest{OpcRequestId: common.String("DPUOSWXFY7WTMUQXDVO2<unique_ID>"),
		UpdateUserDefinedFunctionDetails: dataintegration.UpdateUserDefinedFunctionDetails{Description: common.String("EXAMPLE-description-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			ObjectStatus: common.Int(902),
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-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{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_KcIW2": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
					ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
					RefValue:        &refValue,
					RootObjectValue: &rootObjectValue,
					StringValue:     common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(114)}},
					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"),
				ModelType:    common.String("EXAMPLE-modelType-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(298)},
			Identifier:    common.String("EXAMPLE-identifier-Value"),
			ObjectVersion: common.Int(760),
			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(88)},
			Signatures: []dataintegration.FunctionSignature{dataintegration.FunctionSignature{Description: common.String("EXAMPLE-description-Value"),
				ModelType:    dataintegration.FunctionSignatureModelTypeDisFunctionSignature,
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				ObjectStatus: common.Int(719),
				Arguments: []dataintegration.TypedObject{dataintegration.TypedExpression{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_0w6hE": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
					StringValue:    common.String("EXAMPLE-stringValue-Value"),
					IntValue:       common.Int(573),
					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"),
					Key:          common.String("EXAMPLE-key-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					Type:         common.String("EXAMPLE-type-Value"),
					Expression:   common.String("EXAMPLE-expression-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(323),
					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"),
				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")},
				RetType: &dataintegration.ConfiguredType{Key: common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(826),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					WrappedType: &wrappedType,
					ConfigDefinition: &dataintegration.ConfigDefinition{ObjectStatus: common.Int(518),
						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_7GXhf": dataintegration.ConfigParameterDefinition{Description: common.String("EXAMPLE-description-Value"),
							IsClassFieldValue: common.Bool(true),
							IsStatic:          common.Bool(true),
							ParameterName:     common.String("EXAMPLE-parameterName-Value"),
							ParameterType: dataintegration.DynamicType{Key: common.String("EXAMPLE-key-Value"),
								ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
								Name:         common.String("EXAMPLE-name-Value"),
								ObjectStatus: common.Int(779),
								ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
									RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
								TypeHandler: dataintegration.RuleTypeConfig{ProjectionRules: []dataintegration.ProjectionRule{dataintegration.GroupedNamePatternRule{Description: common.String("EXAMPLE-description-Value"),
									IsJavaRegexSyntax:           common.Bool(true),
									IsSkipRemainingRulesOnMatch: common.Bool(false),
									Key:                         common.String("EXAMPLE-key-Value"),
									Name:                        common.String("EXAMPLE-name-Value"),
									ObjectStatus:                common.Int(673),
									Scope:                       &scope,
									ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_osejP": dataintegration.ConfigParameterValue{IntValue: common.Int(371),
										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")}},
									MatchingStrategy: dataintegration.GroupedNamePatternRuleMatchingStrategyTagsOnly,
									ModelVersion:     common.String("EXAMPLE-modelVersion-Value"),
									Pattern:          common.String("EXAMPLE-pattern-Value"),
									RuleType:         dataintegration.GroupedNamePatternRuleRuleTypeExclude,
									IsCascade:        common.Bool(false),
									IsCaseSensitive:  common.Bool(false),
									ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
										Parent: common.String("EXAMPLE-parent-Value")}}},
									Scope: &scope,
									ScopeReference: &dataintegration.ScopeReference{RefObjectName: common.String("EXAMPLE-refObjectName-Value"),
										ReferenceObject: common.String("EXAMPLE-referenceObject-Value"),
										ReferenceType:   dataintegration.ScopeReferenceReferenceTypeBoundEntityShape},
									ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_fS3nU": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
										RefValue:        &refValue,
										RootObjectValue: &rootObjectValue,
										StringValue:     common.String("EXAMPLE-stringValue-Value"),
										IntValue:        common.Int(35),
										ObjectValue:     &objectValue}},
										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(24),
									IsOrderByRule: 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")},
							ClassFieldName: common.String("EXAMPLE-classFieldName-Value"),
							DefaultValue:   &defaultValue}},
						IsContained:  common.Bool(false),
						Key:          common.String("EXAMPLE-key-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						Name:         common.String("EXAMPLE-name-Value")},
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_YpoDO": dataintegration.ConfigParameterValue{IntValue: common.Int(892),
						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")}}}},
		UserDefinedFunctionKey: common.String("EXAMPLE-userDefinedFunctionKey-Value"),
		WorkspaceId:            common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value"),
		IfMatch:                common.String("EXAMPLE-ifMatch-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)
}