// 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"
	"time"

	"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 ExampleCreateUserDefinedFunctionValidation() {
	// 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 wrappedType interface{}
	wrappedType = "EXAMPLE-wrappedType-Value"
	req := dataintegration.CreateUserDefinedFunctionValidationRequest{WorkspaceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value"),
		CreateUserDefinedFunctionValidationDetails: dataintegration.CreateUserDefinedFunctionValidationDetails{Description: common.String("EXAMPLE-description-Value"),
			Expr: &dataintegration.Expression{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(966),
				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_BiQQt": dataintegration.ConfigParameterValue{IntValue: common.Int(879),
					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"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			ObjectStatus: common.Int(424),
			ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
				RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
			Signatures: []dataintegration.FunctionSignature{dataintegration.FunctionSignature{Arguments: []dataintegration.TypedObject{dataintegration.MacroField{Name: common.String("EXAMPLE-name-Value"),
				Description: common.String("EXAMPLE-description-Value"),
				Expr: &dataintegration.Expression{ObjectStatus: common.Int(486),
					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_bADff": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
						StringValue:    common.String("EXAMPLE-stringValue-Value"),
						IntValue:       common.Int(916),
						ObjectValue:    &objectValue,
						ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
						RefValue:       &refValue}},
						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")},
				IsUseSourceType: common.Bool(false),
				ObjectStatus:    common.Int(539),
				ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
					RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
				Type: dataintegration.DynamicType{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")},
					TypeHandler: dataintegration.FlattenTypeHandler{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						ObjectStatus: common.Int(401),
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						Scope: common.String("EXAMPLE-scope-Value"),
						ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_YJ2XL": dataintegration.ConfigParameterValue{RefValue: &refValue,
							RootObjectValue: &rootObjectValue,
							StringValue:     common.String("EXAMPLE-stringValue-Value"),
							IntValue:        common.Int(67),
							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")}},
						FlattenDetails: common.String("EXAMPLE-flattenDetails-Value"),
						Key:            common.String("EXAMPLE-key-Value")},
					ConfigDefinition: &dataintegration.ConfigDefinition{ObjectStatus: common.Int(290),
						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_Cps7l": dataintegration.ConfigParameterDefinition{ClassFieldName: common.String("EXAMPLE-classFieldName-Value"),
							DefaultValue:      &defaultValue,
							Description:       common.String("EXAMPLE-description-Value"),
							IsClassFieldValue: common.Bool(true),
							IsStatic:          common.Bool(false),
							ParameterName:     common.String("EXAMPLE-parameterName-Value")}},
						IsContained:  common.Bool(false),
						Key:          common.String("EXAMPLE-key-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						Name:         common.String("EXAMPLE-name-Value")},
					Key:          common.String("EXAMPLE-key-Value"),
					ObjectStatus: common.Int(849)},
				UseType: &dataintegration.ConfiguredType{ObjectStatus: common.Int(91),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					WrappedType: &wrappedType,
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_Gcubj": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(198),
						ObjectValue:     &objectValue}},
						ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
							Parent: common.String("EXAMPLE-parent-Value")}},
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					ConfigDefinition: &dataintegration.ConfigDefinition{IsContained: common.Bool(true),
						Key:          common.String("EXAMPLE-key-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						Name:         common.String("EXAMPLE-name-Value"),
						ObjectStatus: common.Int(515),
						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_HqhgI": dataintegration.ConfigParameterDefinition{ClassFieldName: common.String("EXAMPLE-classFieldName-Value"),
							DefaultValue:      &defaultValue,
							Description:       common.String("EXAMPLE-description-Value"),
							IsClassFieldValue: common.Bool(true),
							IsStatic:          common.Bool(true),
							ParameterName:     common.String("EXAMPLE-parameterName-Value")}}},
					Description: common.String("EXAMPLE-description-Value"),
					Name:        common.String("EXAMPLE-name-Value")},
				ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_LJOkm": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
					ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
					RefValue:        &refValue,
					RootObjectValue: &rootObjectValue,
					StringValue:     common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(458)}},
					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"),
				Labels:       []string{"EXAMPLE--Value"},
				ModelVersion: common.String("EXAMPLE-modelVersion-Value")}},
				Description:  common.String("EXAMPLE-description-Value"),
				Key:          common.String("EXAMPLE-key-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")},
				ModelType:    dataintegration.FunctionSignatureModelTypeDisFunctionSignature,
				ObjectStatus: common.Int(311),
				RetType: &dataintegration.ConfiguredType{ConfigDefinition: &dataintegration.ConfigDefinition{ConfigParameterDefinitions: map[string]dataintegration.ConfigParameterDefinition{"EXAMPLE_KEY_pkuO9": dataintegration.ConfigParameterDefinition{Description: common.String("EXAMPLE-description-Value"),
					IsClassFieldValue: common.Bool(true),
					IsStatic:          common.Bool(true),
					ParameterName:     common.String("EXAMPLE-parameterName-Value"),
					ParameterType: dataintegration.CompositeType{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")},
						Description: common.String("EXAMPLE-description-Value"),
						Elements: []dataintegration.TypedObject{dataintegration.PivotField{ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_eTOq8": dataintegration.ConfigParameterValue{IntValue: common.Int(138),
							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"),
							Expr: &dataintegration.Expression{ExprString: common.String("EXAMPLE-exprString-Value"),
								Key:          common.String("EXAMPLE-key-Value"),
								ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
								ObjectStatus: common.Int(319),
								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_hKWQv": dataintegration.ConfigParameterValue{IntValue: common.Int(232),
									ObjectValue:     &objectValue,
									ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
									RefValue:        &refValue,
									RootObjectValue: &rootObjectValue,
									StringValue:     common.String("EXAMPLE-stringValue-Value")}},
									ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
										Parent: common.String("EXAMPLE-parent-Value")}}},
							ObjectStatus: common.Int(647),
							ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
								RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
							ColumnNamePattern: common.String("EXAMPLE-columnNamePattern-Value"),
							Key:               common.String("EXAMPLE-key-Value"),
							ModelVersion:      common.String("EXAMPLE-modelVersion-Value"),
							Name:              common.String("EXAMPLE-name-Value")}},
						Key: common.String("EXAMPLE-key-Value")},
					ClassFieldName: common.String("EXAMPLE-classFieldName-Value"),
					DefaultValue:   &defaultValue}},
					IsContained:  common.Bool(true),
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					Name:         common.String("EXAMPLE-name-Value"),
					ObjectStatus: common.Int(799),
					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"),
					WrappedType:  &wrappedType,
					ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_Vci7i": dataintegration.ConfigParameterValue{ParameterValue: common.String("EXAMPLE-parameterValue-Value"),
						RefValue:        &refValue,
						RootObjectValue: &rootObjectValue,
						StringValue:     common.String("EXAMPLE-stringValue-Value"),
						IntValue:        common.Int(289),
						ObjectValue:     &objectValue}},
						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"),
					ObjectStatus: common.Int(599),
					ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
						Parent: common.String("EXAMPLE-parent-Value")}}}},
			Identifier: common.String("EXAMPLE-identifier-Value"),
			KeyMap:     map[string]string{"EXAMPLE_KEY_OlSnk": "EXAMPLE_VALUE_CYOg5CSZinUbIL5j01FY"},
			Metadata: &dataintegration.ObjectMetadata{IsFavorite: common.Bool(true),
				TimeCreated:     &common.SDKTime{Time: time.Now()},
				UpdatedBy:       common.String("EXAMPLE-updatedBy-Value"),
				UpdatedByName:   common.String("EXAMPLE-updatedByName-Value"),
				AggregatorKey:   common.String("EXAMPLE-aggregatorKey-Value"),
				CreatedBy:       common.String("EXAMPLE-createdBy-Value"),
				CreatedByName:   common.String("EXAMPLE-createdByName-Value"),
				Labels:          []string{"EXAMPLE--Value"},
				RegistryVersion: common.Int(194),
				TimeUpdated:     &common.SDKTime{Time: time.Now()},
				Aggregator: &dataintegration.AggregatorSummary{Identifier: common.String("EXAMPLE-identifier-Value"),
					Key:         common.String("EXAMPLE-key-Value"),
					Name:        common.String("EXAMPLE-name-Value"),
					Type:        common.String("EXAMPLE-type-Value"),
					Description: common.String("EXAMPLE-description-Value")},
				CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectCount: common.Int64(175),
					ObjectType: dataintegration.CountStatisticSummaryObjectTypeProject}}},
				IdentifierPath: common.String("EXAMPLE-identifierPath-Value"),
				InfoFields:     map[string]string{"EXAMPLE_KEY_vlcnw": "EXAMPLE_VALUE_0vYDKS5L0LuW3eyfLCFa"}},
			ModelType:     dataintegration.CreateUserDefinedFunctionValidationDetailsModelTypeDisUserDefinedFunction,
			ObjectVersion: common.Int(541)},
		OpcRequestId:  common.String("AMFC4LUSAGFT2UYRZ6HO<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value")}

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

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