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

package main

import (
	"context"
	"fmt"

	"github.com/oracle/oci-go-sdk/v65/common"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
	"github.com/oracle/oci-go-sdk/v65/mysql"
)

func ExampleCreateConfiguration() {
	// 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.
	client, err := mysql.NewMysqlaasClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

	// Create a request and dependent object(s).

	req := mysql.CreateConfigurationRequest{CreateConfigurationDetails: mysql.CreateConfigurationDetails{DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_4Fmzz": map[string]interface{}{"EXAMPLE_KEY_4VZrM": "EXAMPLE--Value"}},
		Description:   common.String("EXAMPLE-description-Value"),
		FreeformTags:  map[string]string{"EXAMPLE_KEY_4R6mC": "EXAMPLE_VALUE_7piZGLY1wYQrXz1M4RMk"},
		InitVariables: &mysql.InitializationVariables{LowerCaseTableNames: mysql.InitializationVariablesLowerCaseTableNamesInsensitiveLowercase},
		ShapeName:     common.String("EXAMPLE-shapeName-Value"),
		Variables: &mysql.ConfigurationVariables{ReplicaNetTimeout: common.Int(1.7627575e+07),
			InnodbChangeBuffering:                  mysql.ConfigurationVariablesInnodbChangeBufferingChanges,
			MandatoryRoles:                         common.String("EXAMPLE-mandatoryRoles-Value"),
			MaxAllowedPacket:                       common.Int(6.63164371e+08),
			MysqlxWriteTimeout:                     common.Int(811588),
			InnodbFtEnableStopword:                 common.Bool(true),
			MysqlxInteractiveTimeout:               common.Int(1.74212e+06),
			RegexpTimeLimit:                        common.Int(7.29054176e+08),
			BigTables:                              common.Bool(false),
			ConnectTimeout:                         common.Int(2.2886545e+07),
			JoinBufferSize:                         common.Int64(2.668598268027902e+18),
			MaxConnectErrors:                       common.Int64(4.505858517201705e+17),
			LongQueryTime:                          common.Int(1.59036e+07),
			MysqlxConnectTimeout:                   common.Int(1.80427079e+08),
			MysqlxDocumentIdUniquePrefix:           common.Int(36306),
			ParserMaxMemSize:                       common.Int64(8.633231096411046e+18),
			InnodbAutoincLockMode:                  common.Int(860),
			NetWriteTimeout:                        common.Int(2.1717767e+07),
			BinlogTransactionCompression:           common.Bool(false),
			CompletionType:                         mysql.ConfigurationVariablesCompletionTypeNoChain,
			ExplainFormat:                          mysql.ConfigurationVariablesExplainFormatTree,
			ForeignKeyChecks:                       common.Bool(true),
			ConnectionMemoryChunkSize:              common.Int(3.04324116e+08),
			GlobalConnectionMemoryTracking:         common.Bool(false),
			InnodbFtNumWordOptimize:                common.Int(965),
			MysqlxMaxAllowedPacket:                 common.Int(4.01388117e+08),
			SortBufferSize:                         common.Int64(6.388568887567815e+18),
			CollationServer:                        mysql.ConfigurationVariablesCollationServerUtf32HungarianCi,
			GlobalConnectionMemoryLimit:            common.Int64(6.576373655305147e+18),
			MysqlZstdDefaultCompressionLevel:       common.Int(16),
			MysqlxZstdMaxClientCompressionLevel:    common.Int(10),
			TableOpenCache:                         common.Int(312132),
			ThreadPoolSize:                         common.Int(425),
			InnodbFtMaxTokenSize:                   common.Int(67),
			InnodbSortBufferSize:                   common.Int(6.1769424e+07),
			MaxUserConnections:                     common.Int64(1.533674438e+09),
			MysqlxZstdDefaultCompressionLevel:      common.Int(12),
			CharacterSetServer:                     mysql.ConfigurationVariablesCharacterSetServerTis620,
			MysqlxMinWorkerThreads:                 common.Int(27),
			RequireSecureTransport:                 common.Bool(true),
			SqlRequirePrimaryKey:                   common.Bool(true),
			SqlMode:                                common.String("EXAMPLE-sqlMode-Value"),
			ThreadPoolQueryThreadsPerGroup:         common.Int(1651),
			InnodbDdlBufferSize:                    common.Int64(3.834742727e+09),
			InnodbFtServerStopwordTable:            common.String("EXAMPLE-innodbFtServerStopwordTable-Value"),
			InnodbMaxPurgeLag:                      common.Int64(1.997599926e+09),
			MysqlxWaitTimeout:                      common.Int(1.72579e+06),
			InnodbBufferPoolSize:                   common.Int64(3.316361258151261e+18),
			InnodbFtMinTokenSize:                   common.Int(9),
			InnodbNumaInterleave:                   common.Bool(false),
			ThreadPoolDedicatedListeners:           common.Bool(false),
			InnodbFtResultCacheLimit:               common.Int64(4.74601545e+08),
			InnodbLogWriterThreads:                 common.Bool(true),
			InnodbRedoLogCapacity:                  common.Int64(1.1497302601e+10),
			InnodbRollbackOnTimeout:                common.Bool(false),
			MysqlxReadTimeout:                      common.Int(1.672547e+06),
			TmpTableSize:                           common.Int64(8.243646169611312e+18),
			InformationSchemaStatsExpiry:           common.Int(3.1143031e+07),
			InnodbDdlThreads:                       common.Int(44),
			LocalInfile:                            common.Bool(true),
			MaxHeapTableSize:                       common.Int64(3.472019393803858e+18),
			InnodbAdaptiveHashIndex:                common.Bool(false),
			MysqlxDeflateMaxClientCompressionLevel: common.Int(6),
			QueryPreallocSize:                      common.Int64(1.5770203343337254e+18),
			ReplicaParallelWorkers:                 common.Int(502),
			DefaultAuthenticationPlugin:            mysql.ConfigurationVariablesDefaultAuthenticationPluginCachingSha2Password,
			QueryAllocBlockSize:                    common.Int64(3.276394772e+09),
			TransactionIsolation:                   mysql.ConfigurationVariablesTransactionIsolationReadUncommitted,
			MysqlxLz4DefaultCompressionLevel:       common.Int(10),
			RelayLogSpaceLimit:                     common.Int64(6.358600315262233e+18),
			ReplicaTypeConversions:                 common.String("EXAMPLE-replicaTypeConversions-Value"),
			TimeZone:                               common.String("EXAMPLE-timeZone-Value"),
			InnodbMaxPurgeLagDelay:                 common.Int(133078),
			MaxBinlogCacheSize:                     common.Int64(1.2339514314787e+13),
			MaxPreparedStmtCount:                   common.Int(1.71978e+06),
			MaxSeeksForKey:                         common.Int64(8.815374034191473e+18),
			WaitTimeout:                            common.Int(721521),
			BinlogGroupCommitSyncDelay:             common.Int(108868),
			BinlogRowValueOptions:                  common.String("EXAMPLE-binlogRowValueOptions-Value"),
			InnodbOnlineAlterLogMaxSize:            common.Int64(3.6799333708717993e+18),
			InteractiveTimeout:                     common.Int(1.429223e+07),
			GeneratedRandomPasswordLength:          common.Int(135),
			InnodbStrictMode:                       common.Bool(false),
			MysqlFirewallMode:                      common.Bool(false),
			TemptableMaxRam:                        common.Int64(5.5624801247468184e+16),
			GroupReplicationConsistency:            mysql.ConfigurationVariablesGroupReplicationConsistencyBeforeOnPrimaryFailover,
			InnodbBufferPoolInstances:              common.Int(33),
			MaxExecutionTime:                       common.Int64(8.238584095732027e+18),
			MysqlxEnableHelloNotice:                common.Bool(false),
			BlockEncryptionMode:                    common.String("EXAMPLE-blockEncryptionMode-Value"),
			InnodbStatsTransientSamplePages:        common.Int64(4.179431143681356e+18),
			TableDefinitionCache:                   common.Int(428120),
			AutoIncrementIncrement:                 common.Int(49981),
			CteMaxRecursionDepth:                   common.Int64(7.2076094e+07),
			InnodbStatsPersistentSamplePages:       common.Int64(6.493196105289483e+18),
			AutoIncrementOffset:                    common.Int(22536),
			InnodbUndoLogTruncate:                  common.Bool(false),
			RangeOptimizerMaxMemSize:               common.Int64(5.590887032828563e+18),
			SqlGenerateInvisiblePrimaryKey:         common.Bool(false),
			Autocommit:                             common.Bool(true),
			BinlogGroupCommitSyncNoDelayCount:      common.Int(31540),
			GroupConcatMaxLen:                      common.Int64(7.664407665506115e+18),
			NetReadTimeout:                         common.Int(4.71818e+06),
			MysqlxDeflateDefaultCompressionLevel:   common.Int(4),
			MaxConnections:                         common.Int(86654),
			MysqlxIdleWorkerThreadTimeout:          common.Int(1977),
			OptimizerSwitch:                        common.String("EXAMPLE-optimizerSwitch-Value"),
			BinlogExpireLogsSeconds:                common.Int(281),
			BinlogRowMetadata:                      mysql.ConfigurationVariablesBinlogRowMetadataMinimal,
			InnodbBufferPoolDumpPct:                common.Int(77),
			InnodbLockWaitTimeout:                  common.Int(2.76383728e+08),
			SkipNameResolve:                        common.Bool(false),
			ThreadPoolTransactionDelay:             common.Int(287144),
			ConnectionMemoryLimit:                  common.Int64(4.0907451585297485e+18),
			ExplicitDefaultsForTimestamp:           common.Bool(false),
			MysqlxLz4MaxClientCompressionLevel:     common.Int(8),
			ThreadPoolMaxTransactionsLimit:         common.Int(59624),
			SqlWarnings:                            common.Bool(false)},
		CompartmentId:         common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		DisplayName:           common.String("EXAMPLE-displayName-Value"),
		ParentConfigurationId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-parentConfigurationId-Value")},
		OpcRequestId:  common.String("4MGHQZ5RZHRIAYPKCLUS<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value")}

	// Send the request using the service client
	resp, err := client.CreateConfiguration(context.Background(), req)
	helpers.FatalIfError(err)

	// Retrieve value from the response.
	fmt.Println(resp)
}