// 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"				],
		databaseMode: mysql.models.DbSystem.DatabaseMode.ReadOnly,
		accessMode: mysql.models.DbSystem.AccessMode.Unrestricted,
		rest: {
			configuration: mysql.models.RestConfigurationType.DbsystemOnly,
			port: 54146,

			}
,
		isHighlyAvailable: false,
		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: 118453,
		dataStorage: {
			isAutoExpandStorageEnabled: false,
			maxStorageSizeInGBs: 76842,

			}
,
		hostnameLabel: "EXAMPLE-hostnameLabel-Value",
		ipAddress: "EXAMPLE-ipAddress-Value",
		port: 23070,
		portX: 24443,
		backupPolicy: {
			isEnabled: false,
			softDelete: mysql.models.SoftDelete.Disabled,
			copyPolicies: [{
					copyToRegion: "EXAMPLE-copyToRegion-Value",
					backupCopyRetentionInDays: 18,

					}
					],
			windowStartTime: "EXAMPLE-windowStartTime-Value",
			retentionInDays: 6,
			freeformTags: {
				EXAMPLE_KEY_Bp7EI :"EXAMPLE_VALUE_iPinPm1jRIoIr79Td9PC"
				},
			definedTags: {
				EXAMPLE_KEY_Znxlr :{
					EXAMPLE_KEY_iL4CR :"EXAMPLE--Value"
					}
				},
			pitrPolicy: {
				isEnabled: true,

				}
,

			}
,
		maintenance: {
			windowStartTime: "EXAMPLE-windowStartTime-Value",

			}
,
		freeformTags: {
			EXAMPLE_KEY_vEHSz :"EXAMPLE_VALUE_AOHm7Jhz0sjg5MiMcwBa"
			},
		definedTags: {
			EXAMPLE_KEY_II7E5 :{
				EXAMPLE_KEY_Upg7D :"EXAMPLE--Value"
				}
			},
		deletionPolicy: {
			automaticBackupRetention: mysql.models.UpdateDeletionPolicyDetails.AutomaticBackupRetention.Delete,
			finalBackup: mysql.models.UpdateDeletionPolicyDetails.FinalBackup.SkipFinalBackup,
			isDeleteProtected: true,

			}
,
		crashRecovery: mysql.models.CrashRecoveryStatus.Enabled,
		databaseManagement: mysql.models.DatabaseManagementStatus.Disabled,
		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.System,

			}
,
		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: "RLNAD8Q0BV8FJRYNJVQT<unique_ID>",

		}; 


     // Send request to the Client.
     const updateDbSystemResponse = await client.updateDbSystem(updateDbSystemRequest);
     }
     catch (error) {
         console.log("updateDbSystem Failed with error  " + error);
     }
})();