// 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 wrappedType interface{}
	wrappedType = "EXAMPLE-wrappedType-Value"
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	req := dataintegration.CreateUserDefinedFunctionValidationRequest{CreateUserDefinedFunctionValidationDetails: dataintegration.CreateUserDefinedFunctionValidationDetails{ModelType: dataintegration.CreateUserDefinedFunctionValidationDetailsModelTypeDisUserDefinedFunction,
		ObjectStatus:  common.Int(747),
		ObjectVersion: common.Int(775),
		ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
			RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
		Expr: &dataintegration.Expression{ModelType: common.String("EXAMPLE-modelType-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			ObjectStatus: common.Int(176),
			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_1r9NJ": dataintegration.ConfigParameterValue{IntValue: common.Int(413),
				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")},
		Key:          common.String("EXAMPLE-key-Value"),
		KeyMap:       map[string]string{"EXAMPLE_KEY_ZagVt": "EXAMPLE_VALUE_WUkcexGYco6T6I7d3Efn"},
		ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
		Name:         common.String("EXAMPLE-name-Value"),
		Signatures: []dataintegration.FunctionSignature{dataintegration.FunctionSignature{Key: common.String("EXAMPLE-key-Value"),
			ModelType:    dataintegration.FunctionSignatureModelTypeDisFunctionSignature,
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			Name:         common.String("EXAMPLE-name-Value"),
			Arguments: []dataintegration.TypedObject{dataintegration.OutputPort{Key: common.String("EXAMPLE-key-Value"),
				ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
				Name:         common.String("EXAMPLE-name-Value"),
				PortType:     dataintegration.OutputPortPortTypeData,
				ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_maXi3": dataintegration.ConfigParameterValue{StringValue: common.String("EXAMPLE-stringValue-Value"),
					IntValue:        common.Int(548),
					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")}},
				Description:  common.String("EXAMPLE-description-Value"),
				ObjectStatus: common.Int(991),
				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"),
			ObjectStatus: common.Int(786),
			ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
				Parent: common.String("EXAMPLE-parent-Value")},
			RetType: &dataintegration.ConfiguredType{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_TBAwG": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
					StringValue:    common.String("EXAMPLE-stringValue-Value"),
					IntValue:       common.Int(894),
					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"),
				ObjectStatus: common.Int(583),
				WrappedType:  &wrappedType,
				ConfigDefinition: &dataintegration.ConfigDefinition{ConfigParameterDefinitions: map[string]dataintegration.ConfigParameterDefinition{"EXAMPLE_KEY_s1rJL": dataintegration.ConfigParameterDefinition{ParameterName: common.String("EXAMPLE-parameterName-Value"),
					ParameterType: dataintegration.MapType{ContainsNull: common.Bool(false),
						Description:    common.String("EXAMPLE-description-Value"),
						Key:            common.String("EXAMPLE-key-Value"),
						KeyElementType: common.String("EXAMPLE-keyElementType-Value"),
						ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
							Parent: common.String("EXAMPLE-parent-Value")},
						ModelVersion:     common.String("EXAMPLE-modelVersion-Value"),
						Name:             common.String("EXAMPLE-name-Value"),
						ObjectStatus:     common.Int(532),
						ValueElementType: common.String("EXAMPLE-valueElementType-Value")},
					ClassFieldName:    common.String("EXAMPLE-classFieldName-Value"),
					DefaultValue:      &defaultValue,
					Description:       common.String("EXAMPLE-description-Value"),
					IsClassFieldValue: common.Bool(true),
					IsStatic:          common.Bool(false)}},
					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(916),
					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")}}},
		Description: common.String("EXAMPLE-description-Value"),
		Identifier:  common.String("EXAMPLE-identifier-Value"),
		Metadata: &dataintegration.ObjectMetadata{CreatedByName: common.String("EXAMPLE-createdByName-Value"),
			IsFavorite: common.Bool(false),
			Aggregator: &dataintegration.AggregatorSummary{Key: common.String("EXAMPLE-key-Value"),
				Name:        common.String("EXAMPLE-name-Value"),
				Type:        common.String("EXAMPLE-type-Value"),
				Description: common.String("EXAMPLE-description-Value"),
				Identifier:  common.String("EXAMPLE-identifier-Value")},
			RegistryVersion: common.Int(909),
			TimeUpdated:     &common.SDKTime{Time: time.Now()},
			AggregatorKey:   common.String("EXAMPLE-aggregatorKey-Value"),
			CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectCount: common.Int64(367),
				ObjectType: dataintegration.CountStatisticSummaryObjectTypeProject}}},
			CreatedBy:      common.String("EXAMPLE-createdBy-Value"),
			IdentifierPath: common.String("EXAMPLE-identifierPath-Value"),
			UpdatedBy:      common.String("EXAMPLE-updatedBy-Value"),
			UpdatedByName:  common.String("EXAMPLE-updatedByName-Value"),
			InfoFields:     map[string]string{"EXAMPLE_KEY_JZkK2": "EXAMPLE_VALUE_8K20rdIVNvGi6AbyOcE7"},
			Labels:         []string{"EXAMPLE--Value"},
			TimeCreated:    &common.SDKTime{Time: time.Now()}}},
		OpcRequestId:  common.String("GCP9FHX17IVDK5FOOQAJ<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		WorkspaceId:   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-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)
}