// 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 scope interface{}
	scope = "EXAMPLE-scope-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	var wrappedType interface{}
	wrappedType = "EXAMPLE-wrappedType-Value"
	req := dataintegration.UpdateUserDefinedFunctionRequest{IfMatch: common.String("EXAMPLE-ifMatch-Value"),
		OpcRequestId: common.String("EMMXUFJKL1AFQSSZRGNT<unique_ID>"),
		UpdateUserDefinedFunctionDetails: dataintegration.UpdateUserDefinedFunctionDetails{ObjectVersion: common.Int(215),
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			RegistryMetadata: &dataintegration.RegistryMetadata{Labels: []string{"EXAMPLE--Value"},
				RegistryVersion: common.Int(145),
				AggregatorKey:   common.String("EXAMPLE-aggregatorKey-Value"),
				IsFavorite:      common.Bool(false),
				Key:             common.String("EXAMPLE-key-Value")},
			Identifier:   common.String("EXAMPLE-identifier-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			ObjectStatus: common.Int(991),
			Signatures: []dataintegration.FunctionSignature{dataintegration.FunctionSignature{ObjectStatus: common.Int(832),
				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(475),
					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_quyE2": dataintegration.ConfigParameterDefinition{ParameterType: dataintegration.DynamicType{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						Name:         common.String("EXAMPLE-name-Value"),
						ObjectStatus: common.Int(34),
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						TypeHandler: dataintegration.RuleTypeConfig{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
							ObjectStatus: common.Int(273),
							ProjectionRules: []dataintegration.ProjectionRule{dataintegration.TypedNamePatternRule{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_i6mVf": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
								IntValue:        common.Int(823),
								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")}},
								IsCaseSensitive: common.Bool(false),
								Key:             common.String("EXAMPLE-key-Value"),
								Names:           []string{"EXAMPLE--Value"},
								ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
									RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
								Types:                       []interface{}{"EXAMPLE-types-Value"},
								ObjectStatus:                common.Int(651),
								Scope:                       &scope,
								Description:                 common.String("EXAMPLE-description-Value"),
								IsJavaRegexSyntax:           common.Bool(true),
								ModelVersion:                common.String("EXAMPLE-modelVersion-Value"),
								RuleType:                    dataintegration.TypedNamePatternRuleRuleTypeExclude,
								IsCascade:                   common.Bool(false),
								IsSkipRemainingRulesOnMatch: common.Bool(false),
								MatchingStrategy:            dataintegration.TypedNamePatternRuleMatchingStrategyNameOnly,
								Pattern:                     common.String("EXAMPLE-pattern-Value")}},
							ScopeReference: &dataintegration.ScopeReference{RefObjectName: common.String("EXAMPLE-refObjectName-Value"),
								ReferenceObject: common.String("EXAMPLE-referenceObject-Value"),
								ReferenceType:   dataintegration.ScopeReferenceReferenceTypeBoundEntityShapeField},
							ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_qzvCj": dataintegration.ConfigParameterValue{IntValue: common.Int(813),
								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")}},
							IsOrderByRule: common.Bool(true),
							Key:           common.String("EXAMPLE-key-Value"),
							ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
								RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
							Scope: &scope},
						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"),
						IsClassFieldValue: common.Bool(false),
						IsStatic:          common.Bool(true),
						ParameterName:     common.String("EXAMPLE-parameterName-Value")}},
					IsContained: common.Bool(false),
					Key:         common.String("EXAMPLE-key-Value")},
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_pjPWE": dataintegration.ConfigParameterValue{RefValue: &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(446),
						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")}},
					Name:         common.String("EXAMPLE-name-Value"),
					Description:  common.String("EXAMPLE-description-Value"),
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus: common.Int(795),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					WrappedType: &wrappedType},
				Description:  common.String("EXAMPLE-description-Value"),
				ModelType:    dataintegration.FunctionSignatureModelTypeDisFunctionSignature,
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				Arguments: []dataintegration.TypedObject{dataintegration.ProxyField{Scope: &scope,
					Type: dataintegration.JavaType{ConfigDefinition: &dataintegration.ConfigDefinition{ObjectStatus: common.Int(710),
						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_dKj51": 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(true),
						Key:          common.String("EXAMPLE-key-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						Name:         common.String("EXAMPLE-name-Value")},
						Description:  common.String("EXAMPLE-description-Value"),
						JavaTypeName: common.String("EXAMPLE-javaTypeName-Value"),
						Key:          common.String("EXAMPLE-key-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						Name:         common.String("EXAMPLE-name-Value"),
						ObjectStatus: common.Int(903),
						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_ViLin": dataintegration.ConfigParameterValue{RefValue: &refValue,
							RootObjectValue: &rootObjectValue,
							StringValue:     common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(658),
							ObjectValue:     &objectValue,
							ParameterValue:  common.String("EXAMPLE-parameterValue-Value")}}},
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(557),
					Description:  common.String("EXAMPLE-description-Value"),
					Labels:       []string{"EXAMPLE--Value"},
					ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
						Parent: common.String("EXAMPLE-parent-Value")},
					ScopeReference: &dataintegration.ScopeReference{RefObjectName: common.String("EXAMPLE-refObjectName-Value"),
						ReferenceObject: common.String("EXAMPLE-referenceObject-Value"),
						ReferenceType:   dataintegration.ScopeReferenceReferenceTypeBoundEntityShape}}},
				Key:  common.String("EXAMPLE-key-Value"),
				Name: common.String("EXAMPLE-name-Value")}},
			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{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_CC1cH": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
					StringValue:    common.String("EXAMPLE-stringValue-Value"),
					IntValue:       common.Int(25),
					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")}},
				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(179)},
			Name: common.String("EXAMPLE-name-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)
}