// 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{Description: common.String("EXAMPLE-description-Value"),
		DisplayName:   common.String("EXAMPLE-displayName-Value"),
		FreeformTags:  map[string]string{"EXAMPLE_KEY_EobSt": "EXAMPLE_VALUE_A9GtRevT80JxrMUvYRN5"},
		InitVariables: &mysql.InitializationVariables{LowerCaseTableNames: mysql.InitializationVariablesLowerCaseTableNamesInsensitiveLowercase},
		ShapeName:     common.String("EXAMPLE-shapeName-Value"),
		DefinedTags:   map[string]map[string]interface{}{"EXAMPLE_KEY_gqQDR": map[string]interface{}{"EXAMPLE_KEY_d8oOP": "EXAMPLE--Value"}},
		Options: []mysql.Option{mysql.Option{Value: common.String("EXAMPLE-value-Value"),
			Name: common.String("EXAMPLE-name-Value")}},
		ParentConfigurationId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-parentConfigurationId-Value"),
		Variables: &mysql.ConfigurationVariables{InnodbDdlThreads: common.Int(10),
			InnodbOnlineAlterLogMaxSize:            common.Int64(4.836937245287926e+18),
			MaxConnectErrors:                       common.Int64(1.4063575727950008e+18),
			GeneratedRandomPasswordLength:          common.Int(67),
			InnodbFtServerStopwordTable:            common.String("EXAMPLE-innodbFtServerStopwordTable-Value"),
			InnodbAdaptiveHashIndex:                common.Bool(true),
			InnodbBufferPoolDumpPct:                common.Int(2),
			MysqlxMinWorkerThreads:                 common.Int(81),
			ForeignKeyChecks:                       common.Bool(false),
			MaxSeeksForKey:                         common.Int64(2.8007248500829276e+18),
			ConnectionMemoryChunkSize:              common.Int(2.19920395e+08),
			InnodbFtEnableStopword:                 common.Bool(false),
			InnodbUndoLogTruncate:                  common.Bool(true),
			TableDefinitionCache:                   common.Int(441556),
			ThreadPoolSize:                         common.Int(218),
			BinlogTransactionCompression:           common.Bool(true),
			CompletionType:                         mysql.ConfigurationVariablesCompletionTypeRelease,
			MaxHeapTableSize:                       common.Int64(5.734571848697218e+18),
			QueryPreallocSize:                      common.Int64(2.654420907012981e+18),
			GlobalConnectionMemoryTracking:         common.Bool(true),
			MaxAllowedPacket:                       common.Int(1.56209489e+08),
			TimeZone:                               common.String("EXAMPLE-timeZone-Value"),
			TransactionIsolation:                   mysql.ConfigurationVariablesTransactionIsolationSerializable,
			Autocommit:                             common.Bool(true),
			SqlWarnings:                            common.Bool(false),
			InnodbFtMaxTokenSize:                   common.Int(62),
			InnodbStatsTransientSamplePages:        common.Int64(3.6923782599076977e+18),
			MysqlxMaxAllowedPacket:                 common.Int(9.48311453e+08),
			NetReadTimeout:                         common.Int(1.4358249e+07),
			ThreadPoolMaxTransactionsLimit:         common.Int(54418),
			TmpTableSize:                           common.Int64(6.426790210845746e+18),
			BigTables:                              common.Bool(true),
			BinlogGroupCommitSyncDelay:             common.Int(191981),
			BinlogRowMetadata:                      mysql.ConfigurationVariablesBinlogRowMetadataFull,
			InnodbMaxPurgeLagDelay:                 common.Int(980555),
			LongQueryTime:                          common.Int(5.854899e+06),
			InnodbRedoLogCapacity:                  common.Int64(3.9562156045e+10),
			ExplainFormat:                          mysql.ConfigurationVariablesExplainFormatTraditional,
			MysqlFirewallMode:                      common.Bool(false),
			MysqlxConnectTimeout:                   common.Int(7.79143505e+08),
			MysqlxIdleWorkerThreadTimeout:          common.Int(3485),
			MysqlxZstdDefaultCompressionLevel:      common.Int(2),
			TemptableMaxRam:                        common.Int64(8.967734561040175e+18),
			ConnectTimeout:                         common.Int(2.521923e+06),
			MysqlxLz4MaxClientCompressionLevel:     common.Int(10),
			MysqlxWriteTimeout:                     common.Int(467372),
			MysqlxZstdMaxClientCompressionLevel:    common.Int(6),
			NetWriteTimeout:                        common.Int(1.124921e+07),
			RelayLogSpaceLimit:                     common.Int64(3.354290618909988e+18),
			SortBufferSize:                         common.Int64(8.364678541954805e+18),
			GroupReplicationConsistency:            mysql.ConfigurationVariablesGroupReplicationConsistencyBeforeOnPrimaryFailover,
			InnodbLogWriterThreads:                 common.Bool(true),
			InnodbSortBufferSize:                   common.Int(1.1885344e+07),
			MaxBinlogCacheSize:                     common.Int64(3.6192358353381e+13),
			MysqlxEnableHelloNotice:                common.Bool(true),
			MaxConnections:                         common.Int(94352),
			GlobalConnectionMemoryLimit:            common.Int64(8.448951054188496e+18),
			SkipNameResolve:                        common.Bool(true),
			BinlogGroupCommitSyncNoDelayCount:      common.Int(91322),
			InnodbStrictMode:                       common.Bool(false),
			InteractiveTimeout:                     common.Int(1.6100719e+07),
			MysqlxReadTimeout:                      common.Int(1.589152e+06),
			SqlGenerateInvisiblePrimaryKey:         common.Bool(false),
			ThreadPoolDedicatedListeners:           common.Bool(false),
			OptimizerSwitch:                        common.String("EXAMPLE-optimizerSwitch-Value"),
			BinlogRowValueOptions:                  common.String("EXAMPLE-binlogRowValueOptions-Value"),
			RangeOptimizerMaxMemSize:               common.Int64(2.4291070118379295e+18),
			InformationSchemaStatsExpiry:           common.Int(4.950659e+06),
			ConnectionMemoryLimit:                  common.Int64(2.1823873587311283e+18),
			InnodbAutoincLockMode:                  common.Int(770),
			InnodbFtResultCacheLimit:               common.Int64(1.118311213e+09),
			ThreadPoolTransactionDelay:             common.Int(140089),
			WaitTimeout:                            common.Int(1.477805e+06),
			CharacterSetServer:                     mysql.ConfigurationVariablesCharacterSetServerSwe7,
			JoinBufferSize:                         common.Int64(8.982756207191828e+18),
			MysqlxDeflateDefaultCompressionLevel:   common.Int(8),
			AutoIncrementIncrement:                 common.Int(16978),
			ExplicitDefaultsForTimestamp:           common.Bool(false),
			InnodbMaxPurgeLag:                      common.Int64(8.97103344e+08),
			InnodbRollbackOnTimeout:                common.Bool(false),
			QueryAllocBlockSize:                    common.Int64(2.652950188e+09),
			TableOpenCache:                         common.Int(404755),
			CollationServer:                        mysql.ConfigurationVariablesCollationServerUtf8EsperantoCi,
			MysqlxLz4DefaultCompressionLevel:       common.Int(5),
			ParserMaxMemSize:                       common.Int64(4.842283656152701e+18),
			ThreadPoolQueryThreadsPerGroup:         common.Int(3487),
			InnodbChangeBuffering:                  mysql.ConfigurationVariablesInnodbChangeBufferingChanges,
			InnodbFtNumWordOptimize:                common.Int(293),
			InnodbLockWaitTimeout:                  common.Int(1.64036122e+08),
			RegexpTimeLimit:                        common.Int(1.563720779e+09),
			ReplicaTypeConversions:                 common.String("EXAMPLE-replicaTypeConversions-Value"),
			CteMaxRecursionDepth:                   common.Int64(4.112531887e+09),
			InnodbBufferPoolInstances:              common.Int(62),
			InnodbFtMinTokenSize:                   common.Int(10),
			MysqlZstdDefaultCompressionLevel:       common.Int(9),
			MysqlxInteractiveTimeout:               common.Int(1.883227e+06),
			GroupConcatMaxLen:                      common.Int64(1.693175951252306e+18),
			SqlRequirePrimaryKey:                   common.Bool(true),
			InnodbNumaInterleave:                   common.Bool(false),
			AutoIncrementOffset:                    common.Int(62022),
			BlockEncryptionMode:                    common.String("EXAMPLE-blockEncryptionMode-Value"),
			MaxPreparedStmtCount:                   common.Int(745466),
			InnodbBufferPoolSize:                   common.Int64(4.714032263909185e+18),
			InnodbDdlBufferSize:                    common.Int64(3.789701395e+09),
			MysqlxDocumentIdUniquePrefix:           common.Int(33192),
			ReplicaNetTimeout:                      common.Int(2.2454661e+07),
			BinlogExpireLogsSeconds:                common.Int(44),
			DefaultAuthenticationPlugin:            mysql.ConfigurationVariablesDefaultAuthenticationPluginCachingSha2Password,
			MandatoryRoles:                         common.String("EXAMPLE-mandatoryRoles-Value"),
			MaxUserConnections:                     common.Int64(1.390797452e+09),
			MysqlxDeflateMaxClientCompressionLevel: common.Int(5),
			SqlMode:                                common.String("EXAMPLE-sqlMode-Value"),
			InnodbStatsPersistentSamplePages:       common.Int64(5.854583991726574e+18),
			LocalInfile:                            common.Bool(false),
			MaxExecutionTime:                       common.Int64(4.786060085919401e+18),
			MysqlxWaitTimeout:                      common.Int(515164),
			ReplicaParallelWorkers:                 common.Int(44),
			RequireSecureTransport:                 common.Bool(true)},
		CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value")},
		OpcRequestId:  common.String("HNULHGWT3D7JPUGV9VUN<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)
}