// 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{Variables: &mysql.ConfigurationVariables{CharacterSetServer: mysql.ConfigurationVariablesCharacterSetServerCp932,
		InnodbUndoLogTruncate:                  common.Bool(false),
		MysqlxZstdDefaultCompressionLevel:      common.Int(7),
		Autocommit:                             common.Bool(false),
		LongQueryTime:                          common.Int(1.6403244e+07),
		MysqlxConnectTimeout:                   common.Int(6.66976114e+08),
		ConnectionMemoryChunkSize:              common.Int(2.73883041e+08),
		MysqlZstdDefaultCompressionLevel:       common.Int(13),
		BinlogExpireLogsSeconds:                common.Int(691),
		InnodbNumaInterleave:                   common.Bool(false),
		MaxBinlogCacheSize:                     common.Int64(5.1064332007386e+13),
		SqlGenerateInvisiblePrimaryKey:         common.Bool(false),
		AutoIncrementIncrement:                 common.Int(2015),
		ConnectTimeout:                         common.Int(1.6478891e+07),
		GlobalConnectionMemoryLimit:            common.Int64(5.18751677142702e+18),
		GlobalConnectionMemoryTracking:         common.Bool(true),
		InnodbLockWaitTimeout:                  common.Int(9.78722236e+08),
		InnodbMaxPurgeLagDelay:                 common.Int(110562),
		MysqlxDocumentIdUniquePrefix:           common.Int(7004),
		ReplicaParallelWorkers:                 common.Int(224),
		JoinBufferSize:                         common.Int64(3.898130192117419e+18),
		MysqlxMinWorkerThreads:                 common.Int(77),
		SqlWarnings:                            common.Bool(true),
		ThreadPoolQueryThreadsPerGroup:         common.Int(2750),
		InnodbRollbackOnTimeout:                common.Bool(true),
		MysqlxZstdMaxClientCompressionLevel:    common.Int(14),
		RangeOptimizerMaxMemSize:               common.Int64(1.5496087200373893e+18),
		SqlMode:                                common.String("EXAMPLE-sqlMode-Value"),
		CollationServer:                        mysql.ConfigurationVariablesCollationServerUtf8TurkishCi,
		MandatoryRoles:                         common.String("EXAMPLE-mandatoryRoles-Value"),
		ParserMaxMemSize:                       common.Int64(8.467139826789593e+18),
		ThreadPoolMaxTransactionsLimit:         common.Int(12027),
		MaxConnections:                         common.Int(87543),
		MaxUserConnections:                     common.Int64(1.536254324e+09),
		MysqlxWaitTimeout:                      common.Int(639338),
		GroupReplicationConsistency:            mysql.ConfigurationVariablesGroupReplicationConsistencyBeforeAndAfter,
		InteractiveTimeout:                     common.Int(2.3994772e+07),
		MysqlxInteractiveTimeout:               common.Int(92849),
		BinlogGroupCommitSyncNoDelayCount:      common.Int(10384),
		InnodbMaxPurgeLag:                      common.Int64(1.824786218e+09),
		NetWriteTimeout:                        common.Int(1.7618091e+07),
		RequireSecureTransport:                 common.Bool(true),
		InnodbBufferPoolInstances:              common.Int(17),
		TemptableMaxRam:                        common.Int64(2.8760973881143127e+18),
		BinlogTransactionCompression:           common.Bool(true),
		CteMaxRecursionDepth:                   common.Int64(8.92019504e+08),
		GeneratedRandomPasswordLength:          common.Int(162),
		RegexpTimeLimit:                        common.Int(1.874820229e+09),
		SqlRequirePrimaryKey:                   common.Bool(true),
		WaitTimeout:                            common.Int(1.515694e+06),
		ThreadPoolDedicatedListeners:           common.Bool(false),
		DefaultAuthenticationPlugin:            mysql.ConfigurationVariablesDefaultAuthenticationPluginCachingSha2Password,
		InformationSchemaStatsExpiry:           common.Int(2.4746935e+07),
		InnodbFtMaxTokenSize:                   common.Int(65),
		InnodbFtMinTokenSize:                   common.Int(13),
		InnodbFtNumWordOptimize:                common.Int(591),
		MysqlxWriteTimeout:                     common.Int(2.082506e+06),
		BinlogRowMetadata:                      mysql.ConfigurationVariablesBinlogRowMetadataMinimal,
		InnodbAutoincLockMode:                  common.Int(73),
		InnodbLogWriterThreads:                 common.Bool(true),
		MysqlxEnableHelloNotice:                common.Bool(false),
		SkipNameResolve:                        common.Bool(true),
		MaxConnectErrors:                       common.Int64(6.751098909147148e+18),
		BigTables:                              common.Bool(true),
		ExplainFormat:                          mysql.ConfigurationVariablesExplainFormatJson,
		InnodbAdaptiveHashIndex:                common.Bool(false),
		InnodbFtEnableStopword:                 common.Bool(true),
		InnodbStrictMode:                       common.Bool(true),
		MysqlxIdleWorkerThreadTimeout:          common.Int(1416),
		ReplicaTypeConversions:                 common.String("EXAMPLE-replicaTypeConversions-Value"),
		BinlogRowValueOptions:                  common.String("EXAMPLE-binlogRowValueOptions-Value"),
		ExplicitDefaultsForTimestamp:           common.Bool(true),
		InnodbBufferPoolSize:                   common.Int64(6.444764557485268e+18),
		InnodbFtServerStopwordTable:            common.String("EXAMPLE-innodbFtServerStopwordTable-Value"),
		InnodbSortBufferSize:                   common.Int(1.0232915e+07),
		LocalInfile:                            common.Bool(false),
		InnodbOnlineAlterLogMaxSize:            common.Int64(5.607365049971929e+18),
		MaxHeapTableSize:                       common.Int64(3.0556166813706327e+18),
		MysqlxReadTimeout:                      common.Int(633245),
		QueryAllocBlockSize:                    common.Int64(6.3041674e+07),
		BinlogGroupCommitSyncDelay:             common.Int(195443),
		GroupConcatMaxLen:                      common.Int64(3.752272036348539e+17),
		TransactionIsolation:                   mysql.ConfigurationVariablesTransactionIsolationReadUncommitted,
		MaxPreparedStmtCount:                   common.Int(402463),
		MysqlxLz4MaxClientCompressionLevel:     common.Int(6),
		BlockEncryptionMode:                    common.String("EXAMPLE-blockEncryptionMode-Value"),
		ForeignKeyChecks:                       common.Bool(true),
		InnodbStatsTransientSamplePages:        common.Int64(8.264900248296829e+18),
		MysqlxDeflateDefaultCompressionLevel:   common.Int(1),
		OptimizerSwitch:                        common.String("EXAMPLE-optimizerSwitch-Value"),
		ThreadPoolTransactionDelay:             common.Int(121345),
		AutoIncrementOffset:                    common.Int(42280),
		ConnectionMemoryLimit:                  common.Int64(8.360545787399602e+18),
		MaxAllowedPacket:                       common.Int(4.90735085e+08),
		MysqlxMaxAllowedPacket:                 common.Int(4.94273806e+08),
		TmpTableSize:                           common.Int64(5.512013695188645e+18),
		InnodbChangeBuffering:                  mysql.ConfigurationVariablesInnodbChangeBufferingDeletes,
		MysqlFirewallMode:                      common.Bool(false),
		QueryPreallocSize:                      common.Int64(4.649426937908267e+18),
		ReplicaNetTimeout:                      common.Int(6.988087e+06),
		InnodbDdlThreads:                       common.Int(17),
		TimeZone:                               common.String("EXAMPLE-timeZone-Value"),
		InnodbFtResultCacheLimit:               common.Int64(3.633845953e+09),
		InnodbStatsPersistentSamplePages:       common.Int64(6.93001918113819e+18),
		MysqlxLz4DefaultCompressionLevel:       common.Int(12),
		NetReadTimeout:                         common.Int(1.839674e+07),
		InnodbBufferPoolDumpPct:                common.Int(61),
		InnodbRedoLogCapacity:                  common.Int64(6.7751812845e+10),
		RelayLogSpaceLimit:                     common.Int64(7.80989736642259e+17),
		TableDefinitionCache:                   common.Int(388876),
		ThreadPoolSize:                         common.Int(59),
		CompletionType:                         mysql.ConfigurationVariablesCompletionTypeNoChain,
		MaxSeeksForKey:                         common.Int64(3.4584087059419085e+18),
		TableOpenCache:                         common.Int(146911),
		MaxExecutionTime:                       common.Int64(9.149030671663232e+18),
		SortBufferSize:                         common.Int64(8.909816588039546e+17),
		InnodbDdlBufferSize:                    common.Int64(3.53405302e+08),
		MysqlxDeflateMaxClientCompressionLevel: common.Int(5)},
		CompartmentId:         common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		DefinedTags:           map[string]map[string]interface{}{"EXAMPLE_KEY_69YCb": map[string]interface{}{"EXAMPLE_KEY_LWtie": "EXAMPLE--Value"}},
		Description:           common.String("EXAMPLE-description-Value"),
		InitVariables:         &mysql.InitializationVariables{LowerCaseTableNames: mysql.InitializationVariablesLowerCaseTableNamesInsensitiveLowercase},
		ParentConfigurationId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-parentConfigurationId-Value"),
		ShapeName:             common.String("EXAMPLE-shapeName-Value"),
		DisplayName:           common.String("EXAMPLE-displayName-Value"),
		FreeformTags:          map[string]string{"EXAMPLE_KEY_rlNad": "EXAMPLE_VALUE_8Q0BV8FjRyNjvQTtWN8c"}},
		OpcRequestId:  common.String("FB1ZDZHTGICLWOKSECCU<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)
}