// 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{OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		CreateConfigurationDetails: mysql.CreateConfigurationDetails{DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_LPih8": map[string]interface{}{"EXAMPLE_KEY_On05A": "EXAMPLE--Value"}},
			Description: common.String("EXAMPLE-description-Value"),
			Options: []mysql.Option{mysql.Option{Name: common.String("EXAMPLE-name-Value"),
				Value: common.String("EXAMPLE-value-Value")}},
			ParentConfigurationId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-parentConfigurationId-Value"),
			ShapeName:             common.String("EXAMPLE-shapeName-Value"),
			Variables: &mysql.ConfigurationVariables{InnodbFtNumWordOptimize: common.Int(724),
				ParserMaxMemSize:                       common.Int64(2.1722730140251274e+18),
				MaxConnections:                         common.Int(63520),
				MaxPreparedStmtCount:                   common.Int(2.469864e+06),
				NetReadTimeout:                         common.Int(1.579535e+06),
				SqlRequirePrimaryKey:                   common.Bool(false),
				InnodbRollbackOnTimeout:                common.Bool(false),
				MandatoryRoles:                         common.String("EXAMPLE-mandatoryRoles-Value"),
				Autocommit:                             common.Bool(true),
				BinlogGroupCommitSyncDelay:             common.Int(731798),
				QueryPreallocSize:                      common.Int64(9.150328300772467e+17),
				GlobalConnectionMemoryLimit:            common.Int64(3.573228688504505e+18),
				MysqlZstdDefaultCompressionLevel:       common.Int(17),
				MysqlxLz4MaxClientCompressionLevel:     common.Int(8),
				CompletionType:                         mysql.ConfigurationVariablesCompletionTypeChain,
				InnodbMaxPurgeLagDelay:                 common.Int(135071),
				InnodbStatsTransientSamplePages:        common.Int64(7.167122275510559e+18),
				InnodbStrictMode:                       common.Bool(false),
				RequireSecureTransport:                 common.Bool(true),
				MysqlxDeflateMaxClientCompressionLevel: common.Int(3),
				TableDefinitionCache:                   common.Int(294270),
				ThreadPoolDedicatedListeners:           common.Bool(false),
				TimeZone:                               common.String("EXAMPLE-timeZone-Value"),
				MaxBinlogCacheSize:                     common.Int64(3.1552135774037e+13),
				MysqlxDeflateDefaultCompressionLevel:   common.Int(8),
				MysqlxDocumentIdUniquePrefix:           common.Int(7558),
				SqlGenerateInvisiblePrimaryKey:         common.Bool(false),
				GlobalConnectionMemoryTracking:         common.Bool(false),
				BinlogRowMetadata:                      mysql.ConfigurationVariablesBinlogRowMetadataMinimal,
				InnodbDdlBufferSize:                    common.Int64(2.43776888e+09),
				InnodbDdlThreads:                       common.Int(33),
				InnodbStatsPersistentSamplePages:       common.Int64(7.811646694857264e+18),
				MaxUserConnections:                     common.Int64(2.911177115e+09),
				MysqlxIdleWorkerThreadTimeout:          common.Int(394),
				MysqlxZstdMaxClientCompressionLevel:    common.Int(8),
				DefaultAuthenticationPlugin:            mysql.ConfigurationVariablesDefaultAuthenticationPluginMysqlNativePassword,
				MysqlxZstdDefaultCompressionLevel:      common.Int(11),
				NetWriteTimeout:                        common.Int(1.3233284e+07),
				SqlWarnings:                            common.Bool(false),
				ThreadPoolSize:                         common.Int(146),
				InnodbMaxPurgeLag:                      common.Int64(2.487730623e+09),
				MysqlFirewallMode:                      common.Bool(true),
				BinlogExpireLogsSeconds:                common.Int(407),
				CharacterSetServer:                     mysql.ConfigurationVariablesCharacterSetServerMacce,
				InnodbAdaptiveHashIndex:                common.Bool(false),
				InnodbSortBufferSize:                   common.Int(2.3683559e+07),
				QueryAllocBlockSize:                    common.Int64(3.082401746e+09),
				GroupConcatMaxLen:                      common.Int64(2.143163684329216e+17),
				MysqlxWaitTimeout:                      common.Int(1.284936e+06),
				AutoIncrementIncrement:                 common.Int(43549),
				ThreadPoolQueryThreadsPerGroup:         common.Int(665),
				CteMaxRecursionDepth:                   common.Int64(4.071098232e+09),
				GeneratedRandomPasswordLength:          common.Int(26),
				InnodbChangeBuffering:                  mysql.ConfigurationVariablesInnodbChangeBufferingNone,
				MaxSeeksForKey:                         common.Int64(3.6784876225243515e+18),
				ReplicaTypeConversions:                 common.String("EXAMPLE-replicaTypeConversions-Value"),
				WaitTimeout:                            common.Int(567806),
				MaxHeapTableSize:                       common.Int64(2.49412198667607e+18),
				RegexpTimeLimit:                        common.Int(1.455796116e+09),
				SqlMode:                                common.String("EXAMPLE-sqlMode-Value"),
				BlockEncryptionMode:                    common.String("EXAMPLE-blockEncryptionMode-Value"),
				InnodbBufferPoolInstances:              common.Int(33),
				InnodbBufferPoolSize:                   common.Int64(3.1741328681674383e+18),
				InnodbNumaInterleave:                   common.Bool(true),
				LongQueryTime:                          common.Int(2.0189043e+07),
				BigTables:                              common.Bool(false),
				CollationServer:                        mysql.ConfigurationVariablesCollationServerLatin2GeneralCi,
				InnodbRedoLogCapacity:                  common.Int64(1.0144384855e+10),
				MaxConnectErrors:                       common.Int64(3.2059638813552374e+18),
				RangeOptimizerMaxMemSize:               common.Int64(8.032524762494556e+17),
				SortBufferSize:                         common.Int64(8.651082206008408e+18),
				MaxAllowedPacket:                       common.Int(1.95970597e+08),
				ForeignKeyChecks:                       common.Bool(true),
				GroupReplicationConsistency:            mysql.ConfigurationVariablesGroupReplicationConsistencyBefore,
				InnodbBufferPoolDumpPct:                common.Int(88),
				InformationSchemaStatsExpiry:           common.Int(3.732081e+06),
				InnodbLockWaitTimeout:                  common.Int(6.70765906e+08),
				InnodbLogWriterThreads:                 common.Bool(true),
				MaxExecutionTime:                       common.Int64(6.409423365646904e+18),
				RelayLogSpaceLimit:                     common.Int64(6.599589017754654e+18),
				ThreadPoolTransactionDelay:             common.Int(182058),
				ExplicitDefaultsForTimestamp:           common.Bool(false),
				BinlogTransactionCompression:           common.Bool(true),
				InnodbOnlineAlterLogMaxSize:            common.Int64(4.702258975674608e+18),
				MysqlxMaxAllowedPacket:                 common.Int(2.21533692e+08),
				OptimizerSwitch:                        common.String("EXAMPLE-optimizerSwitch-Value"),
				InnodbFtServerStopwordTable:            common.String("EXAMPLE-innodbFtServerStopwordTable-Value"),
				MysqlxLz4DefaultCompressionLevel:       common.Int(4),
				BinlogGroupCommitSyncNoDelayCount:      common.Int(22776),
				BinlogRowValueOptions:                  common.String("EXAMPLE-binlogRowValueOptions-Value"),
				InnodbFtMaxTokenSize:                   common.Int(55),
				MysqlxReadTimeout:                      common.Int(576816),
				ReplicaParallelWorkers:                 common.Int(686),
				TransactionIsolation:                   mysql.ConfigurationVariablesTransactionIsolationReadCommited,
				InnodbFtResultCacheLimit:               common.Int64(3.00077234e+08),
				LocalInfile:                            common.Bool(true),
				MysqlxMinWorkerThreads:                 common.Int(89),
				InnodbUndoLogTruncate:                  common.Bool(false),
				TmpTableSize:                           common.Int64(2.547900649193738e+17),
				ExplainFormat:                          mysql.ConfigurationVariablesExplainFormatJson,
				AutoIncrementOffset:                    common.Int(505),
				SkipNameResolve:                        common.Bool(false),
				InnodbFtMinTokenSize:                   common.Int(5),
				JoinBufferSize:                         common.Int64(4.2473787578555617e+18),
				MysqlxEnableHelloNotice:                common.Bool(false),
				TableOpenCache:                         common.Int(243864),
				TemptableMaxRam:                        common.Int64(6.576858479152585e+18),
				ConnectTimeout:                         common.Int(2.0339211e+07),
				ConnectionMemoryChunkSize:              common.Int(4.29420925e+08),
				ConnectionMemoryLimit:                  common.Int64(5.387107749281496e+18),
				InnodbAutoincLockMode:                  common.Int(257),
				InteractiveTimeout:                     common.Int(1.5362033e+07),
				MysqlxInteractiveTimeout:               common.Int(1.432054e+06),
				MysqlxWriteTimeout:                     common.Int(359716),
				ReplicaNetTimeout:                      common.Int(2.9517416e+07),
				InnodbFtEnableStopword:                 common.Bool(true),
				MysqlxConnectTimeout:                   common.Int(6.62430539e+08),
				ThreadPoolMaxTransactionsLimit:         common.Int(25039)},
			CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
			DisplayName:   common.String("EXAMPLE-displayName-Value"),
			FreeformTags:  map[string]string{"EXAMPLE_KEY_3zR2M": "EXAMPLE_VALUE_dULDuaZEGufIOnlmKcBZ"},
			InitVariables: &mysql.InitializationVariables{LowerCaseTableNames: mysql.InitializationVariablesLowerCaseTableNamesInsensitiveLowercase}},
		OpcRequestId: common.String("N3SWAJMSHPDKPCFFHWBQ<unique_ID>")}

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