// 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"
	var rootObjectDefaultValue interface{}
	rootObjectDefaultValue = "EXAMPLE-rootObjectDefaultValue-Value"
	var type_ interface{}
	type_ = "EXAMPLE-type-Value"
	req := dataintegration.CreateUserDefinedFunctionValidationRequest{CreateUserDefinedFunctionValidationDetails: dataintegration.CreateUserDefinedFunctionValidationDetails{ModelType: dataintegration.CreateUserDefinedFunctionValidationDetailsModelTypeDisUserDefinedFunction,
		Metadata: &dataintegration.ObjectMetadata{AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
			InfoFields:    map[string]string{"EXAMPLE_KEY_YJ2XL": "EXAMPLE_VALUE_7Bbm9mj7XLRjSswVZlLY"},
			IsFavorite:    common.Bool(false),
			UpdatedBy:     common.String("EXAMPLE-updatedBy-Value"),
			UpdatedByName: common.String("EXAMPLE-updatedByName-Value"),
			CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectCount: common.Int64(544),
				ObjectType: dataintegration.CountStatisticSummaryObjectTypeApplication}}},
			CreatedBy:       common.String("EXAMPLE-createdBy-Value"),
			CreatedByName:   common.String("EXAMPLE-createdByName-Value"),
			IdentifierPath:  common.String("EXAMPLE-identifierPath-Value"),
			Labels:          []string{"EXAMPLE--Value"},
			RegistryVersion: common.Int(133),
			TimeCreated:     &common.SDKTime{Time: time.Now()},
			TimeUpdated:     &common.SDKTime{Time: time.Now()},
			Aggregator: &dataintegration.AggregatorSummary{Type: common.String("EXAMPLE-type-Value"),
				Description: common.String("EXAMPLE-description-Value"),
				Identifier:  common.String("EXAMPLE-identifier-Value"),
				Key:         common.String("EXAMPLE-key-Value"),
				Name:        common.String("EXAMPLE-name-Value")}},
		ModelVersion:  common.String("EXAMPLE-modelVersion-Value"),
		Name:          common.String("EXAMPLE-name-Value"),
		ObjectStatus:  common.Int(87),
		ObjectVersion: common.Int(648),
		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{Description: common.String("EXAMPLE-description-Value"),
			ObjectStatus: common.Int(55),
			RetType: &dataintegration.ConfiguredType{ConfigDefinition: &dataintegration.ConfigDefinition{ObjectStatus: common.Int(202),
				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_UevHJ": dataintegration.ConfigParameterDefinition{IsStatic: common.Bool(true),
					ParameterName: common.String("EXAMPLE-parameterName-Value"),
					ParameterType: dataintegration.CompositeType{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.InputPort{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
							ObjectStatus: common.Int(521),
							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"),
							PortType:    dataintegration.InputPortPortTypeModel,
							ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_Ptpbz": dataintegration.ConfigParameterValue{IntValue: common.Int(88),
								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(870)},
					ClassFieldName:    common.String("EXAMPLE-classFieldName-Value"),
					DefaultValue:      &defaultValue,
					Description:       common.String("EXAMPLE-description-Value"),
					IsClassFieldValue: common.Bool(true)}},
				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_Hs7Ri": dataintegration.ConfigParameterValue{IntValue: common.Int(360),
					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"),
				Key:          common.String("EXAMPLE-key-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")},
				Name:         common.String("EXAMPLE-name-Value"),
				ObjectStatus: common.Int(399),
				WrappedType:  &wrappedType},
			Arguments: []dataintegration.TypedObject{dataintegration.Parameter{OutputAggregationType: dataintegration.ParameterOutputAggregationTypeMin,
				RootObjectDefaultValue: &rootObjectDefaultValue,
				Type:                   &type_,
				UsedFor:                common.String("EXAMPLE-usedFor-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"),
				ObjectStatus: common.Int(24),
				TypeName:     common.String("EXAMPLE-typeName-Value"),
				DefaultValue: &defaultValue,
				Description:  common.String("EXAMPLE-description-Value"),
				Name:         common.String("EXAMPLE-name-Value"),
				ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_b4U6Z": dataintegration.ConfigParameterValue{IntValue: common.Int(230),
					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")}},
				IsInput:  common.Bool(false),
				IsOutput: common.Bool(false)}},
			Key:          common.String("EXAMPLE-key-Value"),
			ModelType:    dataintegration.FunctionSignatureModelTypeDisFunctionSignature,
			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")}}},
		Description: common.String("EXAMPLE-description-Value"),
		Expr: &dataintegration.Expression{Key: common.String("EXAMPLE-key-Value"),
			ModelType:    common.String("EXAMPLE-modelType-Value"),
			ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
			ObjectStatus: common.Int(351),
			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_TkiCb": dataintegration.ConfigParameterValue{RootObjectValue: &rootObjectValue,
				StringValue:    common.String("EXAMPLE-stringValue-Value"),
				IntValue:       common.Int(852),
				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")},
		Identifier: common.String("EXAMPLE-identifier-Value"),
		Key:        common.String("EXAMPLE-key-Value"),
		KeyMap:     map[string]string{"EXAMPLE_KEY_X2Cps": "EXAMPLE_VALUE_7lIuDe56NGjRfctjBIB8"}},
		OpcRequestId:  common.String("I6C6JE1JBJSOUSDNGU3I<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)
}