// 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).

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Oci.DataintegrationService;
using Oci.Common;
using Oci.Common.Auth;

namespace Oci.Sdk.DotNet.Example.Dataintegration
{
    public class CreateUserDefinedFunctionValidationExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var createUserDefinedFunctionValidationDetails = new Oci.DataintegrationService.Models.CreateUserDefinedFunctionValidationDetails
			{
				Key = "EXAMPLE-key-Value",
				ModelType = Oci.DataintegrationService.Models.CreateUserDefinedFunctionValidationDetails.ModelTypeEnum.DisUserDefinedFunction,
				ModelVersion = "EXAMPLE-modelVersion-Value",
				ParentRef = new Oci.DataintegrationService.Models.ParentReference
				{
					Parent = "EXAMPLE-parent-Value",
					RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
				},
				Name = "EXAMPLE-name-Value",
				Identifier = "EXAMPLE-identifier-Value",
				ObjectVersion = 307,
				Signatures = new List<Oci.DataintegrationService.Models.FunctionSignature>
				{
					new Oci.DataintegrationService.Models.FunctionSignature
					{
						Key = "EXAMPLE-key-Value",
						ModelType = Oci.DataintegrationService.Models.FunctionSignature.ModelTypeEnum.DisFunctionSignature,
						ModelVersion = "EXAMPLE-modelVersion-Value",
						ParentRef = new Oci.DataintegrationService.Models.ParentReference
						{
							Parent = "EXAMPLE-parent-Value",
							RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
						},
						Name = "EXAMPLE-name-Value",
						RetType = new Oci.DataintegrationService.Models.ConfiguredType
						{
							WrappedType = "EXAMPLE-wrappedType-Value",
							ConfigValues = new Oci.DataintegrationService.Models.ConfigValues
							{
								ConfigParamValues = new Dictionary<string, Oci.DataintegrationService.Models.ConfigParameterValue>()
								{
									{
										"EXAMPLE_KEY_j1OqC", 
										new Oci.DataintegrationService.Models.ConfigParameterValue
										{
											StringValue = "EXAMPLE-stringValue-Value",
											IntValue = 613,
											ObjectValue = "EXAMPLE-objectValue-Value",
											RefValue = "EXAMPLE-refValue-Value",
											ParameterValue = "EXAMPLE-parameterValue-Value",
											RootObjectValue = "EXAMPLE-rootObjectValue-Value"
										}
									}
								},
								ParentRef = new Oci.DataintegrationService.Models.ParentReference
								{
									Parent = "EXAMPLE-parent-Value",
									RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
								}
							},
							ConfigDefinition = new Oci.DataintegrationService.Models.ConfigDefinition
							{
								Key = "EXAMPLE-key-Value",
								ModelType = "EXAMPLE-modelType-Value",
								ModelVersion = "EXAMPLE-modelVersion-Value",
								ParentRef = new Oci.DataintegrationService.Models.ParentReference
								{
									Parent = "EXAMPLE-parent-Value",
									RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
								},
								Name = "EXAMPLE-name-Value",
								IsContained = false,
								ObjectStatus = 832,
								ConfigParameterDefinitions = new Dictionary<string, Oci.DataintegrationService.Models.ConfigParameterDefinition>()
								{
									{
										"EXAMPLE_KEY_rI0TL", 
										new Oci.DataintegrationService.Models.ConfigParameterDefinition
										{
											ParameterType = new Oci.DataintegrationService.Models.DataType
											{
												DtType = Oci.DataintegrationService.Models.DataType.DtTypeEnum.Primitive,
												TypeSystemName = "EXAMPLE-typeSystemName-Value",
												Key = "EXAMPLE-key-Value",
												ModelVersion = "EXAMPLE-modelVersion-Value",
												ParentRef = new Oci.DataintegrationService.Models.ParentReference
												{
													Parent = "EXAMPLE-parent-Value",
													RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
												},
												Name = "EXAMPLE-name-Value",
												ObjectStatus = 335,
												Description = "EXAMPLE-description-Value"
											},
											ParameterName = "EXAMPLE-parameterName-Value",
											Description = "EXAMPLE-description-Value",
											DefaultValue = "EXAMPLE-defaultValue-Value",
											ClassFieldName = "EXAMPLE-classFieldName-Value",
											IsStatic = true,
											IsClassFieldValue = false
										}
									}
								}
							},
							Key = "EXAMPLE-key-Value",
							ModelVersion = "EXAMPLE-modelVersion-Value",
							ParentRef = new Oci.DataintegrationService.Models.ParentReference
							{
								Parent = "EXAMPLE-parent-Value",
								RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
							},
							Name = "EXAMPLE-name-Value",
							ObjectStatus = 290,
							Description = "EXAMPLE-description-Value"
						},
						Arguments = new List<Oci.DataintegrationService.Models.TypedObject>
						{
							new Oci.DataintegrationService.Models.DynamicInputField
							{
								Type = new Oci.DataintegrationService.Models.DynamicType
								{
									TypeHandler = new Oci.DataintegrationService.Models.FlattenTypeHandler
									{
										Key = "EXAMPLE-key-Value",
										ModelVersion = "EXAMPLE-modelVersion-Value",
										ParentRef = new Oci.DataintegrationService.Models.ParentReference
										{
											Parent = "EXAMPLE-parent-Value",
											RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
										},
										Scope = "EXAMPLE-scope-Value",
										FlattenDetails = "EXAMPLE-flattenDetails-Value",
										ConfigValues = new Oci.DataintegrationService.Models.ConfigValues
										{
											ConfigParamValues = new Dictionary<string, Oci.DataintegrationService.Models.ConfigParameterValue>()
											{
												{
													"EXAMPLE_KEY_u3VMd", 
													new Oci.DataintegrationService.Models.ConfigParameterValue
													{
														StringValue = "EXAMPLE-stringValue-Value",
														IntValue = 671,
														ObjectValue = "EXAMPLE-objectValue-Value",
														RefValue = "EXAMPLE-refValue-Value",
														ParameterValue = "EXAMPLE-parameterValue-Value",
														RootObjectValue = "EXAMPLE-rootObjectValue-Value"
													}
												}
											},
											ParentRef = new Oci.DataintegrationService.Models.ParentReference
											{
												Parent = "EXAMPLE-parent-Value",
												RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
											}
										},
										ObjectStatus = 193
									},
									ConfigDefinition = new Oci.DataintegrationService.Models.ConfigDefinition
									{
										Key = "EXAMPLE-key-Value",
										ModelType = "EXAMPLE-modelType-Value",
										ModelVersion = "EXAMPLE-modelVersion-Value",
										ParentRef = new Oci.DataintegrationService.Models.ParentReference
										{
											Parent = "EXAMPLE-parent-Value",
											RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
										},
										Name = "EXAMPLE-name-Value",
										IsContained = true,
										ObjectStatus = 389,
										ConfigParameterDefinitions = new Dictionary<string, Oci.DataintegrationService.Models.ConfigParameterDefinition>()
										{
											{
												"EXAMPLE_KEY_cdn3e", 
												new Oci.DataintegrationService.Models.ConfigParameterDefinition
												{
													ParameterName = "EXAMPLE-parameterName-Value",
													Description = "EXAMPLE-description-Value",
													DefaultValue = "EXAMPLE-defaultValue-Value",
													ClassFieldName = "EXAMPLE-classFieldName-Value",
													IsStatic = true,
													IsClassFieldValue = false
												}
											}
										}
									},
									Key = "EXAMPLE-key-Value",
									ModelVersion = "EXAMPLE-modelVersion-Value",
									ParentRef = new Oci.DataintegrationService.Models.ParentReference
									{
										Parent = "EXAMPLE-parent-Value",
										RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
									},
									Name = "EXAMPLE-name-Value",
									ObjectStatus = 362,
									Description = "EXAMPLE-description-Value"
								},
								Labels = new List<string>
								{
									"EXAMPLE--Value"
								},
								Key = "EXAMPLE-key-Value",
								ModelVersion = "EXAMPLE-modelVersion-Value",
								ParentRef = new Oci.DataintegrationService.Models.ParentReference
								{
									Parent = "EXAMPLE-parent-Value",
									RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
								},
								ConfigValues = new Oci.DataintegrationService.Models.ConfigValues
								{
									ConfigParamValues = new Dictionary<string, Oci.DataintegrationService.Models.ConfigParameterValue>()
									{
										{
											"EXAMPLE_KEY_hEQ26", 
											new Oci.DataintegrationService.Models.ConfigParameterValue
											{
												StringValue = "EXAMPLE-stringValue-Value",
												IntValue = 93,
												ObjectValue = "EXAMPLE-objectValue-Value",
												RefValue = "EXAMPLE-refValue-Value",
												ParameterValue = "EXAMPLE-parameterValue-Value",
												RootObjectValue = "EXAMPLE-rootObjectValue-Value"
											}
										}
									},
									ParentRef = new Oci.DataintegrationService.Models.ParentReference
									{
										Parent = "EXAMPLE-parent-Value",
										RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
									}
								},
								ObjectStatus = 251,
								Name = "EXAMPLE-name-Value",
								Description = "EXAMPLE-description-Value"
							}
						},
						Description = "EXAMPLE-description-Value",
						ObjectStatus = 728
					}
				},
				Expr = new Oci.DataintegrationService.Models.Expression
				{
					Key = "EXAMPLE-key-Value",
					ModelType = "EXAMPLE-modelType-Value",
					ModelVersion = "EXAMPLE-modelVersion-Value",
					ParentRef = new Oci.DataintegrationService.Models.ParentReference
					{
						Parent = "EXAMPLE-parent-Value",
						RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
					},
					ExprString = "EXAMPLE-exprString-Value",
					ConfigValues = new Oci.DataintegrationService.Models.ConfigValues
					{
						ConfigParamValues = new Dictionary<string, Oci.DataintegrationService.Models.ConfigParameterValue>()
						{
							{
								"EXAMPLE_KEY_zm8i9", 
								new Oci.DataintegrationService.Models.ConfigParameterValue
								{
									StringValue = "EXAMPLE-stringValue-Value",
									IntValue = 405,
									ObjectValue = "EXAMPLE-objectValue-Value",
									RefValue = "EXAMPLE-refValue-Value",
									ParameterValue = "EXAMPLE-parameterValue-Value",
									RootObjectValue = "EXAMPLE-rootObjectValue-Value"
								}
							}
						},
						ParentRef = new Oci.DataintegrationService.Models.ParentReference
						{
							Parent = "EXAMPLE-parent-Value",
							RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
						}
					},
					ObjectStatus = 286
				},
				Description = "EXAMPLE-description-Value",
				ObjectStatus = 233,
				Metadata = new Oci.DataintegrationService.Models.ObjectMetadata
				{
					CreatedBy = "EXAMPLE-createdBy-Value",
					CreatedByName = "EXAMPLE-createdByName-Value",
					UpdatedBy = "EXAMPLE-updatedBy-Value",
					UpdatedByName = "EXAMPLE-updatedByName-Value",
					TimeCreated = DateTime.Parse("07/21/2018 20:43:28"),
					TimeUpdated = DateTime.Parse("05/31/2045 21:36:56"),
					AggregatorKey = "EXAMPLE-aggregatorKey-Value",
					Aggregator = new Oci.DataintegrationService.Models.AggregatorSummary
					{
						Type = "EXAMPLE-type-Value",
						Key = "EXAMPLE-key-Value",
						Name = "EXAMPLE-name-Value",
						Identifier = "EXAMPLE-identifier-Value",
						Description = "EXAMPLE-description-Value"
					},
					IdentifierPath = "EXAMPLE-identifierPath-Value",
					InfoFields = new Dictionary<string, string>()
					{
						{
							"EXAMPLE_KEY_wWn00", 
							"EXAMPLE_VALUE_CMWjjLet9pUm2MPknXDz"
						}
					},
					RegistryVersion = 87,
					Labels = new List<string>
					{
						"EXAMPLE--Value"
					},
					IsFavorite = true,
					CountStatistics = new Oci.DataintegrationService.Models.CountStatistic
					{
						ObjectTypeCountList = new List<Oci.DataintegrationService.Models.CountStatisticSummary>
						{
							new Oci.DataintegrationService.Models.CountStatisticSummary
							{
								ObjectType = Oci.DataintegrationService.Models.CountStatisticSummary.ObjectTypeEnum.Project,
								ObjectCount = 615
							}
						}
					}
				},
				KeyMap = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_XcjiH", 
						"EXAMPLE_VALUE_IuMJy6EBtvIMNoy4iFBJ"
					}
				}
			};
			var createUserDefinedFunctionValidationRequest = new Oci.DataintegrationService.Requests.CreateUserDefinedFunctionValidationRequest
			{
				WorkspaceId = "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
				CreateUserDefinedFunctionValidationDetails = createUserDefinedFunctionValidationDetails,
				OpcRequestId = "MMNIDPNUEYTOWZ5SKTWE<unique_ID>",
				OpcRetryToken = "EXAMPLE-opcRetryToken-Value"
			};

            // 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. 
            var provider = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
            try
            {
                // Create a service client and send the request.
				using (var client = new DataIntegrationClient(provider, new ClientConfiguration()))
				{
					var response = await client.CreateUserDefinedFunctionValidation(createUserDefinedFunctionValidationRequest);
					// Retrieve value from the response.
					var totalMessageCountValue = response.UserDefinedFunctionValidation.TotalMessageCount;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"CreateUserDefinedFunctionValidation Failed with {e.Message}");
                throw e;
            }
        }

    }
}