// 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 = true,
					CharacterSetServer = Oci.MysqlService.Models.ConfigurationVariables.CharacterSetServerEnum.Cp1256,
					CollationServer = Oci.MysqlService.Models.ConfigurationVariables.CollationServerEnum.Latin1Bin,
					ConnectionMemoryChunkSize = 380380806,
					ConnectionMemoryLimit = 4387008475337611264,
					DefaultAuthenticationPlugin = Oci.MysqlService.Models.ConfigurationVariables.DefaultAuthenticationPluginEnum.CachingSha2Password,
					GlobalConnectionMemoryLimit = 3298510521201713664,
					GlobalConnectionMemoryTracking = false,
					TransactionIsolation = Oci.MysqlService.Models.ConfigurationVariables.TransactionIsolationEnum.RepeatableRead,
					InnodbFtServerStopwordTable = "EXAMPLE-innodbFtServerStopwordTable-Value",
					MandatoryRoles = "EXAMPLE-mandatoryRoles-Value",
					Autocommit = false,
					ForeignKeyChecks = false,
					GroupReplicationConsistency = Oci.MysqlService.Models.ConfigurationVariables.GroupReplicationConsistencyEnum.Eventual,
					GroupConcatMaxLen = 3590919733670338564,
					InnodbFtEnableStopword = false,
					InnodbLogWriterThreads = false,
					LocalInfile = false,
					MysqlFirewallMode = true,
					MysqlxEnableHelloNotice = true,
					SqlRequirePrimaryKey = false,
					SqlWarnings = true,
					BinlogExpireLogsSeconds = 531,
					BinlogRowMetadata = Oci.MysqlService.Models.ConfigurationVariables.BinlogRowMetadataEnum.Full,
					BinlogRowValueOptions = "EXAMPLE-binlogRowValueOptions-Value",
					BinlogTransactionCompression = true,
					InnodbBufferPoolSize = 6366429385001156608,
					InnodbFtResultCacheLimit = 4099068069,
					MaxBinlogCacheSize = 60278838642952,
					MaxConnectErrors = 3665642797178460161,
					MaxHeapTableSize = 5579938257857499136,
					MaxConnections = 93267,
					MaxPreparedStmtCount = 1817543,
					ConnectTimeout = 11919881,
					CteMaxRecursionDepth = 3118493670,
					GeneratedRandomPasswordLength = 130,
					InformationSchemaStatsExpiry = 26388713,
					InnodbBufferPoolDumpPct = 41,
					InnodbBufferPoolInstances = 61,
					InnodbDdlBufferSize = 3162936006,
					InnodbDdlThreads = 23,
					InnodbFtMaxTokenSize = 80,
					InnodbFtMinTokenSize = 14,
					InnodbFtNumWordOptimize = 555,
					InnodbLockWaitTimeout = 119328381,
					InnodbMaxPurgeLag = 771709845,
					InnodbMaxPurgeLagDelay = 878094,
					InteractiveTimeout = 2804087,
					InnodbStatsPersistentSamplePages = 3659282530383915009,
					InnodbStatsTransientSamplePages = 7196408566589107201,
					InnodbStrictMode = true,
					MaxAllowedPacket = 196696249,
					MaxExecutionTime = 1994805776495681536,
					MysqlxConnectTimeout = 973366251,
					MysqlxDocumentIdUniquePrefix = 62350,
					MysqlxIdleWorkerThreadTimeout = 3217,
					MysqlxInteractiveTimeout = 620319,
					MysqlxMaxAllowedPacket = 982667507,
					MysqlxMinWorkerThreads = 57,
					MysqlxReadTimeout = 274862,
					MysqlxWaitTimeout = 1835205,
					MysqlxWriteTimeout = 1178497,
					NetReadTimeout = 25708755,
					NetWriteTimeout = 17991603,
					ParserMaxMemSize = 1991800507156759168,
					QueryAllocBlockSize = 4091108505,
					QueryPreallocSize = 6809232948892748800,
					RegexpTimeLimit = 244131562,
					SqlMode = "EXAMPLE-sqlMode-Value",
					TmpTableSize = 6623572353101249536,
					MysqlxDeflateDefaultCompressionLevel = 4,
					MysqlxDeflateMaxClientCompressionLevel = 1,
					MysqlxLz4MaxClientCompressionLevel = 9,
					MysqlxLz4DefaultCompressionLevel = 6,
					MysqlxZstdMaxClientCompressionLevel = 5,
					MysqlxZstdDefaultCompressionLevel = 5,
					MysqlZstdDefaultCompressionLevel = 6,
					SortBufferSize = 2094466539454584576,
					WaitTimeout = 1446323,
					ThreadPoolDedicatedListeners = true,
					ThreadPoolMaxTransactionsLimit = 32791,
					TimeZone = "EXAMPLE-timeZone-Value",
					BlockEncryptionMode = "EXAMPLE-blockEncryptionMode-Value",
					BinlogGroupCommitSyncDelay = 783714,
					BinlogGroupCommitSyncNoDelayCount = 42734,
					ReplicaNetTimeout = 6690852,
					RequireSecureTransport = false,
					InnodbRedoLogCapacity = 17619000907,
					ThreadPoolTransactionDelay = 185744,
					ThreadPoolQueryThreadsPerGroup = 67,
					ExplainFormat = Oci.MysqlService.Models.ConfigurationVariables.ExplainFormatEnum.Tree,
					ExplicitDefaultsForTimestamp = true,
					SqlGenerateInvisiblePrimaryKey = false,
					TemptableMaxRam = 238381257221451840,
					InnodbChangeBuffering = Oci.MysqlService.Models.ConfigurationVariables.InnodbChangeBufferingEnum.Changes,
					InnodbAdaptiveHashIndex = false,
					InnodbUndoLogTruncate = true,
					TableDefinitionCache = 26536,
					TableOpenCache = 328340,
					RelayLogSpaceLimit = 8674122111764927488,
					OptimizerSwitch = "EXAMPLE-optimizerSwitch-Value",
					ReplicaTypeConversions = "EXAMPLE-replicaTypeConversions-Value",
					ReplicaParallelWorkers = 704,
					SkipNameResolve = true,
					MaxUserConnections = 1248152560,
					JoinBufferSize = 3360985659902950528,
					MaxSeeksForKey = 4592445279013950465,
					RangeOptimizerMaxMemSize = 2269425693593030656,
					AutoIncrementIncrement = 21668,
					AutoIncrementOffset = 23727,
					InnodbAutoincLockMode = 901,
					InnodbRollbackOnTimeout = true,
					InnodbOnlineAlterLogMaxSize = 2081573501828304384,
					InnodbSortBufferSize = 20962540,
					InnodbNumaInterleave = false,
					ThreadPoolSize = 24,
					LongQueryTime = 11173927
				},
				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_N6ORl", 
						"EXAMPLE_VALUE_5TUOM0BmGPkuuHmT2UfK"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_4PQnU", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_YFIxe", 
								"EXAMPLE--Value"
							}
						}
					}
				}
			};
			var createConfigurationRequest = new Oci.MysqlService.Requests.CreateConfigurationRequest
			{
				CreateConfigurationDetails = createConfigurationDetails,
				OpcRequestId = "4UTHUNVMXOILO1EY0VOW<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;
            }
        }

    }
}