/** 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 com.oracle.bmc.ConfigFileReader;
import com.oracle.bmc.auth.AuthenticationDetailsProvider;
import com.oracle.bmc.auth.ConfigFileAuthenticationDetailsProvider;
import com.oracle.bmc.database.DatabaseClient;
import com.oracle.bmc.database.model.*;
import com.oracle.bmc.database.requests.*;
import com.oracle.bmc.database.responses.*;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.Date;
import java.util.Arrays;


public class CreateAutonomousContainerDatabaseExample {
    public static void main(String[] args) throws Exception {

        /**
         * 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.
         */
        final ConfigFileReader.ConfigFile configFile = ConfigFileReader.parseDefault();
        final AuthenticationDetailsProvider provider = new ConfigFileAuthenticationDetailsProvider(configFile);

        /* Create a service client */
        DatabaseClient client = new DatabaseClient(provider);

        /* Create a request and dependent object(s). */
	CreateAutonomousContainerDatabaseDetails createAutonomousContainerDatabaseDetails = CreateAutonomousContainerDatabaseDetails.builder()
		.displayName("EXAMPLE-displayName-Value")
		.dbUniqueName("EXAMPLE-dbUniqueName-Value")
		.serviceLevelAgreementType(CreateAutonomousContainerDatabaseDetails.ServiceLevelAgreementType.Standard)
		.autonomousExadataInfrastructureId("ocid1.test.oc1..<unique_ID>EXAMPLE-autonomousExadataInfrastructureId-Value")
		.peerAutonomousExadataInfrastructureId("ocid1.test.oc1..<unique_ID>EXAMPLE-peerAutonomousExadataInfrastructureId-Value")
		.peerAutonomousContainerDatabaseDisplayName("EXAMPLE-peerAutonomousContainerDatabaseDisplayName-Value")
		.protectionMode(CreateAutonomousContainerDatabaseDetails.ProtectionMode.MaximumAvailability)
		.peerAutonomousVmClusterId("ocid1.test.oc1..<unique_ID>EXAMPLE-peerAutonomousVmClusterId-Value")
		.peerAutonomousContainerDatabaseCompartmentId("ocid1.test.oc1..<unique_ID>EXAMPLE-peerAutonomousContainerDatabaseCompartmentId-Value")
		.peerAutonomousContainerDatabaseBackupConfig(PeerAutonomousContainerDatabaseBackupConfig.builder()
			.backupDestinationDetails(new ArrayList<>(Arrays.asList(BackupDestinationDetails.builder()
					.type(BackupDestinationDetails.Type.RecoveryAppliance)
					.id("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value")
					.vpcUser("EXAMPLE-vpcUser-Value")
					.vpcPassword("EXAMPLE-vpcPassword-Value")
					.internetProxy("EXAMPLE-internetProxy-Value").build())))
			.recoveryWindowInDays(877).build())
		.peerDbUniqueName("EXAMPLE-peerDbUniqueName-Value")
		.autonomousVmClusterId("ocid1.test.oc1..<unique_ID>EXAMPLE-autonomousVmClusterId-Value")
		.compartmentId("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value")
		.patchModel(CreateAutonomousContainerDatabaseDetails.PatchModel.ReleaseUpdates)
		.maintenanceWindowDetails(MaintenanceWindow.builder()
			.preference(MaintenanceWindow.Preference.NoPreference)
			.months(new ArrayList<>(Arrays.asList(Month.builder()
					.name(Month.Name.March).build())))
			.weeksOfMonth(new ArrayList<>(Arrays.asList(1)))
			.daysOfWeek(new ArrayList<>(Arrays.asList(DayOfWeek.builder()
					.name(DayOfWeek.Name.Sunday).build())))
			.hoursOfDay(new ArrayList<>(Arrays.asList(5)))
			.leadTimeInWeeks(135).build())
		.standbyMaintenanceBufferInDays(302)
		.freeformTags(new HashMap<java.lang.String, java.lang.String>() {
				{
					put("EXAMPLE_KEY_hZB3G","EXAMPLE_VALUE_GsVgLY7bQGG9W3jSxiLk");
				}
 			})
		.definedTags(new HashMap<java.lang.String, java.util.Map<java.lang.String, java.lang.Object>>() {
				{
					put("EXAMPLE_KEY_lk4mO",new HashMap<java.lang.String, java.lang.Object>() {
					{
						put("EXAMPLE_KEY_ozkC4","EXAMPLE--Value");
					}
 				});
				}
 			})
		.backupConfig(AutonomousContainerDatabaseBackupConfig.builder()
			.backupDestinationDetails(new ArrayList<>(Arrays.asList(BackupDestinationDetails.builder()
					.type(BackupDestinationDetails.Type.Local)
					.id("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value")
					.vpcUser("EXAMPLE-vpcUser-Value")
					.vpcPassword("EXAMPLE-vpcPassword-Value")
					.internetProxy("EXAMPLE-internetProxy-Value").build())))
			.recoveryWindowInDays(724).build())
		.kmsKeyId("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value")
		.kmsKeyVersionId("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value")
		.vaultId("ocid1.test.oc1..<unique_ID>EXAMPLE-vaultId-Value")
		.keyStoreId("ocid1.test.oc1..<unique_ID>EXAMPLE-keyStoreId-Value").build();

	CreateAutonomousContainerDatabaseRequest createAutonomousContainerDatabaseRequest = CreateAutonomousContainerDatabaseRequest.builder()
		.createAutonomousContainerDatabaseDetails(createAutonomousContainerDatabaseDetails)
		.opcRetryToken("EXAMPLE-opcRetryToken-Value").build();

        /* Send request to the Client */
        CreateAutonomousContainerDatabaseResponse response = client.createAutonomousContainerDatabase(createAutonomousContainerDatabaseRequest);
    }

    
}