// 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"
	"time"

	"github.com/oracle/oci-go-sdk/v65/common"
	"github.com/oracle/oci-go-sdk/v65/database"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
)

func ExampleUpdateAutonomousDatabase() {
	// 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 := database.NewDatabaseClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

	// Create a request and dependent object(s).

	req := database.UpdateAutonomousDatabaseRequest{UpdateAutonomousDatabaseDetails: database.UpdateAutonomousDatabaseDetails{ComputeCount: common.Float32(1532.6599),
		ComputeModel:                  database.UpdateAutonomousDatabaseDetailsComputeModelOcpu,
		ResourcePoolLeaderId:          common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-resourcePoolLeaderId-Value"),
		AutoRefreshFrequencyInSeconds: common.Int(379782),
		EncryptionKey: database.AwsKeyDetails{ArnRole: common.String("EXAMPLE-arnRole-Value"),
			ExternalId:         common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value"),
			KeyArn:             common.String("EXAMPLE-keyArn-Value"),
			ServiceEndpointUri: common.String("EXAMPLE-serviceEndpointUri-Value")},
		IsLocalDataGuardEnabled:           common.Bool(true),
		PrivateEndpointLabel:              common.String("EXAMPLE-privateEndpointLabel-Value"),
		SecurityAttributes:                map[string]map[string]interface{}{"EXAMPLE_KEY_hPUEv": map[string]interface{}{"EXAMPLE_KEY_OSz5k": "EXAMPLE--Value"}},
		FreeformTags:                      map[string]string{"EXAMPLE_KEY_IeWq9": "EXAMPLE_VALUE_mDDKfdhF3fvP44OIpuf5"},
		InMemoryPercentage:                common.Int(552),
		AutoRefreshPointLagInSeconds:      common.Int(602337),
		DisplayName:                       common.String("EXAMPLE-displayName-Value"),
		LicenseModel:                      database.UpdateAutonomousDatabaseDetailsLicenseModelBringYourOwnLicense,
		SecretVersionNumber:               common.Int(48),
		ArePrimaryWhitelistedIpsUsed:      common.Bool(true),
		AutonomousMaintenanceScheduleType: database.UpdateAutonomousDatabaseDetailsAutonomousMaintenanceScheduleTypeRegular,
		BackupRetentionPeriodInDays:       common.Int(2278),
		DataStorageSizeInGBs:              common.Int(14317),
		DbWorkload:                        database.UpdateAutonomousDatabaseDetailsDbWorkloadDw,
		OpenMode:                          database.UpdateAutonomousDatabaseDetailsOpenModeOnly,
		TimeScheduledDbVersionUpgrade:     &common.SDKTime{Time: time.Now()},
		CustomerContacts:                  []database.CustomerContact{database.CustomerContact{Email: common.String("EXAMPLE-email-Value")}},
		IsAccessControlEnabled:            common.Bool(true),
		IsAutoScalingForStorageEnabled:    common.Bool(false),
		StandbyWhitelistedIps:             []string{"EXAMPLE--Value"},
		SubnetId:                          common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
		AdminPassword:                     common.String("EXAMPLE-adminPassword-Value"),
		DbToolsDetails: []database.DatabaseTool{database.DatabaseTool{ComputeCount: common.Float32(9229.4375),
			IsEnabled:            common.Bool(false),
			MaxIdleTimeInMinutes: common.Int(420),
			Name:                 database.DatabaseToolNameDatabaseActions}},
		DefinedTags:              map[string]map[string]interface{}{"EXAMPLE_KEY_WkWcM": map[string]interface{}{"EXAMPLE_KEY_6YMRP": "EXAMPLE--Value"}},
		PermissionLevel:          database.UpdateAutonomousDatabaseDetailsPermissionLevelUnrestricted,
		ByolComputeCountLimit:    common.Float32(8974.919),
		DatabaseEdition:          database.AutonomousDatabaseSummaryDatabaseEditionStandardEdition,
		IsDisconnectPeer:         common.Bool(false),
		IsFreeTier:               common.Bool(true),
		PrivateEndpointIp:        common.String("EXAMPLE-privateEndpointIp-Value"),
		IsAutoScalingEnabled:     common.Bool(false),
		IsDataGuardEnabled:       common.Bool(true),
		IsMtlsConnectionRequired: common.Bool(false),
		IsRefreshableClone:       common.Bool(false),
		RefreshableMode:          database.UpdateAutonomousDatabaseDetailsRefreshableModeAutomatic,
		VanityUrlDetails: &database.VanityUrlDetails{ApiGatewayId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-apiGatewayId-Value"),
			IsDisabled:        common.Bool(false),
			VanityUrlHostName: common.String("EXAMPLE-vanityUrlHostName-Value")},
		WhitelistedIps: []string{"EXAMPLE--Value"},
		IsDevTier:      common.Bool(true),
		LongTermBackupSchedule: &database.LongTermBackUpScheduleDetails{IsDisabled: common.Bool(true),
			RepeatCadence:         database.LongTermBackUpScheduleDetailsRepeatCadenceMonthly,
			RetentionPeriodInDays: common.Int(398),
			TimeOfBackup:          &common.SDKTime{Time: time.Now()}},
		PeerDbId:                             common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-peerDbId-Value"),
		SecretId:                             common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"),
		CpuCoreCount:                         common.Int(25),
		IsBackupRetentionLocked:              common.Bool(false),
		IsDisableDbVersionUpgradeSchedule:    common.Bool(true),
		IsScheduleDbVersionUpgradeToEarliest: common.Bool(true),
		OcpuCount:                            common.Float32(8337.313),
		ScheduledOperations: []database.ScheduledOperationDetails{database.ScheduledOperationDetails{ScheduledStartTime: common.String("EXAMPLE-scheduledStartTime-Value"),
			ScheduledStopTime: common.String("EXAMPLE-scheduledStopTime-Value"),
			DayOfWeek:         &database.DayOfWeek{Name: database.DayOfWeekNameSunday}}},
		DataStorageSizeInTBs:                 common.Int(293),
		LocalAdgAutoFailoverMaxDataLossLimit: common.Int(1944),
		TimeOfAutoRefreshStart:               &common.SDKTime{Time: time.Now()},
		DbVersion:                            common.String("EXAMPLE-dbVersion-Value"),
		NsgIds:                               []string{"EXAMPLE--Value"},
		DbName:                               common.String("EXAMPLE-dbName-Value"),
		ResourcePoolSummary: &database.ResourcePoolSummary{AvailableComputeCapacity: common.Int(213),
			IsDisabled:           common.Bool(true),
			PoolSize:             common.Int(433),
			TotalComputeCapacity: common.Int(157)}},
		AutonomousDatabaseId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-autonomousDatabaseId-Value"),
		IfMatch:              common.String("EXAMPLE-ifMatch-Value"),
		OpcDryRun:            common.Bool(false),
		OpcRequestId:         common.String("UDSBD98KSTTD2U24XEAQ<unique_ID>")}

	// Send the request using the service client
	resp, err := client.UpdateAutonomousDatabase(context.Background(), req)
	helpers.FatalIfError(err)

	// Retrieve value from the response.
	fmt.Println(resp)
}