// 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.MysqlService;
using Oci.Common;
using Oci.Common.Auth;

namespace Oci.Sdk.DotNet.Example.Mysql
{
    public class CreateConfigurationExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var createConfigurationDetails = new Oci.MysqlService.Models.CreateConfigurationDetails
			{
				CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
				Description = "EXAMPLE-description-Value",
				DisplayName = "EXAMPLE-displayName-Value",
				ShapeName = "EXAMPLE-shapeName-Value",
				InitVariables = new Oci.MysqlService.Models.InitializationVariables
				{
					LowerCaseTableNames = Oci.MysqlService.Models.InitializationVariables.LowerCaseTableNamesEnum.CaseSensitive
				},
				Variables = new Oci.MysqlService.Models.ConfigurationVariables
				{
					CompletionType = Oci.MysqlService.Models.ConfigurationVariables.CompletionTypeEnum.Chain,
					BigTables = false,
					CharacterSetServer = Oci.MysqlService.Models.ConfigurationVariables.CharacterSetServerEnum.Greek,
					CollationServer = Oci.MysqlService.Models.ConfigurationVariables.CollationServerEnum.Ucs2GeneralCi,
					ConnectionMemoryChunkSize = 135018294,
					ConnectionMemoryLimit = 1218139905000666624,
					DefaultAuthenticationPlugin = Oci.MysqlService.Models.ConfigurationVariables.DefaultAuthenticationPluginEnum.MysqlNativePassword,
					GlobalConnectionMemoryLimit = 1828480262952922112,
					GlobalConnectionMemoryTracking = true,
					TransactionIsolation = Oci.MysqlService.Models.ConfigurationVariables.TransactionIsolationEnum.RepeatableRead,
					InnodbFtServerStopwordTable = "EXAMPLE-innodbFtServerStopwordTable-Value",
					MandatoryRoles = "EXAMPLE-mandatoryRoles-Value",
					Autocommit = true,
					ForeignKeyChecks = true,
					GroupReplicationConsistency = Oci.MysqlService.Models.ConfigurationVariables.GroupReplicationConsistencyEnum.Eventual,
					GroupConcatMaxLen = 4155474175975169028,
					InnodbFtEnableStopword = false,
					InnodbLogWriterThreads = false,
					LocalInfile = true,
					MysqlFirewallMode = false,
					MysqlxEnableHelloNotice = false,
					SqlRequirePrimaryKey = true,
					SqlWarnings = false,
					BinlogExpireLogsSeconds = 548,
					BinlogRowMetadata = Oci.MysqlService.Models.ConfigurationVariables.BinlogRowMetadataEnum.Minimal,
					BinlogRowValueOptions = "EXAMPLE-binlogRowValueOptions-Value",
					BinlogTransactionCompression = true,
					InnodbBufferPoolSize = 8098096741705496576,
					InnodbFtResultCacheLimit = 3604983869,
					MaxBinlogCacheSize = 24786034429355,
					MaxConnectErrors = 3399468933579242497,
					MaxHeapTableSize = 4483674865779630080,
					MaxConnections = 89692,
					MaxPreparedStmtCount = 2528709,
					ConnectTimeout = 22220248,
					CteMaxRecursionDepth = 2861326623,
					GeneratedRandomPasswordLength = 201,
					InformationSchemaStatsExpiry = 19881588,
					InnodbBufferPoolDumpPct = 70,
					InnodbBufferPoolInstances = 12,
					InnodbDdlBufferSize = 3272053468,
					InnodbDdlThreads = 11,
					InnodbFtMaxTokenSize = 24,
					InnodbFtMinTokenSize = 2,
					InnodbFtNumWordOptimize = 435,
					InnodbLockWaitTimeout = 184399748,
					InnodbMaxPurgeLag = 1366164132,
					InnodbMaxPurgeLagDelay = 974762,
					InteractiveTimeout = 29110522,
					InnodbStatsPersistentSamplePages = 6877613160793900033,
					InnodbStatsTransientSamplePages = 1267561336862729217,
					InnodbStrictMode = true,
					MaxAllowedPacket = 350860917,
					MaxExecutionTime = 7519941546630520832,
					MysqlxConnectTimeout = 280733106,
					MysqlxDocumentIdUniquePrefix = 14735,
					MysqlxIdleWorkerThreadTimeout = 2921,
					MysqlxInteractiveTimeout = 1234535,
					MysqlxMaxAllowedPacket = 588307703,
					MysqlxMinWorkerThreads = 89,
					MysqlxReadTimeout = 1058485,
					MysqlxWaitTimeout = 595705,
					MysqlxWriteTimeout = 802601,
					NetReadTimeout = 7957131,
					NetWriteTimeout = 26772581,
					ParserMaxMemSize = 3893012949348741760,
					QueryAllocBlockSize = 1345409060,
					QueryPreallocSize = 6193411999593004032,
					RegexpTimeLimit = 701277587,
					SqlMode = "EXAMPLE-sqlMode-Value",
					TmpTableSize = 8713854309817970688,
					MysqlxDeflateDefaultCompressionLevel = 7,
					MysqlxDeflateMaxClientCompressionLevel = 8,
					MysqlxLz4MaxClientCompressionLevel = 12,
					MysqlxLz4DefaultCompressionLevel = 7,
					MysqlxZstdMaxClientCompressionLevel = 6,
					MysqlxZstdDefaultCompressionLevel = 5,
					MysqlZstdDefaultCompressionLevel = 17,
					SortBufferSize = 4607488013540088832,
					WaitTimeout = 389746,
					ThreadPoolDedicatedListeners = true,
					ThreadPoolMaxTransactionsLimit = 69243,
					TimeZone = "EXAMPLE-timeZone-Value",
					BlockEncryptionMode = "EXAMPLE-blockEncryptionMode-Value",
					BinlogGroupCommitSyncDelay = 970162,
					BinlogGroupCommitSyncNoDelayCount = 78908,
					ReplicaNetTimeout = 13458062,
					RequireSecureTransport = true,
					InnodbRedoLogCapacity = 65666006488,
					ThreadPoolTransactionDelay = 232463,
					ThreadPoolQueryThreadsPerGroup = 3975,
					ExplainFormat = Oci.MysqlService.Models.ConfigurationVariables.ExplainFormatEnum.Traditional,
					ExplicitDefaultsForTimestamp = false,
					SqlGenerateInvisiblePrimaryKey = false,
					TemptableMaxRam = 6519074253891020800,
					InnodbChangeBuffering = Oci.MysqlService.Models.ConfigurationVariables.InnodbChangeBufferingEnum.Inserts,
					InnodbAdaptiveHashIndex = false,
					InnodbUndoLogTruncate = true,
					TableDefinitionCache = 141435,
					TableOpenCache = 285084,
					RelayLogSpaceLimit = 2364757315198755840,
					OptimizerSwitch = "EXAMPLE-optimizerSwitch-Value",
					ReplicaTypeConversions = "EXAMPLE-replicaTypeConversions-Value",
					ReplicaParallelWorkers = 1000,
					SkipNameResolve = true,
					MaxUserConnections = 1949843097,
					JoinBufferSize = 4618923067192405120,
					MaxSeeksForKey = 3458653935116181505,
					RangeOptimizerMaxMemSize = 52651314980720640,
					AutoIncrementIncrement = 31408,
					AutoIncrementOffset = 12913,
					InnodbAutoincLockMode = 800,
					InnodbRollbackOnTimeout = true,
					InnodbOnlineAlterLogMaxSize = 426346892848027712,
					InnodbSortBufferSize = 56108336,
					InnodbNumaInterleave = true,
					ThreadPoolSize = 205,
					LongQueryTime = 28829691
				},
				Options = new List<Oci.MysqlService.Models.Option>
				{
					new Oci.MysqlService.Models.Option
					{
						Name = "EXAMPLE-name-Value",
						Value = "EXAMPLE-value-Value"
					}
				},
				ParentConfigurationId = "ocid1.test.oc1..<unique_ID>EXAMPLE-parentConfigurationId-Value",
				FreeformTags = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_lJGLG", 
						"EXAMPLE_VALUE_oiHiuJo1f3D67Y32X56M"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_lKbOm", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_Abngw", 
								"EXAMPLE--Value"
							}
						}
					}
				}
			};
			var createConfigurationRequest = new Oci.MysqlService.Requests.CreateConfigurationRequest
			{
				CreateConfigurationDetails = createConfigurationDetails,
				OpcRequestId = "BX97OZAVTPNHR4EZTNGP<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 MysqlaasClient(provider, new ClientConfiguration()))
				{
					var response = await client.CreateConfiguration(createConfigurationRequest);
					// Retrieve value from the response.
					var id = response.Configuration.Id;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"CreateConfiguration Failed with {e.Message}");
                throw e;
            }
        }

    }
}