|
| 1 | +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. |
| 2 | +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. |
| 3 | +// Code generated. DO NOT EDIT. |
| 4 | + |
| 5 | +// Database Service API |
| 6 | +// |
| 7 | +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). |
| 8 | +// |
| 9 | + |
| 10 | +package database |
| 11 | + |
| 12 | +import ( |
| 13 | + "fmt" |
| 14 | + "github.com/oracle/oci-go-sdk/v65/common" |
| 15 | + "strings" |
| 16 | +) |
| 17 | + |
| 18 | +// AddStandbyAutonomousContainerDatabaseDetails Create Standby Autonomous Container Database to an existing Autonomous Container Database |
| 19 | +type AddStandbyAutonomousContainerDatabaseDetails struct { |
| 20 | + |
| 21 | + // The lag time for my preference based on data loss tolerance in seconds. |
| 22 | + FastStartFailOverLagLimitInSeconds *int `mandatory:"false" json:"fastStartFailOverLagLimitInSeconds"` |
| 23 | + |
| 24 | + // Indicates whether Automatic Failover is enabled for Autonomous Container Database Dataguard Association |
| 25 | + IsAutomaticFailoverEnabled *bool `mandatory:"false" json:"isAutomaticFailoverEnabled"` |
| 26 | + |
| 27 | + PeerAutonomousContainerDatabaseBackupConfig *PeerAutonomousContainerDatabaseBackupConfig `mandatory:"false" json:"peerAutonomousContainerDatabaseBackupConfig"` |
| 28 | + |
| 29 | + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where the standby Autonomous Container Database |
| 30 | + // will be created. |
| 31 | + PeerAutonomousContainerDatabaseCompartmentId *string `mandatory:"false" json:"peerAutonomousContainerDatabaseCompartmentId"` |
| 32 | + |
| 33 | + // The display name for the peer Autonomous Container Database. |
| 34 | + PeerAutonomousContainerDatabaseDisplayName *string `mandatory:"false" json:"peerAutonomousContainerDatabaseDisplayName"` |
| 35 | + |
| 36 | + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the peer cloud Autonomous Exadata VM Cluster. |
| 37 | + PeerCloudAutonomousVmClusterId *string `mandatory:"false" json:"peerCloudAutonomousVmClusterId"` |
| 38 | + |
| 39 | + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the peer Autonomous Exadata VM Cluster. |
| 40 | + PeerAutonomousVmClusterId *string `mandatory:"false" json:"peerAutonomousVmClusterId"` |
| 41 | + |
| 42 | + // Specifies the `DB_UNIQUE_NAME` of the peer database to be created. |
| 43 | + PeerDbUniqueName *string `mandatory:"false" json:"peerDbUniqueName"` |
| 44 | + |
| 45 | + // The protection mode of this Autonomous Data Guard association. For more information, see |
| 46 | + // Oracle Data Guard Protection Modes (http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-protection-modes.htm#SBYDB02000) |
| 47 | + // in the Oracle Data Guard documentation. |
| 48 | + ProtectionMode AddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum `mandatory:"false" json:"protectionMode,omitempty"` |
| 49 | + |
| 50 | + // The scheduling detail for the quarterly maintenance window of the standby Autonomous Container Database. |
| 51 | + // This value represents the number of days before scheduled maintenance of the primary database. |
| 52 | + StandbyMaintenanceBufferInDays *int `mandatory:"false" json:"standbyMaintenanceBufferInDays"` |
| 53 | +} |
| 54 | + |
| 55 | +func (m AddStandbyAutonomousContainerDatabaseDetails) String() string { |
| 56 | + return common.PointerString(m) |
| 57 | +} |
| 58 | + |
| 59 | +// ValidateEnumValue returns an error when providing an unsupported enum value |
| 60 | +// This function is being called during constructing API request process |
| 61 | +// Not recommended for calling this function directly |
| 62 | +func (m AddStandbyAutonomousContainerDatabaseDetails) ValidateEnumValue() (bool, error) { |
| 63 | + errMessage := []string{} |
| 64 | + |
| 65 | + if _, ok := GetMappingAddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum(string(m.ProtectionMode)); !ok && m.ProtectionMode != "" { |
| 66 | + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ProtectionMode: %s. Supported values are: %s.", m.ProtectionMode, strings.Join(GetAddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnumStringValues(), ","))) |
| 67 | + } |
| 68 | + if len(errMessage) > 0 { |
| 69 | + return true, fmt.Errorf(strings.Join(errMessage, "\n")) |
| 70 | + } |
| 71 | + return false, nil |
| 72 | +} |
| 73 | + |
| 74 | +// AddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum Enum with underlying type: string |
| 75 | +type AddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum string |
| 76 | + |
| 77 | +// Set of constants representing the allowable values for AddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum |
| 78 | +const ( |
| 79 | + AddStandbyAutonomousContainerDatabaseDetailsProtectionModeAvailability AddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum = "MAXIMUM_AVAILABILITY" |
| 80 | + AddStandbyAutonomousContainerDatabaseDetailsProtectionModePerformance AddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum = "MAXIMUM_PERFORMANCE" |
| 81 | +) |
| 82 | + |
| 83 | +var mappingAddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum = map[string]AddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum{ |
| 84 | + "MAXIMUM_AVAILABILITY": AddStandbyAutonomousContainerDatabaseDetailsProtectionModeAvailability, |
| 85 | + "MAXIMUM_PERFORMANCE": AddStandbyAutonomousContainerDatabaseDetailsProtectionModePerformance, |
| 86 | +} |
| 87 | + |
| 88 | +var mappingAddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnumLowerCase = map[string]AddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum{ |
| 89 | + "maximum_availability": AddStandbyAutonomousContainerDatabaseDetailsProtectionModeAvailability, |
| 90 | + "maximum_performance": AddStandbyAutonomousContainerDatabaseDetailsProtectionModePerformance, |
| 91 | +} |
| 92 | + |
| 93 | +// GetAddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnumValues Enumerates the set of values for AddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum |
| 94 | +func GetAddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnumValues() []AddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum { |
| 95 | + values := make([]AddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum, 0) |
| 96 | + for _, v := range mappingAddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum { |
| 97 | + values = append(values, v) |
| 98 | + } |
| 99 | + return values |
| 100 | +} |
| 101 | + |
| 102 | +// GetAddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnumStringValues Enumerates the set of values in String for AddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum |
| 103 | +func GetAddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnumStringValues() []string { |
| 104 | + return []string{ |
| 105 | + "MAXIMUM_AVAILABILITY", |
| 106 | + "MAXIMUM_PERFORMANCE", |
| 107 | + } |
| 108 | +} |
| 109 | + |
| 110 | +// GetMappingAddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum performs case Insensitive comparison on enum value and return the desired enum |
| 111 | +func GetMappingAddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum(val string) (AddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnum, bool) { |
| 112 | + enum, ok := mappingAddStandbyAutonomousContainerDatabaseDetailsProtectionModeEnumLowerCase[strings.ToLower(val)] |
| 113 | + return enum, ok |
| 114 | +} |
0 commit comments