// 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.Armscii8,
					CollationServer = Oci.MysqlService.Models.ConfigurationVariables.CollationServerEnum.EucjpmsBin,
					ConnectionMemoryChunkSize = 22962945,
					ConnectionMemoryLimit = 4535887233147313152,
					DefaultAuthenticationPlugin = Oci.MysqlService.Models.ConfigurationVariables.DefaultAuthenticationPluginEnum.CachingSha2Password,
					GlobalConnectionMemoryLimit = 2154853687122263552,
					GlobalConnectionMemoryTracking = true,
					TransactionIsolation = Oci.MysqlService.Models.ConfigurationVariables.TransactionIsolationEnum.ReadCommitted,
					InnodbFtServerStopwordTable = "EXAMPLE-innodbFtServerStopwordTable-Value",
					MandatoryRoles = "EXAMPLE-mandatoryRoles-Value",
					Autocommit = false,
					ForeignKeyChecks = false,
					GroupReplicationConsistency = Oci.MysqlService.Models.ConfigurationVariables.GroupReplicationConsistencyEnum.BeforeOnPrimaryFailover,
					GroupConcatMaxLen = 8171782700016249860,
					InnodbFtEnableStopword = true,
					InnodbLogWriterThreads = true,
					LocalInfile = false,
					MysqlFirewallMode = false,
					MysqlxEnableHelloNotice = true,
					SqlRequirePrimaryKey = true,
					SqlWarnings = false,
					BinlogExpireLogsSeconds = 711,
					BinlogRowMetadata = Oci.MysqlService.Models.ConfigurationVariables.BinlogRowMetadataEnum.Full,
					BinlogRowValueOptions = "EXAMPLE-binlogRowValueOptions-Value",
					BinlogTransactionCompression = true,
					InnodbBufferPoolSize = 7800092847453232128,
					InnodbFtResultCacheLimit = 1740936595,
					MaxBinlogCacheSize = 27328089591608,
					MaxConnectErrors = 1719369702728024065,
					MaxHeapTableSize = 1607160388828142848,
					MaxConnections = 40249,
					MaxPreparedStmtCount = 2813756,
					ConnectTimeout = 2360891,
					CteMaxRecursionDepth = 1122819488,
					GeneratedRandomPasswordLength = 137,
					InformationSchemaStatsExpiry = 26494051,
					InnodbBufferPoolDumpPct = 51,
					InnodbBufferPoolInstances = 12,
					InnodbDdlBufferSize = 4248917659,
					InnodbDdlThreads = 22,
					InnodbFtMaxTokenSize = 70,
					InnodbFtMinTokenSize = 13,
					InnodbFtNumWordOptimize = 789,
					InnodbLockWaitTimeout = 68894507,
					InnodbMaxPurgeLag = 2197845304,
					InnodbMaxPurgeLagDelay = 548158,
					InteractiveTimeout = 2579791,
					InnodbStatsPersistentSamplePages = 9068272854687135745,
					InnodbStatsTransientSamplePages = 4693389852321451009,
					InnodbStrictMode = false,
					MaxAllowedPacket = 145968120,
					MaxExecutionTime = 8238720083855443968,
					MysqlxConnectTimeout = 791298321,
					MysqlxDocumentIdUniquePrefix = 31089,
					MysqlxIdleWorkerThreadTimeout = 440,
					MysqlxInteractiveTimeout = 890423,
					MysqlxMaxAllowedPacket = 1056773022,
					MysqlxMinWorkerThreads = 56,
					MysqlxReadTimeout = 1246984,
					MysqlxWaitTimeout = 335191,
					MysqlxWriteTimeout = 39799,
					NetReadTimeout = 1909586,
					NetWriteTimeout = 18405839,
					ParserMaxMemSize = 8452961434313550464,
					QueryAllocBlockSize = 1193024868,
					QueryPreallocSize = 769496249764325760,
					RegexpTimeLimit = 79014387,
					SqlMode = "EXAMPLE-sqlMode-Value",
					TmpTableSize = 306336902757653440,
					MysqlxDeflateDefaultCompressionLevel = 6,
					MysqlxDeflateMaxClientCompressionLevel = 6,
					MysqlxLz4MaxClientCompressionLevel = 14,
					MysqlxLz4DefaultCompressionLevel = 6,
					MysqlxZstdMaxClientCompressionLevel = 8,
					MysqlxZstdDefaultCompressionLevel = 16,
					MysqlZstdDefaultCompressionLevel = 2,
					SortBufferSize = 8647596805367231488,
					WaitTimeout = 1239937,
					ThreadPoolDedicatedListeners = true,
					ThreadPoolMaxTransactionsLimit = 24774,
					TimeZone = "EXAMPLE-timeZone-Value",
					BlockEncryptionMode = "EXAMPLE-blockEncryptionMode-Value",
					BinlogGroupCommitSyncDelay = 106816,
					BinlogGroupCommitSyncNoDelayCount = 35855,
					ReplicaNetTimeout = 12215607,
					RequireSecureTransport = true,
					InnodbRedoLogCapacity = 37454534569,
					ThreadPoolTransactionDelay = 205704,
					ThreadPoolQueryThreadsPerGroup = 3937,
					ExplainFormat = Oci.MysqlService.Models.ConfigurationVariables.ExplainFormatEnum.Json,
					ExplicitDefaultsForTimestamp = true,
					SqlGenerateInvisiblePrimaryKey = false,
					TemptableMaxRam = 1234843570939826944,
					InnodbChangeBuffering = Oci.MysqlService.Models.ConfigurationVariables.InnodbChangeBufferingEnum.Changes,
					InnodbAdaptiveHashIndex = true,
					InnodbUndoLogTruncate = false,
					TableDefinitionCache = 328181,
					TableOpenCache = 314861,
					RelayLogSpaceLimit = 8969785359265581056,
					OptimizerSwitch = "EXAMPLE-optimizerSwitch-Value",
					ReplicaTypeConversions = "EXAMPLE-replicaTypeConversions-Value",
					ReplicaParallelWorkers = 656,
					SkipNameResolve = true,
					MaxUserConnections = 1291701965,
					JoinBufferSize = 1829961648565166208,
					MaxSeeksForKey = 4038183146689092609,
					RangeOptimizerMaxMemSize = 8683482441382566912,
					AutoIncrementIncrement = 54425,
					AutoIncrementOffset = 32218,
					InnodbAutoincLockMode = 547,
					InnodbRollbackOnTimeout = false,
					InnodbOnlineAlterLogMaxSize = 6408091733271306240,
					InnodbSortBufferSize = 57258402,
					InnodbNumaInterleave = false,
					ThreadPoolSize = 262,
					LongQueryTime = 28223644
				},
				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_bFGG2", 
						"EXAMPLE_VALUE_HEwTgu0IsYjAnunpiSRP"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_LDiOY", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_gPu7S", 
								"EXAMPLE--Value"
							}
						}
					}
				}
			};
			var createConfigurationRequest = new Oci.MysqlService.Requests.CreateConfigurationRequest
			{
				CreateConfigurationDetails = createConfigurationDetails,
				OpcRequestId = "HR8CDY3JFIARLYYQ7PUN<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;
            }
        }

    }
}