// 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"),
		InitVariables: &mysql.InitializationVariables{LowerCaseTableNames: mysql.InitializationVariablesLowerCaseTableNamesSensitive},
		ShapeName:     common.String("EXAMPLE-shapeName-Value"),
		Variables: &mysql.ConfigurationVariables{SqlGenerateInvisiblePrimaryKey: common.Bool(true),
			ThreadPoolSize:                         common.Int(11),
			TmpTableSize:                           common.Int64(4.619382270020295e+18),
			InnodbOnlineAlterLogMaxSize:            common.Int64(2.2487785079021276e+18),
			TimeZone:                               common.String("EXAMPLE-timeZone-Value"),
			BinlogGroupCommitSyncNoDelayCount:      common.Int(16646),
			GeneratedRandomPasswordLength:          common.Int(126),
			LocalInfile:                            common.Bool(false),
			TableDefinitionCache:                   common.Int(442124),
			InnodbAutoincLockMode:                  common.Int(160),
			AutoIncrementOffset:                    common.Int(60386),
			CompletionType:                         mysql.ConfigurationVariablesCompletionTypeNoChain,
			ConnectTimeout:                         common.Int(6.041004e+06),
			InnodbFtServerStopwordTable:            common.String("EXAMPLE-innodbFtServerStopwordTable-Value"),
			BinlogGroupCommitSyncDelay:             common.Int(494673),
			InnodbFtResultCacheLimit:               common.Int64(4.157536594e+09),
			ReplicaNetTimeout:                      common.Int(7.145894e+06),
			InnodbLockWaitTimeout:                  common.Int(9.38354063e+08),
			MaxConnectErrors:                       common.Int64(1.8066733603185224e+18),
			TransactionIsolation:                   mysql.ConfigurationVariablesTransactionIsolationReadUncommitted,
			BinlogRowMetadata:                      mysql.ConfigurationVariablesBinlogRowMetadataFull,
			InnodbStatsTransientSamplePages:        common.Int64(7.075266954156476e+18),
			NetWriteTimeout:                        common.Int(1.016392e+07),
			SkipNameResolve:                        common.Bool(false),
			MaxAllowedPacket:                       common.Int(3.05736595e+08),
			MysqlxMaxAllowedPacket:                 common.Int(5.59021946e+08),
			MysqlxReadTimeout:                      common.Int(411894),
			SortBufferSize:                         common.Int64(6.015365331883955e+18),
			SqlRequirePrimaryKey:                   common.Bool(false),
			ThreadPoolTransactionDelay:             common.Int(124763),
			GroupReplicationConsistency:            mysql.ConfigurationVariablesGroupReplicationConsistencyEventual,
			InnodbFtMaxTokenSize:                   common.Int(61),
			InnodbMaxPurgeLagDelay:                 common.Int(764445),
			RegexpTimeLimit:                        common.Int(1.385308188e+09),
			TableOpenCache:                         common.Int(109542),
			InnodbRedoLogCapacity:                  common.Int64(5.56301728e+09),
			ParserMaxMemSize:                       common.Int64(2.7411506132367227e+18),
			WaitTimeout:                            common.Int(178481),
			InnodbDdlThreads:                       common.Int(28),
			MaxBinlogCacheSize:                     common.Int64(2.179200269422e+12),
			SqlWarnings:                            common.Bool(true),
			InnodbFtMinTokenSize:                   common.Int(15),
			InnodbLogWriterThreads:                 common.Bool(false),
			MysqlxEnableHelloNotice:                common.Bool(true),
			RangeOptimizerMaxMemSize:               common.Int64(5.948462235572464e+18),
			BigTables:                              common.Bool(false),
			DefaultAuthenticationPlugin:            mysql.ConfigurationVariablesDefaultAuthenticationPluginCachingSha2Password,
			InnodbDdlBufferSize:                    common.Int64(2.944112581e+09),
			MysqlxMinWorkerThreads:                 common.Int(70),
			ThreadPoolMaxTransactionsLimit:         common.Int(12683),
			MysqlxLz4MaxClientCompressionLevel:     common.Int(9),
			ForeignKeyChecks:                       common.Bool(false),
			MaxHeapTableSize:                       common.Int64(2.2053105828368448e+17),
			MysqlxDeflateDefaultCompressionLevel:   common.Int(6),
			BlockEncryptionMode:                    common.String("EXAMPLE-blockEncryptionMode-Value"),
			InnodbMaxPurgeLag:                      common.Int64(3.640356798e+09),
			RelayLogSpaceLimit:                     common.Int64(1.8330746602233754e+18),
			ReplicaTypeConversions:                 common.String("EXAMPLE-replicaTypeConversions-Value"),
			BinlogExpireLogsSeconds:                common.Int(689),
			GlobalConnectionMemoryLimit:            common.Int64(2.813758384764805e+18),
			MysqlxWaitTimeout:                      common.Int(1.227639e+06),
			SqlMode:                                common.String("EXAMPLE-sqlMode-Value"),
			Autocommit:                             common.Bool(true),
			CollationServer:                        mysql.ConfigurationVariablesCollationServerUtf8Unicode520Ci,
			InnodbRollbackOnTimeout:                common.Bool(true),
			MaxPreparedStmtCount:                   common.Int(42643),
			QueryPreallocSize:                      common.Int64(5.590255894412554e+18),
			ThreadPoolDedicatedListeners:           common.Bool(false),
			ConnectionMemoryChunkSize:              common.Int(4.92144126e+08),
			InnodbBufferPoolInstances:              common.Int(58),
			JoinBufferSize:                         common.Int64(4.4421733183613133e+18),
			InnodbSortBufferSize:                   common.Int(2.680191e+07),
			AutoIncrementIncrement:                 common.Int(40975),
			InnodbBufferPoolSize:                   common.Int64(6.180366447939012e+18),
			MandatoryRoles:                         common.String("EXAMPLE-mandatoryRoles-Value"),
			MysqlxDeflateMaxClientCompressionLevel: common.Int(7),
			MysqlxIdleWorkerThreadTimeout:          common.Int(650),
			MysqlxInteractiveTimeout:               common.Int(1.384322e+06),
			MysqlxZstdDefaultCompressionLevel:      common.Int(3),
			BinlogRowValueOptions:                  common.String("EXAMPLE-binlogRowValueOptions-Value"),
			GroupConcatMaxLen:                      common.Int64(8.541543683596343e+18),
			MysqlxConnectTimeout:                   common.Int(7.46684161e+08),
			MysqlxZstdMaxClientCompressionLevel:    common.Int(2),
			InnodbChangeBuffering:                  mysql.ConfigurationVariablesInnodbChangeBufferingInserts,
			MaxSeeksForKey:                         common.Int64(6.479829699801559e+18),
			MysqlxLz4DefaultCompressionLevel:       common.Int(15),
			InnodbNumaInterleave:                   common.Bool(false),
			MysqlZstdDefaultCompressionLevel:       common.Int(8),
			OptimizerSwitch:                        common.String("EXAMPLE-optimizerSwitch-Value"),
			InnodbStatsPersistentSamplePages:       common.Int64(4.767567127075013e+18),
			InnodbUndoLogTruncate:                  common.Bool(false),
			ReplicaParallelWorkers:                 common.Int(630),
			InnodbFtNumWordOptimize:                common.Int(911),
			LongQueryTime:                          common.Int(1.9275916e+07),
			MaxUserConnections:                     common.Int64(3.729525452e+09),
			MysqlxDocumentIdUniquePrefix:           common.Int(64520),
			RequireSecureTransport:                 common.Bool(false),
			TemptableMaxRam:                        common.Int64(6.633227579257311e+18),
			ThreadPoolQueryThreadsPerGroup:         common.Int(1834),
			ConnectionMemoryLimit:                  common.Int64(2.973965970619065e+18),
			ExplainFormat:                          mysql.ConfigurationVariablesExplainFormatTree,
			ExplicitDefaultsForTimestamp:           common.Bool(true),
			MysqlxWriteTimeout:                     common.Int(1.843394e+06),
			InteractiveTimeout:                     common.Int(2.8039322e+07),
			GlobalConnectionMemoryTracking:         common.Bool(false),
			InnodbBufferPoolDumpPct:                common.Int(37),
			InnodbStrictMode:                       common.Bool(true),
			MysqlFirewallMode:                      common.Bool(false),
			NetReadTimeout:                         common.Int(1.2496144e+07),
			QueryAllocBlockSize:                    common.Int64(4.076555848e+09),
			CharacterSetServer:                     mysql.ConfigurationVariablesCharacterSetServerEucjpms,
			InformationSchemaStatsExpiry:           common.Int(1.8627873e+07),
			InnodbAdaptiveHashIndex:                common.Bool(false),
			InnodbFtEnableStopword:                 common.Bool(true),
			MaxConnections:                         common.Int(46729),
			MaxExecutionTime:                       common.Int64(1.5069212497712404e+18),
			BinlogTransactionCompression:           common.Bool(true),
			CteMaxRecursionDepth:                   common.Int64(2.307401545e+09)},
		CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		DefinedTags:   map[string]map[string]interface{}{"EXAMPLE_KEY_jS9b4": map[string]interface{}{"EXAMPLE_KEY_WgcVt": "EXAMPLE--Value"}},
		DisplayName:   common.String("EXAMPLE-displayName-Value"),
		FreeformTags:  map[string]string{"EXAMPLE_KEY_OQf9y": "EXAMPLE_VALUE_ZCJ4872sZLZ3sfBi1R2E"},
		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("2OCBIQLN7HEYEMTDVJH3<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)
}