|
| 1 | +// Copyright (c) 2016, 2018, 2023, 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 | +// Compute Cloud@Customer API |
| 6 | +// |
| 7 | +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments |
| 8 | +// and scheduled upgrades. For more information see |
| 9 | +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). |
| 10 | +// |
| 11 | + |
| 12 | +package computecloudatcustomer |
| 13 | + |
| 14 | +import ( |
| 15 | + "fmt" |
| 16 | + "github.com/oracle/oci-go-sdk/v65/common" |
| 17 | + "strings" |
| 18 | +) |
| 19 | + |
| 20 | +// CccInfrastructure The Oracle Cloud Infrastructure resource representing the connection to the hardware and |
| 21 | +// software located in a customer's data center running the Compute Cloud@Customer IaaS services. |
| 22 | +type CccInfrastructure struct { |
| 23 | + |
| 24 | + // The Compute Cloud@Customer infrastructure OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). |
| 25 | + // This cannot be changed once created. |
| 26 | + Id *string `mandatory:"true" json:"id"` |
| 27 | + |
| 28 | + // The name that will be used to display the Compute Cloud@Customer infrastructure |
| 29 | + // in the Oracle Cloud Infrastructure console. Does not have to be unique and can be changed. |
| 30 | + // Avoid entering confidential information. |
| 31 | + DisplayName *string `mandatory:"true" json:"displayName"` |
| 32 | + |
| 33 | + // The infrastructure compartment OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). |
| 34 | + CompartmentId *string `mandatory:"true" json:"compartmentId"` |
| 35 | + |
| 36 | + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network subnet that is |
| 37 | + // used to communicate with Compute Cloud@Customer infrastructure. |
| 38 | + SubnetId *string `mandatory:"true" json:"subnetId"` |
| 39 | + |
| 40 | + // Compute Cloud@Customer infrastructure creation date and time, using an RFC3339 formatted |
| 41 | + // datetime string. |
| 42 | + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` |
| 43 | + |
| 44 | + // The current state of the Compute Cloud@Customer infrastructure. |
| 45 | + LifecycleState CccInfrastructureLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` |
| 46 | + |
| 47 | + // The Compute Cloud@Customer infrastructure short name. |
| 48 | + // This cannot be changed once created. The |
| 49 | + // short name is used to refer to the infrastructure in several contexts and is unique. |
| 50 | + ShortName *string `mandatory:"false" json:"shortName"` |
| 51 | + |
| 52 | + // A mutable client-meaningful text description of the Compute Cloud@Customer infrastructure. |
| 53 | + // Avoid entering confidential information. |
| 54 | + Description *string `mandatory:"false" json:"description"` |
| 55 | + |
| 56 | + // The current connection state of the infrastructure. A user can only update |
| 57 | + // it from REQUEST to READY or from any state back to REJECT. The system automatically |
| 58 | + // handles the REJECT to REQUEST, READY to CONNECTED, or CONNECTED to DISCONNECTED transitions. |
| 59 | + ConnectionState CccInfrastructureConnectionStateEnum `mandatory:"false" json:"connectionState,omitempty"` |
| 60 | + |
| 61 | + // A message describing the current connection state in more detail. |
| 62 | + ConnectionDetails *string `mandatory:"false" json:"connectionDetails"` |
| 63 | + |
| 64 | + // Schedule used for upgrades. If no schedule is associated with the infrastructure, |
| 65 | + // it can be updated at any time. |
| 66 | + CccUpgradeScheduleId *string `mandatory:"false" json:"cccUpgradeScheduleId"` |
| 67 | + |
| 68 | + // Fingerprint of a Compute Cloud@Customer infrastructure in a data center generated |
| 69 | + // during the initial connection to this resource. The fingerprint should be verified |
| 70 | + // by the administrator when changing the connectionState from REQUEST to READY. |
| 71 | + ProvisioningFingerprint *string `mandatory:"false" json:"provisioningFingerprint"` |
| 72 | + |
| 73 | + // Code that is required for service personnel to connect a |
| 74 | + // Compute Cloud@Customer infrastructure in a data center to this resource. |
| 75 | + // This code will only be available when the connectionState is REJECT (usually |
| 76 | + // at create time of the Compute Cloud@Customer infrastructure). |
| 77 | + ProvisioningPin *string `mandatory:"false" json:"provisioningPin"` |
| 78 | + |
| 79 | + // Compute Cloud@Customer infrastructure updated date and time, using an RFC3339 formatted |
| 80 | + // datetime string. |
| 81 | + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` |
| 82 | + |
| 83 | + // A message describing the current lifecycle state in more detail. |
| 84 | + // For example, this can be used to provide actionable information for a resource that is in |
| 85 | + // a Failed state. |
| 86 | + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` |
| 87 | + |
| 88 | + InfrastructureInventory *CccInfrastructureInventory `mandatory:"false" json:"infrastructureInventory"` |
| 89 | + |
| 90 | + InfrastructureNetworkConfiguration *CccInfrastructureNetworkConfiguration `mandatory:"false" json:"infrastructureNetworkConfiguration"` |
| 91 | + |
| 92 | + UpgradeInformation *CccUpgradeInformation `mandatory:"false" json:"upgradeInformation"` |
| 93 | + |
| 94 | + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. |
| 95 | + // Example: `{"bar-key": "value"}` |
| 96 | + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` |
| 97 | + |
| 98 | + // Defined tags for this resource. Each key is predefined and scoped to a namespace. |
| 99 | + // Example: `{"foo-namespace": {"bar-key": "value"}}` |
| 100 | + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` |
| 101 | + |
| 102 | + // System tags for this resource. Each key is predefined and scoped to a namespace. |
| 103 | + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` |
| 104 | + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` |
| 105 | +} |
| 106 | + |
| 107 | +func (m CccInfrastructure) String() string { |
| 108 | + return common.PointerString(m) |
| 109 | +} |
| 110 | + |
| 111 | +// ValidateEnumValue returns an error when providing an unsupported enum value |
| 112 | +// This function is being called during constructing API request process |
| 113 | +// Not recommended for calling this function directly |
| 114 | +func (m CccInfrastructure) ValidateEnumValue() (bool, error) { |
| 115 | + errMessage := []string{} |
| 116 | + if _, ok := GetMappingCccInfrastructureLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { |
| 117 | + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetCccInfrastructureLifecycleStateEnumStringValues(), ","))) |
| 118 | + } |
| 119 | + |
| 120 | + if _, ok := GetMappingCccInfrastructureConnectionStateEnum(string(m.ConnectionState)); !ok && m.ConnectionState != "" { |
| 121 | + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ConnectionState: %s. Supported values are: %s.", m.ConnectionState, strings.Join(GetCccInfrastructureConnectionStateEnumStringValues(), ","))) |
| 122 | + } |
| 123 | + if len(errMessage) > 0 { |
| 124 | + return true, fmt.Errorf(strings.Join(errMessage, "\n")) |
| 125 | + } |
| 126 | + return false, nil |
| 127 | +} |
| 128 | + |
| 129 | +// CccInfrastructureConnectionStateEnum Enum with underlying type: string |
| 130 | +type CccInfrastructureConnectionStateEnum string |
| 131 | + |
| 132 | +// Set of constants representing the allowable values for CccInfrastructureConnectionStateEnum |
| 133 | +const ( |
| 134 | + CccInfrastructureConnectionStateReject CccInfrastructureConnectionStateEnum = "REJECT" |
| 135 | + CccInfrastructureConnectionStateRequest CccInfrastructureConnectionStateEnum = "REQUEST" |
| 136 | + CccInfrastructureConnectionStateReady CccInfrastructureConnectionStateEnum = "READY" |
| 137 | + CccInfrastructureConnectionStateConnected CccInfrastructureConnectionStateEnum = "CONNECTED" |
| 138 | + CccInfrastructureConnectionStateDisconnected CccInfrastructureConnectionStateEnum = "DISCONNECTED" |
| 139 | +) |
| 140 | + |
| 141 | +var mappingCccInfrastructureConnectionStateEnum = map[string]CccInfrastructureConnectionStateEnum{ |
| 142 | + "REJECT": CccInfrastructureConnectionStateReject, |
| 143 | + "REQUEST": CccInfrastructureConnectionStateRequest, |
| 144 | + "READY": CccInfrastructureConnectionStateReady, |
| 145 | + "CONNECTED": CccInfrastructureConnectionStateConnected, |
| 146 | + "DISCONNECTED": CccInfrastructureConnectionStateDisconnected, |
| 147 | +} |
| 148 | + |
| 149 | +var mappingCccInfrastructureConnectionStateEnumLowerCase = map[string]CccInfrastructureConnectionStateEnum{ |
| 150 | + "reject": CccInfrastructureConnectionStateReject, |
| 151 | + "request": CccInfrastructureConnectionStateRequest, |
| 152 | + "ready": CccInfrastructureConnectionStateReady, |
| 153 | + "connected": CccInfrastructureConnectionStateConnected, |
| 154 | + "disconnected": CccInfrastructureConnectionStateDisconnected, |
| 155 | +} |
| 156 | + |
| 157 | +// GetCccInfrastructureConnectionStateEnumValues Enumerates the set of values for CccInfrastructureConnectionStateEnum |
| 158 | +func GetCccInfrastructureConnectionStateEnumValues() []CccInfrastructureConnectionStateEnum { |
| 159 | + values := make([]CccInfrastructureConnectionStateEnum, 0) |
| 160 | + for _, v := range mappingCccInfrastructureConnectionStateEnum { |
| 161 | + values = append(values, v) |
| 162 | + } |
| 163 | + return values |
| 164 | +} |
| 165 | + |
| 166 | +// GetCccInfrastructureConnectionStateEnumStringValues Enumerates the set of values in String for CccInfrastructureConnectionStateEnum |
| 167 | +func GetCccInfrastructureConnectionStateEnumStringValues() []string { |
| 168 | + return []string{ |
| 169 | + "REJECT", |
| 170 | + "REQUEST", |
| 171 | + "READY", |
| 172 | + "CONNECTED", |
| 173 | + "DISCONNECTED", |
| 174 | + } |
| 175 | +} |
| 176 | + |
| 177 | +// GetMappingCccInfrastructureConnectionStateEnum performs case Insensitive comparison on enum value and return the desired enum |
| 178 | +func GetMappingCccInfrastructureConnectionStateEnum(val string) (CccInfrastructureConnectionStateEnum, bool) { |
| 179 | + enum, ok := mappingCccInfrastructureConnectionStateEnumLowerCase[strings.ToLower(val)] |
| 180 | + return enum, ok |
| 181 | +} |
| 182 | + |
| 183 | +// CccInfrastructureLifecycleStateEnum Enum with underlying type: string |
| 184 | +type CccInfrastructureLifecycleStateEnum string |
| 185 | + |
| 186 | +// Set of constants representing the allowable values for CccInfrastructureLifecycleStateEnum |
| 187 | +const ( |
| 188 | + CccInfrastructureLifecycleStateActive CccInfrastructureLifecycleStateEnum = "ACTIVE" |
| 189 | + CccInfrastructureLifecycleStateNeedsAttention CccInfrastructureLifecycleStateEnum = "NEEDS_ATTENTION" |
| 190 | + CccInfrastructureLifecycleStateDeleted CccInfrastructureLifecycleStateEnum = "DELETED" |
| 191 | + CccInfrastructureLifecycleStateFailed CccInfrastructureLifecycleStateEnum = "FAILED" |
| 192 | +) |
| 193 | + |
| 194 | +var mappingCccInfrastructureLifecycleStateEnum = map[string]CccInfrastructureLifecycleStateEnum{ |
| 195 | + "ACTIVE": CccInfrastructureLifecycleStateActive, |
| 196 | + "NEEDS_ATTENTION": CccInfrastructureLifecycleStateNeedsAttention, |
| 197 | + "DELETED": CccInfrastructureLifecycleStateDeleted, |
| 198 | + "FAILED": CccInfrastructureLifecycleStateFailed, |
| 199 | +} |
| 200 | + |
| 201 | +var mappingCccInfrastructureLifecycleStateEnumLowerCase = map[string]CccInfrastructureLifecycleStateEnum{ |
| 202 | + "active": CccInfrastructureLifecycleStateActive, |
| 203 | + "needs_attention": CccInfrastructureLifecycleStateNeedsAttention, |
| 204 | + "deleted": CccInfrastructureLifecycleStateDeleted, |
| 205 | + "failed": CccInfrastructureLifecycleStateFailed, |
| 206 | +} |
| 207 | + |
| 208 | +// GetCccInfrastructureLifecycleStateEnumValues Enumerates the set of values for CccInfrastructureLifecycleStateEnum |
| 209 | +func GetCccInfrastructureLifecycleStateEnumValues() []CccInfrastructureLifecycleStateEnum { |
| 210 | + values := make([]CccInfrastructureLifecycleStateEnum, 0) |
| 211 | + for _, v := range mappingCccInfrastructureLifecycleStateEnum { |
| 212 | + values = append(values, v) |
| 213 | + } |
| 214 | + return values |
| 215 | +} |
| 216 | + |
| 217 | +// GetCccInfrastructureLifecycleStateEnumStringValues Enumerates the set of values in String for CccInfrastructureLifecycleStateEnum |
| 218 | +func GetCccInfrastructureLifecycleStateEnumStringValues() []string { |
| 219 | + return []string{ |
| 220 | + "ACTIVE", |
| 221 | + "NEEDS_ATTENTION", |
| 222 | + "DELETED", |
| 223 | + "FAILED", |
| 224 | + } |
| 225 | +} |
| 226 | + |
| 227 | +// GetMappingCccInfrastructureLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum |
| 228 | +func GetMappingCccInfrastructureLifecycleStateEnum(val string) (CccInfrastructureLifecycleStateEnum, bool) { |
| 229 | + enum, ok := mappingCccInfrastructureLifecycleStateEnumLowerCase[strings.ToLower(val)] |
| 230 | + return enum, ok |
| 231 | +} |
0 commit comments