// 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).
import * as mysql from "oci-mysql";
import common = require("oci-common");
// 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.
const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();
(async () => {
    try {
     // Create a service client
     const client = new mysql.DbSystemClient({ authenticationDetailsProvider: provider });
     // Create a request and dependent object(s).
	const  updateDbSystemDetails = {
		displayName: "EXAMPLE-displayName-Value",
		description: "EXAMPLE-description-Value",
		subnetId: "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
		nsgIds: ["EXAMPLE--Value"				],
		securityAttributes: {
			EXAMPLE_KEY_QBn7j :{
				EXAMPLE_KEY_7s4XX :"EXAMPLE--Value"
				}
			},
		databaseMode: mysql.models.DbSystem.DatabaseMode.ReadOnly,
		accessMode: mysql.models.DbSystem.AccessMode.Unrestricted,
		rest: {
			configuration: mysql.models.RestConfigurationType.DbsystemOnly,
			port: 43869,
			}
,
		isHighlyAvailable: true,
		availabilityDomain: "EXAMPLE-availabilityDomain-Value",
		faultDomain: "EXAMPLE-faultDomain-Value",
		shapeName: "EXAMPLE-shapeName-Value",
		mysqlVersion: "EXAMPLE-mysqlVersion-Value",
		configurationId: "ocid1.test.oc1..<unique_ID>EXAMPLE-configurationId-Value",
		adminUsername: "EXAMPLE-adminUsername-Value",
		adminPassword: "EXAMPLE-adminPassword-Value",
		dataStorageSizeInGBs: 83960,
		dataStorage: {
			isAutoExpandStorageEnabled: false,
			maxStorageSizeInGBs: 12025,
			}
,
		hostnameLabel: "EXAMPLE-hostnameLabel-Value",
		ipAddress: "EXAMPLE-ipAddress-Value",
		port: 14456,
		portX: 15342,
		backupPolicy: {
			isEnabled: true,
			softDelete: mysql.models.SoftDelete.Enabled,
			copyPolicies: [{
					copyToRegion: "EXAMPLE-copyToRegion-Value",
					backupCopyRetentionInDays: 13,
					}
					],
			windowStartTime: "EXAMPLE-windowStartTime-Value",
			retentionInDays: 10,
			freeformTags: {
				EXAMPLE_KEY_0Z4CH :"EXAMPLE_VALUE_oie3Eo9B6LKKJMEVJh5N"
				},
			definedTags: {
				EXAMPLE_KEY_HuR2s :{
					EXAMPLE_KEY_ZTpwh :"EXAMPLE--Value"
					}
				},
			pitrPolicy: {
				isEnabled: false,
				}
,
			}
,
		maintenance: {
			windowStartTime: "EXAMPLE-windowStartTime-Value",
			versionPreference: mysql.models.VersionPreference.Newest,
			versionTrackPreference: mysql.models.VersionTrackPreference.LongTermSupport,
			maintenanceScheduleType: mysql.models.MaintenanceScheduleType.Early,
			}
,
		freeformTags: {
			EXAMPLE_KEY_yDm3B :"EXAMPLE_VALUE_7L9iFowq7cvIhijXBDU5"
			},
		definedTags: {
			EXAMPLE_KEY_8fQz0 :{
				EXAMPLE_KEY_6MNV6 :"EXAMPLE--Value"
				}
			},
		deletionPolicy: {
			automaticBackupRetention: mysql.models.UpdateDeletionPolicyDetails.AutomaticBackupRetention.Retain,
			finalBackup: mysql.models.UpdateDeletionPolicyDetails.FinalBackup.SkipFinalBackup,
			isDeleteProtected: false,
			}
,
		crashRecovery: mysql.models.CrashRecoveryStatus.Enabled,
		databaseManagement: mysql.models.DatabaseManagementStatus.Enabled,
		secureConnections: {
			certificateId: "ocid1.test.oc1..<unique_ID>EXAMPLE-certificateId-Value",
			certificateGenerationType: mysql.models.CertificateGenerationType.System,
			}
,
		encryptData: {
			keyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-keyId-Value",
			keyGenerationType: mysql.models.KeyGenerationType.Byok,
			}
,
		customerContacts: [{
				email: "EXAMPLE-email-Value",
				}
				],
		readEndpoint: {
			isEnabled: false,
			readEndpointIpAddress: "EXAMPLE-readEndpointIpAddress-Value",
			readEndpointHostnameLabel: "EXAMPLE-readEndpointHostnameLabel-Value",
			excludeIps: ["EXAMPLE--Value"					],
			}
,
		}
	const updateDbSystemRequest: mysql.requests.UpdateDbSystemRequest = { 
	dbSystemId: "ocid1.test.oc1..<unique_ID>EXAMPLE-dbSystemId-Value",
	updateDbSystemDetails: updateDbSystemDetails,
	ifMatch: "EXAMPLE-ifMatch-Value",
	opcRequestId: "EBS9TZ1LI6PRUM57GLN4<unique_ID>",
		}; 
     // Send request to the Client.
     const updateDbSystemResponse = await client.updateDbSystem(updateDbSystemRequest);
     }
     catch (error) {
         console.log("updateDbSystem Failed with error  " + error);
     }
})();