// 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_ssD08": map[string]interface{}{"EXAMPLE_KEY_dBcpv": "EXAMPLE--Value"}},
		Description:           common.String("EXAMPLE-description-Value"),
		DisplayName:           common.String("EXAMPLE-displayName-Value"),
		FreeformTags:          map[string]string{"EXAMPLE_KEY_T9dNn": "EXAMPLE_VALUE_21QhlWmUagigYXscVfle"},
		ParentConfigurationId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-parentConfigurationId-Value"),
		Variables: &mysql.ConfigurationVariables{Autocommit: common.Bool(true),
			InnodbChangeBuffering:                  mysql.ConfigurationVariablesInnodbChangeBufferingPurges,
			MysqlxDeflateMaxClientCompressionLevel: common.Int(1),
			InnodbRollbackOnTimeout:                common.Bool(false),
			CollationServer:                        mysql.ConfigurationVariablesCollationServerUtf8mb4Is0900AsCs,
			MysqlxIdleWorkerThreadTimeout:          common.Int(3164),
			MysqlxWriteTimeout:                     common.Int(212080),
			ConnectionMemoryChunkSize:              common.Int(3.01744838e+08),
			InnodbFtMaxTokenSize:                   common.Int(36),
			InnodbStrictMode:                       common.Bool(false),
			LocalInfile:                            common.Bool(true),
			MysqlFirewallMode:                      common.Bool(false),
			NetWriteTimeout:                        common.Int(2.8798696e+07),
			GlobalConnectionMemoryLimit:            common.Int64(5.930308885674029e+17),
			InnodbLogWriterThreads:                 common.Bool(true),
			MysqlxWaitTimeout:                      common.Int(118999),
			SqlRequirePrimaryKey:                   common.Bool(false),
			BinlogTransactionCompression:           common.Bool(false),
			InnodbUndoLogTruncate:                  common.Bool(true),
			InteractiveTimeout:                     common.Int(8.168158e+06),
			WaitTimeout:                            common.Int(501829),
			CompletionType:                         mysql.ConfigurationVariablesCompletionTypeNoChain,
			SqlWarnings:                            common.Bool(true),
			TableOpenCache:                         common.Int(471150),
			InnodbBufferPoolSize:                   common.Int64(5.168267000573709e+18),
			RangeOptimizerMaxMemSize:               common.Int64(3.4768866060059126e+18),
			ReplicaParallelWorkers:                 common.Int(206),
			ExplicitDefaultsForTimestamp:           common.Bool(false),
			RelayLogSpaceLimit:                     common.Int64(9.221866552679236e+18),
			RequireSecureTransport:                 common.Bool(false),
			SortBufferSize:                         common.Int64(7.507536649287118e+18),
			TemptableMaxRam:                        common.Int64(5.028660344121307e+18),
			InnodbStatsTransientSamplePages:        common.Int64(8.2621358529098e+18),
			ForeignKeyChecks:                       common.Bool(true),
			GlobalConnectionMemoryTracking:         common.Bool(false),
			InnodbAutoincLockMode:                  common.Int(510),
			InnodbMaxPurgeLagDelay:                 common.Int(64005),
			MaxUserConnections:                     common.Int64(1.977594811e+09),
			MysqlxConnectTimeout:                   common.Int(3.98434678e+08),
			RegexpTimeLimit:                        common.Int(6.8016527e+07),
			BinlogRowMetadata:                      mysql.ConfigurationVariablesBinlogRowMetadataFull,
			ConnectionMemoryLimit:                  common.Int64(6.373024252936027e+18),
			InformationSchemaStatsExpiry:           common.Int(1.2824644e+07),
			MysqlxDeflateDefaultCompressionLevel:   common.Int(5),
			MysqlxZstdMaxClientCompressionLevel:    common.Int(11),
			InnodbAdaptiveHashIndex:                common.Bool(false),
			InnodbLockWaitTimeout:                  common.Int(8.11106768e+08),
			InnodbStatsPersistentSamplePages:       common.Int64(4.366383978136842e+17),
			SqlMode:                                common.String("EXAMPLE-sqlMode-Value"),
			MandatoryRoles:                         common.String("EXAMPLE-mandatoryRoles-Value"),
			MysqlxDocumentIdUniquePrefix:           common.Int(25324),
			ThreadPoolQueryThreadsPerGroup:         common.Int(1557),
			SqlGenerateInvisiblePrimaryKey:         common.Bool(false),
			BlockEncryptionMode:                    common.String("EXAMPLE-blockEncryptionMode-Value"),
			ConnectTimeout:                         common.Int(1.8026063e+07),
			InnodbFtEnableStopword:                 common.Bool(false),
			MaxConnections:                         common.Int(6992),
			MysqlxMinWorkerThreads:                 common.Int(5),
			QueryPreallocSize:                      common.Int64(9.15268018045521e+18),
			BigTables:                              common.Bool(false),
			BinlogGroupCommitSyncDelay:             common.Int(43462),
			BinlogRowValueOptions:                  common.String("EXAMPLE-binlogRowValueOptions-Value"),
			GeneratedRandomPasswordLength:          common.Int(87),
			InnodbBufferPoolInstances:              common.Int(30),
			InnodbDdlBufferSize:                    common.Int64(2.297200114e+09),
			InnodbFtMinTokenSize:                   common.Int(11),
			MysqlxInteractiveTimeout:               common.Int(1.097017e+06),
			CharacterSetServer:                     mysql.ConfigurationVariablesCharacterSetServerCp932,
			ExplainFormat:                          mysql.ConfigurationVariablesExplainFormatJson,
			GroupReplicationConsistency:            mysql.ConfigurationVariablesGroupReplicationConsistencyBeforeAndAfter,
			InnodbFtResultCacheLimit:               common.Int64(2.996163181e+09),
			QueryAllocBlockSize:                    common.Int64(6.45777365e+08),
			SkipNameResolve:                        common.Bool(false),
			ThreadPoolSize:                         common.Int(266),
			MaxHeapTableSize:                       common.Int64(1.0264908786404692e+18),
			MysqlxLz4MaxClientCompressionLevel:     common.Int(4),
			MysqlZstdDefaultCompressionLevel:       common.Int(10),
			ThreadPoolTransactionDelay:             common.Int(28600),
			BinlogExpireLogsSeconds:                common.Int(574),
			TmpTableSize:                           common.Int64(1.008739888499546e+18),
			InnodbBufferPoolDumpPct:                common.Int(54),
			JoinBufferSize:                         common.Int64(7.984113734641417e+18),
			MysqlxReadTimeout:                      common.Int(1.776867e+06),
			ReplicaNetTimeout:                      common.Int(1.2941499e+07),
			CteMaxRecursionDepth:                   common.Int64(2.517006e+09),
			InnodbMaxPurgeLag:                      common.Int64(1.284140141e+09),
			NetReadTimeout:                         common.Int(8.120308e+06),
			ReplicaTypeConversions:                 common.String("EXAMPLE-replicaTypeConversions-Value"),
			ThreadPoolMaxTransactionsLimit:         common.Int(61225),
			LongQueryTime:                          common.Int(4.197137e+06),
			MysqlxZstdDefaultCompressionLevel:      common.Int(12),
			TransactionIsolation:                   mysql.ConfigurationVariablesTransactionIsolationRepeatableRead,
			InnodbOnlineAlterLogMaxSize:            common.Int64(1.939377507769873e+17),
			AutoIncrementOffset:                    common.Int(2197),
			MaxPreparedStmtCount:                   common.Int(397801),
			InnodbFtNumWordOptimize:                common.Int(47),
			ParserMaxMemSize:                       common.Int64(3.116519243943023e+18),
			TimeZone:                               common.String("EXAMPLE-timeZone-Value"),
			InnodbNumaInterleave:                   common.Bool(true),
			InnodbRedoLogCapacity:                  common.Int64(6.6980844912e+10),
			BinlogGroupCommitSyncNoDelayCount:      common.Int(90011),
			InnodbFtServerStopwordTable:            common.String("EXAMPLE-innodbFtServerStopwordTable-Value"),
			MaxConnectErrors:                       common.Int64(1.945537593728645e+17),
			TableDefinitionCache:                   common.Int(428643),
			InnodbSortBufferSize:                   common.Int(3.1601024e+07),
			MaxSeeksForKey:                         common.Int64(8.328037808244019e+18),
			MysqlxMaxAllowedPacket:                 common.Int(3.20072577e+08),
			AutoIncrementIncrement:                 common.Int(27429),
			DefaultAuthenticationPlugin:            mysql.ConfigurationVariablesDefaultAuthenticationPluginCachingSha2Password,
			GroupConcatMaxLen:                      common.Int64(3.516394376791771e+18),
			MysqlxEnableHelloNotice:                common.Bool(false),
			MaxAllowedPacket:                       common.Int(5.73456187e+08),
			MaxBinlogCacheSize:                     common.Int64(2.676470254395e+12),
			InnodbDdlThreads:                       common.Int(54),
			MaxExecutionTime:                       common.Int64(3.5627857512535613e+18),
			MysqlxLz4DefaultCompressionLevel:       common.Int(4),
			OptimizerSwitch:                        common.String("EXAMPLE-optimizerSwitch-Value"),
			ThreadPoolDedicatedListeners:           common.Bool(false)},
		CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		InitVariables: &mysql.InitializationVariables{LowerCaseTableNames: mysql.InitializationVariablesLowerCaseTableNamesSensitive},
		ShapeName:     common.String("EXAMPLE-shapeName-Value")},
		OpcRequestId:  common.String("5UY23H8TIPT0L9CXRBZS<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)
}