// 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.CaseInsensitiveLowercase
				},
				Variables = new Oci.MysqlService.Models.ConfigurationVariables
				{
					CompletionType = Oci.MysqlService.Models.ConfigurationVariables.CompletionTypeEnum.NoChain,
					BigTables = true,
					CharacterSetServer = Oci.MysqlService.Models.ConfigurationVariables.CharacterSetServerEnum.Geostd8,
					CollationServer = Oci.MysqlService.Models.ConfigurationVariables.CollationServerEnum.Cp852Bin,
					ConnectionMemoryChunkSize = 281600798,
					ConnectionMemoryLimit = 6011738433163516928,
					DefaultAuthenticationPlugin = Oci.MysqlService.Models.ConfigurationVariables.DefaultAuthenticationPluginEnum.CachingSha2Password,
					GlobalConnectionMemoryLimit = 2304151386949139968,
					GlobalConnectionMemoryTracking = false,
					TransactionIsolation = Oci.MysqlService.Models.ConfigurationVariables.TransactionIsolationEnum.ReadCommited,
					InnodbFtServerStopwordTable = "EXAMPLE-innodbFtServerStopwordTable-Value",
					MandatoryRoles = "EXAMPLE-mandatoryRoles-Value",
					Autocommit = true,
					ForeignKeyChecks = true,
					GroupReplicationConsistency = Oci.MysqlService.Models.ConfigurationVariables.GroupReplicationConsistencyEnum.Before,
					GroupConcatMaxLen = 7590169435829819396,
					InnodbFtEnableStopword = true,
					InnodbLogWriterThreads = true,
					LocalInfile = true,
					MysqlFirewallMode = false,
					MysqlxEnableHelloNotice = true,
					SqlRequirePrimaryKey = false,
					SqlWarnings = true,
					BinlogExpireLogsSeconds = 923,
					BinlogRowMetadata = Oci.MysqlService.Models.ConfigurationVariables.BinlogRowMetadataEnum.Full,
					BinlogRowValueOptions = "EXAMPLE-binlogRowValueOptions-Value",
					BinlogTransactionCompression = false,
					InnodbBufferPoolSize = 6207749100368669696,
					InnodbFtResultCacheLimit = 2467072078,
					MaxBinlogCacheSize = 12033362272632,
					MaxConnectErrors = 6178770100217242625,
					MaxHeapTableSize = 8578684187076666368,
					MaxConnections = 37656,
					MaxPreparedStmtCount = 827285,
					ConnectTimeout = 1602022,
					CteMaxRecursionDepth = 3464366750,
					GeneratedRandomPasswordLength = 27,
					InformationSchemaStatsExpiry = 18591656,
					InnodbBufferPoolDumpPct = 76,
					InnodbBufferPoolInstances = 40,
					InnodbDdlBufferSize = 1742062615,
					InnodbDdlThreads = 58,
					InnodbFtMaxTokenSize = 41,
					InnodbFtMinTokenSize = 9,
					InnodbFtNumWordOptimize = 83,
					InnodbLockWaitTimeout = 184538924,
					InnodbMaxPurgeLag = 3041542029,
					InnodbMaxPurgeLagDelay = 969163,
					InteractiveTimeout = 1092478,
					InnodbStatsPersistentSamplePages = 4548184915912740865,
					InnodbStatsTransientSamplePages = 4428244537098810369,
					InnodbStrictMode = false,
					MaxAllowedPacket = 817922352,
					MaxExecutionTime = 2515809402232956928,
					MysqlxConnectTimeout = 630795672,
					MysqlxDocumentIdUniquePrefix = 33429,
					MysqlxIdleWorkerThreadTimeout = 740,
					MysqlxInteractiveTimeout = 407984,
					MysqlxMaxAllowedPacket = 266973087,
					MysqlxMinWorkerThreads = 85,
					MysqlxReadTimeout = 1857964,
					MysqlxWaitTimeout = 763372,
					MysqlxWriteTimeout = 1637095,
					NetReadTimeout = 26338513,
					NetWriteTimeout = 9871521,
					ParserMaxMemSize = 430749321457333824,
					QueryAllocBlockSize = 1431722280,
					QueryPreallocSize = 2276736361330535424,
					RegexpTimeLimit = 1361750399,
					SqlMode = "EXAMPLE-sqlMode-Value",
					TmpTableSize = 7420685828326978560,
					MysqlxDeflateDefaultCompressionLevel = 5,
					MysqlxDeflateMaxClientCompressionLevel = 6,
					MysqlxLz4MaxClientCompressionLevel = 10,
					MysqlxLz4DefaultCompressionLevel = 4,
					MysqlxZstdMaxClientCompressionLevel = 17,
					MysqlxZstdDefaultCompressionLevel = 13,
					MysqlZstdDefaultCompressionLevel = 6,
					SortBufferSize = 4131506752140026368,
					WaitTimeout = 1012066,
					ThreadPoolDedicatedListeners = false,
					ThreadPoolMaxTransactionsLimit = 13193,
					TimeZone = "EXAMPLE-timeZone-Value",
					BlockEncryptionMode = "EXAMPLE-blockEncryptionMode-Value",
					BinlogGroupCommitSyncDelay = 247004,
					BinlogGroupCommitSyncNoDelayCount = 8606,
					ReplicaNetTimeout = 10658491,
					RequireSecureTransport = false,
					InnodbRedoLogCapacity = 103124310447,
					ThreadPoolTransactionDelay = 7849,
					ThreadPoolQueryThreadsPerGroup = 1370,
					ExplainFormat = Oci.MysqlService.Models.ConfigurationVariables.ExplainFormatEnum.Traditional,
					ExplicitDefaultsForTimestamp = false,
					SqlGenerateInvisiblePrimaryKey = false,
					TemptableMaxRam = 6042935619977159680,
					InnodbChangeBuffering = Oci.MysqlService.Models.ConfigurationVariables.InnodbChangeBufferingEnum.Purges,
					InnodbAdaptiveHashIndex = true,
					InnodbUndoLogTruncate = false,
					TableDefinitionCache = 180882,
					TableOpenCache = 470054,
					RelayLogSpaceLimit = 4332040366787604480,
					OptimizerSwitch = "EXAMPLE-optimizerSwitch-Value",
					ReplicaTypeConversions = "EXAMPLE-replicaTypeConversions-Value",
					ReplicaParallelWorkers = 570,
					SkipNameResolve = true,
					MaxUserConnections = 2190805421,
					JoinBufferSize = 205506804319571072,
					MaxSeeksForKey = 4780470942100386817,
					RangeOptimizerMaxMemSize = 1766529747711411200,
					AutoIncrementIncrement = 33755,
					AutoIncrementOffset = 56174,
					InnodbAutoincLockMode = 621,
					InnodbRollbackOnTimeout = false,
					InnodbOnlineAlterLogMaxSize = 8941577504901864448,
					InnodbSortBufferSize = 57049549,
					InnodbNumaInterleave = true,
					ThreadPoolSize = 358,
					LongQueryTime = 4612292
				},
				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_Jwsky", 
						"EXAMPLE_VALUE_FebYZvqy0aBxL6Sdiz9j"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_zPzPe", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_STxUP", 
								"EXAMPLE--Value"
							}
						}
					}
				}
			};
			var createConfigurationRequest = new Oci.MysqlService.Requests.CreateConfigurationRequest
			{
				CreateConfigurationDetails = createConfigurationDetails,
				OpcRequestId = "EWZZGXYXBRGEGCY0NDGO<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;
            }
        }

    }
}