|
| 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 | +// Core Services API |
| 6 | +// |
| 7 | +// Use the Core Services API to manage resources such as virtual cloud networks (VCNs), |
| 8 | +// compute instances, and block storage volumes. For more information, see the console |
| 9 | +// documentation for the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), |
| 10 | +// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and |
| 11 | +// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. |
| 12 | +// The required permissions are documented in the |
| 13 | +// Details for the Core Services (https://docs.cloud.oracle.com/iaas/Content/Identity/Reference/corepolicyreference.htm) article. |
| 14 | +// |
| 15 | + |
| 16 | +package core |
| 17 | + |
| 18 | +import ( |
| 19 | + "fmt" |
| 20 | + "github.com/oracle/oci-go-sdk/v65/common" |
| 21 | + "strings" |
| 22 | +) |
| 23 | + |
| 24 | +// Byoasn Oracle offers the ability to Bring Your Own Autonomous System Number (BYOASN), importing AS Numbers you currently own to Oracle Cloud Infrastructure. A `Byoasn` resource is a record of the imported AS Number and also some associated metadata. The process used to Bring Your Own ASN (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/BYOASN.htm) is explained in the documentation. |
| 25 | +type Byoasn struct { |
| 26 | + |
| 27 | + // The `Byoasn` resource's current state. |
| 28 | + LifecycleState ByoasnLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` |
| 29 | + |
| 30 | + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the `Byoasn` resource. |
| 31 | + Id *string `mandatory:"true" json:"id"` |
| 32 | + |
| 33 | + // The Autonomous System Number (ASN) you are importing to the Oracle cloud. |
| 34 | + Asn *int64 `mandatory:"true" json:"asn"` |
| 35 | + |
| 36 | + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the `Byoasn` resource. |
| 37 | + CompartmentId *string `mandatory:"true" json:"compartmentId"` |
| 38 | + |
| 39 | + // The validation token is an internally-generated ASCII string used in the validation process. See Importing a Byoasn (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/BYOASN.htm) for details. |
| 40 | + ValidationToken *string `mandatory:"true" json:"validationToken"` |
| 41 | + |
| 42 | + // The date and time the `Byoasn` resource was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). |
| 43 | + // Example: `2016-08-25T21:10:29.600Z` |
| 44 | + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` |
| 45 | + |
| 46 | + // Defined tags for this resource. Each key is predefined and scoped to a |
| 47 | + // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). |
| 48 | + // Example: `{"Operations": {"CostCenter": "42"}}` |
| 49 | + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` |
| 50 | + |
| 51 | + // A user-friendly name. Does not have to be unique, and it's changeable. |
| 52 | + // Avoid entering confidential information. |
| 53 | + DisplayName *string `mandatory:"false" json:"displayName"` |
| 54 | + |
| 55 | + // Free-form tags for this resource. Each tag is a simple key-value pair with no |
| 56 | + // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). |
| 57 | + // Example: `{"Department": "Finance"}` |
| 58 | + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` |
| 59 | + |
| 60 | + // The date and time the `Byoasn` resource was validated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). |
| 61 | + // Example: `2016-08-25T21:10:29.600Z` |
| 62 | + TimeValidated *common.SDKTime `mandatory:"false" json:"timeValidated"` |
| 63 | + |
| 64 | + // The date and time the `Byoasn` resource was last updated, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). |
| 65 | + // Example: `2016-08-25T21:10:29.600Z` |
| 66 | + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` |
| 67 | + |
| 68 | + // The BYOIP Ranges that has the `Byoasn` as origin. |
| 69 | + ByoipRanges []ByoasnByoipRange `mandatory:"false" json:"byoipRanges"` |
| 70 | +} |
| 71 | + |
| 72 | +func (m Byoasn) String() string { |
| 73 | + return common.PointerString(m) |
| 74 | +} |
| 75 | + |
| 76 | +// ValidateEnumValue returns an error when providing an unsupported enum value |
| 77 | +// This function is being called during constructing API request process |
| 78 | +// Not recommended for calling this function directly |
| 79 | +func (m Byoasn) ValidateEnumValue() (bool, error) { |
| 80 | + errMessage := []string{} |
| 81 | + if _, ok := GetMappingByoasnLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { |
| 82 | + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetByoasnLifecycleStateEnumStringValues(), ","))) |
| 83 | + } |
| 84 | + |
| 85 | + if len(errMessage) > 0 { |
| 86 | + return true, fmt.Errorf(strings.Join(errMessage, "\n")) |
| 87 | + } |
| 88 | + return false, nil |
| 89 | +} |
| 90 | + |
| 91 | +// ByoasnLifecycleStateEnum Enum with underlying type: string |
| 92 | +type ByoasnLifecycleStateEnum string |
| 93 | + |
| 94 | +// Set of constants representing the allowable values for ByoasnLifecycleStateEnum |
| 95 | +const ( |
| 96 | + ByoasnLifecycleStateUpdating ByoasnLifecycleStateEnum = "UPDATING" |
| 97 | + ByoasnLifecycleStateActive ByoasnLifecycleStateEnum = "ACTIVE" |
| 98 | + ByoasnLifecycleStateDeleted ByoasnLifecycleStateEnum = "DELETED" |
| 99 | + ByoasnLifecycleStateFailed ByoasnLifecycleStateEnum = "FAILED" |
| 100 | + ByoasnLifecycleStateCreating ByoasnLifecycleStateEnum = "CREATING" |
| 101 | +) |
| 102 | + |
| 103 | +var mappingByoasnLifecycleStateEnum = map[string]ByoasnLifecycleStateEnum{ |
| 104 | + "UPDATING": ByoasnLifecycleStateUpdating, |
| 105 | + "ACTIVE": ByoasnLifecycleStateActive, |
| 106 | + "DELETED": ByoasnLifecycleStateDeleted, |
| 107 | + "FAILED": ByoasnLifecycleStateFailed, |
| 108 | + "CREATING": ByoasnLifecycleStateCreating, |
| 109 | +} |
| 110 | + |
| 111 | +var mappingByoasnLifecycleStateEnumLowerCase = map[string]ByoasnLifecycleStateEnum{ |
| 112 | + "updating": ByoasnLifecycleStateUpdating, |
| 113 | + "active": ByoasnLifecycleStateActive, |
| 114 | + "deleted": ByoasnLifecycleStateDeleted, |
| 115 | + "failed": ByoasnLifecycleStateFailed, |
| 116 | + "creating": ByoasnLifecycleStateCreating, |
| 117 | +} |
| 118 | + |
| 119 | +// GetByoasnLifecycleStateEnumValues Enumerates the set of values for ByoasnLifecycleStateEnum |
| 120 | +func GetByoasnLifecycleStateEnumValues() []ByoasnLifecycleStateEnum { |
| 121 | + values := make([]ByoasnLifecycleStateEnum, 0) |
| 122 | + for _, v := range mappingByoasnLifecycleStateEnum { |
| 123 | + values = append(values, v) |
| 124 | + } |
| 125 | + return values |
| 126 | +} |
| 127 | + |
| 128 | +// GetByoasnLifecycleStateEnumStringValues Enumerates the set of values in String for ByoasnLifecycleStateEnum |
| 129 | +func GetByoasnLifecycleStateEnumStringValues() []string { |
| 130 | + return []string{ |
| 131 | + "UPDATING", |
| 132 | + "ACTIVE", |
| 133 | + "DELETED", |
| 134 | + "FAILED", |
| 135 | + "CREATING", |
| 136 | + } |
| 137 | +} |
| 138 | + |
| 139 | +// GetMappingByoasnLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum |
| 140 | +func GetMappingByoasnLifecycleStateEnum(val string) (ByoasnLifecycleStateEnum, bool) { |
| 141 | + enum, ok := mappingByoasnLifecycleStateEnumLowerCase[strings.ToLower(val)] |
| 142 | + return enum, ok |
| 143 | +} |
0 commit comments