// 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{InitVariables: &mysql.InitializationVariables{LowerCaseTableNames: mysql.InitializationVariablesLowerCaseTableNamesInsensitiveLowercase},
		ParentConfigurationId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-parentConfigurationId-Value"),
		DisplayName:           common.String("EXAMPLE-displayName-Value"),
		FreeformTags:          map[string]string{"EXAMPLE_KEY_9vYwy": "EXAMPLE_VALUE_vyrN94nwi8m1xYenCXJd"},
		Options: []mysql.Option{mysql.Option{Name: common.String("EXAMPLE-name-Value"),
			Value: common.String("EXAMPLE-value-Value")}},
		ShapeName: common.String("EXAMPLE-shapeName-Value"),
		Variables: &mysql.ConfigurationVariables{BinlogRowValueOptions: common.String("EXAMPLE-binlogRowValueOptions-Value"),
			ConnectionMemoryLimit:                  common.Int64(9.084810789654229e+18),
			CteMaxRecursionDepth:                   common.Int64(3.845318618e+09),
			ExplicitDefaultsForTimestamp:           common.Bool(true),
			MaxConnections:                         common.Int(33248),
			MysqlFirewallMode:                      common.Bool(false),
			MysqlxDocumentIdUniquePrefix:           common.Int(12072),
			AutoIncrementOffset:                    common.Int(61957),
			LongQueryTime:                          common.Int(1.5349679e+07),
			MaxUserConnections:                     common.Int64(1.058562359e+09),
			MysqlxMinWorkerThreads:                 common.Int(30),
			SqlWarnings:                            common.Bool(true),
			TimeZone:                               common.String("EXAMPLE-timeZone-Value"),
			MaxHeapTableSize:                       common.Int64(3.702172831371442e+17),
			MysqlxLz4MaxClientCompressionLevel:     common.Int(9),
			RelayLogSpaceLimit:                     common.Int64(4.308412578681477e+17),
			ThreadPoolQueryThreadsPerGroup:         common.Int(2627),
			InnodbUndoLogTruncate:                  common.Bool(false),
			CollationServer:                        mysql.ConfigurationVariablesCollationServerUtf8VietnameseCi,
			MysqlxWriteTimeout:                     common.Int(848544),
			RangeOptimizerMaxMemSize:               common.Int64(8.14345780449648e+18),
			CharacterSetServer:                     mysql.ConfigurationVariablesCharacterSetServerDec8,
			InnodbBufferPoolDumpPct:                common.Int(32),
			InnodbOnlineAlterLogMaxSize:            common.Int64(6.439897170439691e+18),
			LocalInfile:                            common.Bool(false),
			TableDefinitionCache:                   common.Int(414604),
			InnodbAutoincLockMode:                  common.Int(692),
			InnodbLockWaitTimeout:                  common.Int(1.006973351e+09),
			InnodbFtServerStopwordTable:            common.String("EXAMPLE-innodbFtServerStopwordTable-Value"),
			ThreadPoolDedicatedListeners:           common.Bool(true),
			MaxAllowedPacket:                       common.Int(8.35202449e+08),
			MysqlxWaitTimeout:                      common.Int(759968),
			NetReadTimeout:                         common.Int(8.783745e+06),
			SqlGenerateInvisiblePrimaryKey:         common.Bool(false),
			TemptableMaxRam:                        common.Int64(5.991447021479003e+18),
			InnodbBufferPoolSize:                   common.Int64(3.669721144856532e+18),
			MaxConnectErrors:                       common.Int64(4.670417410155831e+18),
			InnodbStatsTransientSamplePages:        common.Int64(3.437297345583114e+18),
			MandatoryRoles:                         common.String("EXAMPLE-mandatoryRoles-Value"),
			MysqlxDeflateDefaultCompressionLevel:   common.Int(2),
			MysqlxZstdMaxClientCompressionLevel:    common.Int(17),
			RequireSecureTransport:                 common.Bool(false),
			TmpTableSize:                           common.Int64(7.245523854576757e+18),
			CompletionType:                         mysql.ConfigurationVariablesCompletionTypeChain,
			BigTables:                              common.Bool(true),
			BinlogGroupCommitSyncDelay:             common.Int(626782),
			QueryAllocBlockSize:                    common.Int64(6.49486255e+08),
			TransactionIsolation:                   mysql.ConfigurationVariablesTransactionIsolationRepeatableRead,
			InnodbFtMaxTokenSize:                   common.Int(50),
			GroupReplicationConsistency:            mysql.ConfigurationVariablesGroupReplicationConsistencyBefore,
			MaxPreparedStmtCount:                   common.Int(2.250496e+06),
			MysqlxZstdDefaultCompressionLevel:      common.Int(11),
			InnodbSortBufferSize:                   common.Int(4.7700754e+07),
			DefaultAuthenticationPlugin:            mysql.ConfigurationVariablesDefaultAuthenticationPluginSha256Password,
			ReplicaNetTimeout:                      common.Int(1.5852618e+07),
			SqlMode:                                common.String("EXAMPLE-sqlMode-Value"),
			AutoIncrementIncrement:                 common.Int(58573),
			BinlogGroupCommitSyncNoDelayCount:      common.Int(29828),
			GroupConcatMaxLen:                      common.Int64(7.153097081860431e+18),
			InnodbMaxPurgeLag:                      common.Int64(3.686145579e+09),
			JoinBufferSize:                         common.Int64(3.3797033946703165e+18),
			InnodbDdlBufferSize:                    common.Int64(6.36045951e+08),
			InnodbFtMinTokenSize:                   common.Int(8),
			MysqlxDeflateMaxClientCompressionLevel: common.Int(8),
			SortBufferSize:                         common.Int64(7.025918464087002e+18),
			GlobalConnectionMemoryLimit:            common.Int64(9.163234626466994e+18),
			InnodbRollbackOnTimeout:                common.Bool(true),
			NetWriteTimeout:                        common.Int(3.038016e+07),
			QueryPreallocSize:                      common.Int64(1.3156971891332616e+18),
			ReplicaTypeConversions:                 common.String("EXAMPLE-replicaTypeConversions-Value"),
			ThreadPoolMaxTransactionsLimit:         common.Int(64486),
			OptimizerSwitch:                        common.String("EXAMPLE-optimizerSwitch-Value"),
			RegexpTimeLimit:                        common.Int(3.89508017e+08),
			SqlRequirePrimaryKey:                   common.Bool(false),
			ThreadPoolSize:                         common.Int(451),
			InnodbAdaptiveHashIndex:                common.Bool(true),
			InnodbFtEnableStopword:                 common.Bool(false),
			MysqlxLz4DefaultCompressionLevel:       common.Int(8),
			ConnectTimeout:                         common.Int(2.7766841e+07),
			InnodbMaxPurgeLagDelay:                 common.Int(216737),
			InnodbRedoLogCapacity:                  common.Int64(1.04864303419e+11),
			InnodbStatsPersistentSamplePages:       common.Int64(2.176373033589072e+18),
			GeneratedRandomPasswordLength:          common.Int(116),
			InnodbFtResultCacheLimit:               common.Int64(2.66726085e+09),
			ParserMaxMemSize:                       common.Int64(4.635742068540646e+18),
			SkipNameResolve:                        common.Bool(true),
			ThreadPoolTransactionDelay:             common.Int(198752),
			BinlogRowMetadata:                      mysql.ConfigurationVariablesBinlogRowMetadataMinimal,
			InnodbLogWriterThreads:                 common.Bool(false),
			MaxBinlogCacheSize:                     common.Int64(2.7419154327959e+13),
			ForeignKeyChecks:                       common.Bool(false),
			InnodbChangeBuffering:                  mysql.ConfigurationVariablesInnodbChangeBufferingChanges,
			MysqlZstdDefaultCompressionLevel:       common.Int(9),
			BlockEncryptionMode:                    common.String("EXAMPLE-blockEncryptionMode-Value"),
			MysqlxIdleWorkerThreadTimeout:          common.Int(647),
			MysqlxReadTimeout:                      common.Int(591152),
			MaxSeeksForKey:                         common.Int64(6.813471487753779e+18),
			ReplicaParallelWorkers:                 common.Int(77),
			InnodbFtNumWordOptimize:                common.Int(62),
			ConnectionMemoryChunkSize:              common.Int(2.03496122e+08),
			MaxExecutionTime:                       common.Int64(2.374997010644099e+18),
			InteractiveTimeout:                     common.Int(2.2656736e+07),
			ExplainFormat:                          mysql.ConfigurationVariablesExplainFormatTraditional,
			MysqlxEnableHelloNotice:                common.Bool(false),
			TableOpenCache:                         common.Int(347634),
			InnodbStrictMode:                       common.Bool(true),
			InformationSchemaStatsExpiry:           common.Int(4.775293e+06),
			BinlogTransactionCompression:           common.Bool(true),
			GlobalConnectionMemoryTracking:         common.Bool(false),
			MysqlxMaxAllowedPacket:                 common.Int(7.5276884e+08),
			BinlogExpireLogsSeconds:                common.Int(57),
			MysqlxConnectTimeout:                   common.Int(5.8079649e+07),
			MysqlxInteractiveTimeout:               common.Int(1.374099e+06),
			WaitTimeout:                            common.Int(1.181112e+06),
			InnodbBufferPoolInstances:              common.Int(1),
			InnodbDdlThreads:                       common.Int(5),
			InnodbNumaInterleave:                   common.Bool(true),
			Autocommit:                             common.Bool(true)},
		CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		DefinedTags:   map[string]map[string]interface{}{"EXAMPLE_KEY_70Fcp": map[string]interface{}{"EXAMPLE_KEY_KcM4g": "EXAMPLE--Value"}},
		Description:   common.String("EXAMPLE-description-Value")},
		OpcRequestId:  common.String("N2IPLDLA9GXX2L5NVZXX<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)
}