// 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{CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		Description: common.String("EXAMPLE-description-Value"),
		ShapeName:   common.String("EXAMPLE-shapeName-Value"),
		Variables: &mysql.ConfigurationVariables{InnodbMaxPurgeLagDelay: common.Int(459362),
			InteractiveTimeout:                     common.Int(4.932433e+06),
			JoinBufferSize:                         common.Int64(7.832647155947784e+18),
			MysqlxLz4DefaultCompressionLevel:       common.Int(10),
			ParserMaxMemSize:                       common.Int64(5.033382133085995e+18),
			ThreadPoolMaxTransactionsLimit:         common.Int(57426),
			AutoIncrementOffset:                    common.Int(61531),
			InnodbBufferPoolDumpPct:                common.Int(70),
			InnodbMaxPurgeLag:                      common.Int64(7.24339957e+08),
			LongQueryTime:                          common.Int(2.4428901e+07),
			MaxConnections:                         common.Int(1816),
			MaxExecutionTime:                       common.Int64(4.6762786367137075e+17),
			MysqlFirewallMode:                      common.Bool(false),
			MysqlxReadTimeout:                      common.Int(217738),
			BinlogRowValueOptions:                  common.String("EXAMPLE-binlogRowValueOptions-Value"),
			InnodbDdlThreads:                       common.Int(1),
			InnodbSortBufferSize:                   common.Int(5.9154082e+07),
			TransactionIsolation:                   mysql.ConfigurationVariablesTransactionIsolationSerializable,
			Autocommit:                             common.Bool(false),
			BinlogGroupCommitSyncDelay:             common.Int(897475),
			ExplicitDefaultsForTimestamp:           common.Bool(true),
			InnodbFtMinTokenSize:                   common.Int(9),
			RangeOptimizerMaxMemSize:               common.Int64(6.347547133863246e+18),
			CollationServer:                        mysql.ConfigurationVariablesCollationServerUtf8LatvianCi,
			ConnectionMemoryLimit:                  common.Int64(6.415733117196989e+18),
			InnodbOnlineAlterLogMaxSize:            common.Int64(4.592445279013983e+18),
			BinlogExpireLogsSeconds:                common.Int(939),
			InnodbNumaInterleave:                   common.Bool(false),
			MaxHeapTableSize:                       common.Int64(8.529152172255246e+18),
			MysqlxIdleWorkerThreadTimeout:          common.Int(28),
			MysqlxMinWorkerThreads:                 common.Int(63),
			InnodbStatsPersistentSamplePages:       common.Int64(7.307935025363333e+17),
			SqlMode:                                common.String("EXAMPLE-sqlMode-Value"),
			TableDefinitionCache:                   common.Int(181205),
			WaitTimeout:                            common.Int(20934),
			InnodbFtNumWordOptimize:                common.Int(125),
			NetReadTimeout:                         common.Int(1.8134312e+07),
			OptimizerSwitch:                        common.String("EXAMPLE-optimizerSwitch-Value"),
			RegexpTimeLimit:                        common.Int(3.36185688e+08),
			SkipNameResolve:                        common.Bool(false),
			MandatoryRoles:                         common.String("EXAMPLE-mandatoryRoles-Value"),
			MaxConnectErrors:                       common.Int64(8.339425905921935e+17),
			ConnectionMemoryChunkSize:              common.Int(4.63086993e+08),
			LocalInfile:                            common.Bool(false),
			MysqlxDeflateMaxClientCompressionLevel: common.Int(1),
			MysqlxLz4MaxClientCompressionLevel:     common.Int(15),
			BlockEncryptionMode:                    common.String("EXAMPLE-blockEncryptionMode-Value"),
			InnodbUndoLogTruncate:                  common.Bool(true),
			TemptableMaxRam:                        common.Int64(1.1819003232203156e+18),
			MaxSeeksForKey:                         common.Int64(8.674122111764927e+18),
			TmpTableSize:                           common.Int64(6.476384317416947e+18),
			InnodbLogWriterThreads:                 common.Bool(false),
			AutoIncrementIncrement:                 common.Int(58276),
			CharacterSetServer:                     mysql.ConfigurationVariablesCharacterSetServerCp850,
			ExplainFormat:                          mysql.ConfigurationVariablesExplainFormatTraditional,
			InnodbChangeBuffering:                  mysql.ConfigurationVariablesInnodbChangeBufferingDeletes,
			SqlWarnings:                            common.Bool(true),
			BinlogRowMetadata:                      mysql.ConfigurationVariablesBinlogRowMetadataMinimal,
			DefaultAuthenticationPlugin:            mysql.ConfigurationVariablesDefaultAuthenticationPluginMysqlNativePassword,
			InnodbStatsTransientSamplePages:        common.Int64(8.316331458820272e+18),
			QueryAllocBlockSize:                    common.Int64(3.844383336e+09),
			ReplicaNetTimeout:                      common.Int(1.0060325e+07),
			BinlogGroupCommitSyncNoDelayCount:      common.Int(76237),
			InformationSchemaStatsExpiry:           common.Int(9.090918e+06),
			InnodbBufferPoolSize:                   common.Int64(6.90311090056398e+18),
			InnodbFtEnableStopword:                 common.Bool(false),
			InnodbRollbackOnTimeout:                common.Bool(false),
			MysqlxMaxAllowedPacket:                 common.Int(9.33917644e+08),
			RelayLogSpaceLimit:                     common.Int64(2.383812572194089e+17),
			InnodbRedoLogCapacity:                  common.Int64(7.7749157199e+10),
			SortBufferSize:                         common.Int64(6.623572353101259e+18),
			ThreadPoolDedicatedListeners:           common.Bool(true),
			GlobalConnectionMemoryLimit:            common.Int64(4.769580953694197e+18),
			CompletionType:                         mysql.ConfigurationVariablesCompletionTypeChain,
			ConnectTimeout:                         common.Int(1.6102774e+07),
			ReplicaTypeConversions:                 common.String("EXAMPLE-replicaTypeConversions-Value"),
			MaxBinlogCacheSize:                     common.Int64(3.8659359960436e+13),
			MysqlxConnectTimeout:                   common.Int(8.51993111e+08),
			RequireSecureTransport:                 common.Bool(true),
			InnodbBufferPoolInstances:              common.Int(8),
			MysqlxDocumentIdUniquePrefix:           common.Int(39194),
			NetWriteTimeout:                        common.Int(2.01143e+06),
			InnodbFtMaxTokenSize:                   common.Int(32),
			MysqlZstdDefaultCompressionLevel:       common.Int(3),
			QueryPreallocSize:                      common.Int64(8.606463812513799e+18),
			ThreadPoolTransactionDelay:             common.Int(6646),
			MysqlxWriteTimeout:                     common.Int(667980),
			MysqlxZstdMaxClientCompressionLevel:    common.Int(2),
			InnodbAutoincLockMode:                  common.Int(649),
			MysqlxWaitTimeout:                      common.Int(595794),
			SqlRequirePrimaryKey:                   common.Bool(true),
			TimeZone:                               common.String("EXAMPLE-timeZone-Value"),
			MaxUserConnections:                     common.Int64(1.31420319e+09),
			MysqlxEnableHelloNotice:                common.Bool(false),
			SqlGenerateInvisiblePrimaryKey:         common.Bool(false),
			BigTables:                              common.Bool(false),
			BinlogTransactionCompression:           common.Bool(false),
			GroupConcatMaxLen:                      common.Int64(6.84551244553232e+18),
			InnodbFtServerStopwordTable:            common.String("EXAMPLE-innodbFtServerStopwordTable-Value"),
			MaxAllowedPacket:                       common.Int(7.77913529e+08),
			MysqlxDeflateDefaultCompressionLevel:   common.Int(2),
			ReplicaParallelWorkers:                 common.Int(17),
			GroupReplicationConsistency:            mysql.ConfigurationVariablesGroupReplicationConsistencyAfter,
			InnodbDdlBufferSize:                    common.Int64(3.893504584e+09),
			TableOpenCache:                         common.Int(48448),
			ThreadPoolQueryThreadsPerGroup:         common.Int(3317),
			CteMaxRecursionDepth:                   common.Int64(3.924403556e+09),
			GlobalConnectionMemoryTracking:         common.Bool(true),
			MysqlxZstdDefaultCompressionLevel:      common.Int(1),
			ThreadPoolSize:                         common.Int(74),
			InnodbAdaptiveHashIndex:                common.Bool(false),
			InnodbStrictMode:                       common.Bool(false),
			MaxPreparedStmtCount:                   common.Int(4.002951e+06),
			InnodbFtResultCacheLimit:               common.Int64(3.61148444e+08),
			GeneratedRandomPasswordLength:          common.Int(209),
			ForeignKeyChecks:                       common.Bool(false),
			MysqlxInteractiveTimeout:               common.Int(1.824057e+06),
			InnodbLockWaitTimeout:                  common.Int(3.41748714e+08)},
		DefinedTags:   map[string]map[string]interface{}{"EXAMPLE_KEY_2UfKY": map[string]interface{}{"EXAMPLE_KEY_uuHmT": "EXAMPLE--Value"}},
		DisplayName:   common.String("EXAMPLE-displayName-Value"),
		FreeformTags:  map[string]string{"EXAMPLE_KEY_SaTdC": "EXAMPLE_VALUE_2mmRN6ORl5TUOM0BmGPk"},
		InitVariables: &mysql.InitializationVariables{LowerCaseTableNames: mysql.InitializationVariablesLowerCaseTableNamesInsensitiveLowercase},
		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")},
		OpcRequestId:  common.String("FIXE4PQNU4UTHUNVMXOI<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)
}