// 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{AutonomousDatabaseId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-autonomousDatabaseId-Value"),
		IfMatch:      common.String("EXAMPLE-ifMatch-Value"),
		OpcRequestId: common.String("VIAFRLKZSMRVTURFVZ8Z<unique_ID>"),
		UpdateAutonomousDatabaseDetails: database.UpdateAutonomousDatabaseDetails{ComputeCount: common.Float32(4031.7673),
			ComputeModel:                  database.UpdateAutonomousDatabaseDetailsComputeModelEcpu,
			IsAutoScalingEnabled:          common.Bool(true),
			IsDevTier:                     common.Bool(true),
			PrivateEndpointLabel:          common.String("EXAMPLE-privateEndpointLabel-Value"),
			ArePrimaryWhitelistedIpsUsed:  common.Bool(false),
			CustomerContacts:              []database.CustomerContact{database.CustomerContact{Email: common.String("EXAMPLE-email-Value")}},
			LicenseModel:                  database.UpdateAutonomousDatabaseDetailsLicenseModelBringYourOwnLicense,
			PermissionLevel:               database.UpdateAutonomousDatabaseDetailsPermissionLevelUnrestricted,
			RefreshableMode:               database.UpdateAutonomousDatabaseDetailsRefreshableModeManual,
			TimeOfAutoRefreshStart:        &common.SDKTime{Time: time.Now()},
			AutoRefreshFrequencyInSeconds: common.Int(420237),
			BackupRetentionPeriodInDays:   common.Int(1430),
			IsDataGuardEnabled:            common.Bool(true),
			OcpuCount:                     common.Float32(8847.49),
			OpenMode:                      database.UpdateAutonomousDatabaseDetailsOpenModeWrite,
			ResourcePoolSummary: &database.ResourcePoolSummary{IsDisabled: common.Bool(true),
				PoolSize: common.Int(599)},
			CpuCoreCount: common.Int(91),
			DbName:       common.String("EXAMPLE-dbName-Value"),
			DisplayName:  common.String("EXAMPLE-displayName-Value"),
			LongTermBackupSchedule: &database.LongTermBackUpScheduleDetails{RetentionPeriodInDays: common.Int(3285),
				TimeOfBackup:  &common.SDKTime{Time: time.Now()},
				IsDisabled:    common.Bool(false),
				RepeatCadence: database.LongTermBackUpScheduleDetailsRepeatCadenceOneTime},
			PeerDbId:                 common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-peerDbId-Value"),
			SecretId:                 common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"),
			DataStorageSizeInTBs:     common.Int(32),
			DbWorkload:               database.UpdateAutonomousDatabaseDetailsDbWorkloadApex,
			IsLocalDataGuardEnabled:  common.Bool(true),
			IsMtlsConnectionRequired: common.Bool(false),
			ScheduledOperations: []database.ScheduledOperationDetails{database.ScheduledOperationDetails{ScheduledStopTime: common.String("EXAMPLE-scheduledStopTime-Value"),
				DayOfWeek:          &database.DayOfWeek{Name: database.DayOfWeekNameMonday},
				ScheduledStartTime: common.String("EXAMPLE-scheduledStartTime-Value")}},
			IsAutoScalingForStorageEnabled: common.Bool(false),
			IsFreeTier:                     common.Bool(false),
			IsRefreshableClone:             common.Bool(true),
			AdminPassword:                  common.String("EXAMPLE-adminPassword-Value"),
			DataStorageSizeInGBs:           common.Int(31112),
			DatabaseEdition:                database.AutonomousDatabaseSummaryDatabaseEditionStandardEdition,
			FreeformTags:                   map[string]string{"EXAMPLE_KEY_l5d5a": "EXAMPLE_VALUE_c6wHZcP4MRFu7CAfls8W"},
			IsAccessControlEnabled:         common.Bool(false),
			StandbyWhitelistedIps:          []string{"EXAMPLE--Value"},
			WhitelistedIps:                 []string{"EXAMPLE--Value"},
			NsgIds:                         []string{"EXAMPLE--Value"},
			ResourcePoolLeaderId:           common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-resourcePoolLeaderId-Value"),
			AutoRefreshPointLagInSeconds:   common.Int(286836),
			DbToolsDetails: []database.DatabaseTool{database.DatabaseTool{ComputeCount: common.Float32(212.81769),
				IsEnabled:            common.Bool(false),
				MaxIdleTimeInMinutes: common.Int(422),
				Name:                 database.DatabaseToolNameDataTransforms}},
			DbVersion:                            common.String("EXAMPLE-dbVersion-Value"),
			DefinedTags:                          map[string]map[string]interface{}{"EXAMPLE_KEY_KyaDn": map[string]interface{}{"EXAMPLE_KEY_So4Ye": "EXAMPLE--Value"}},
			LocalAdgAutoFailoverMaxDataLossLimit: common.Int(730),
			InMemoryPercentage:                   common.Int(698),
			PrivateEndpointIp:                    common.String("EXAMPLE-privateEndpointIp-Value"),
			SecretVersionNumber:                  common.Int(28),
			SubnetId:                             common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value")}}

	// 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)
}