|
| 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 | +// Oracle Cloud Bridge API |
| 6 | +// |
| 7 | +// API for Oracle Cloud Bridge service. |
| 8 | +// |
| 9 | + |
| 10 | +package cloudbridge |
| 11 | + |
| 12 | +import ( |
| 13 | + "encoding/json" |
| 14 | + "fmt" |
| 15 | + "github.com/oracle/oci-go-sdk/v65/common" |
| 16 | + "strings" |
| 17 | +) |
| 18 | + |
| 19 | +// AwsAssetSource AWS asset source. Used for discovery of EC2 instances and EBS volumes registered for the AWS account. |
| 20 | +type AwsAssetSource struct { |
| 21 | + |
| 22 | + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the resource. |
| 23 | + Id *string `mandatory:"true" json:"id"` |
| 24 | + |
| 25 | + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment for the resource. |
| 26 | + CompartmentId *string `mandatory:"true" json:"compartmentId"` |
| 27 | + |
| 28 | + // A user-friendly name for the asset source. Does not have to be unique, and it's mutable. |
| 29 | + // Avoid entering confidential information. |
| 30 | + DisplayName *string `mandatory:"true" json:"displayName"` |
| 31 | + |
| 32 | + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the environment. |
| 33 | + EnvironmentId *string `mandatory:"true" json:"environmentId"` |
| 34 | + |
| 35 | + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the inventory that will contain created assets. |
| 36 | + InventoryId *string `mandatory:"true" json:"inventoryId"` |
| 37 | + |
| 38 | + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that is going to be used to create assets. |
| 39 | + AssetsCompartmentId *string `mandatory:"true" json:"assetsCompartmentId"` |
| 40 | + |
| 41 | + // The detailed state of the asset source. |
| 42 | + LifecycleDetails *string `mandatory:"true" json:"lifecycleDetails"` |
| 43 | + |
| 44 | + // The time when the asset source was created in the RFC3339 format. |
| 45 | + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` |
| 46 | + |
| 47 | + // The point in time that the asset source was last updated in the RFC3339 format. |
| 48 | + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` |
| 49 | + |
| 50 | + DiscoveryCredentials *AssetSourceCredentials `mandatory:"true" json:"discoveryCredentials"` |
| 51 | + |
| 52 | + // AWS region information, from where the resources are discovered. |
| 53 | + AwsRegion *string `mandatory:"true" json:"awsRegion"` |
| 54 | + |
| 55 | + // The key of customer's aws account to be discovered/migrated. |
| 56 | + AwsAccountKey *string `mandatory:"true" json:"awsAccountKey"` |
| 57 | + |
| 58 | + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of an attached discovery schedule. |
| 59 | + DiscoveryScheduleId *string `mandatory:"false" json:"discoveryScheduleId"` |
| 60 | + |
| 61 | + // The freeform tags associated with this resource, if any. Each tag is a simple key-value pair with no |
| 62 | + // predefined name, type, or namespace/scope. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). |
| 63 | + // Example: `{"Department": "Finance"}` |
| 64 | + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` |
| 65 | + |
| 66 | + // The defined tags associated with this resource, if any. Each key is predefined and scoped to namespaces. |
| 67 | + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). |
| 68 | + // Example: `{"Operations": {"CostCenter": "42"}}` |
| 69 | + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` |
| 70 | + |
| 71 | + // The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. |
| 72 | + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). |
| 73 | + // Example: `{orcl-cloud: {free-tier-retain: true}}` |
| 74 | + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` |
| 75 | + |
| 76 | + ReplicationCredentials *AssetSourceCredentials `mandatory:"false" json:"replicationCredentials"` |
| 77 | + |
| 78 | + // Flag indicating whether historical metrics are collected for assets, originating from this asset source. |
| 79 | + AreHistoricalMetricsCollected *bool `mandatory:"false" json:"areHistoricalMetricsCollected"` |
| 80 | + |
| 81 | + // Flag indicating whether real-time metrics are collected for assets, originating from this asset source. |
| 82 | + AreRealtimeMetricsCollected *bool `mandatory:"false" json:"areRealtimeMetricsCollected"` |
| 83 | + |
| 84 | + // Flag indicating whether cost data collection is enabled for assets, originating from this asset source. |
| 85 | + IsCostInformationCollected *bool `mandatory:"false" json:"isCostInformationCollected"` |
| 86 | + |
| 87 | + // The current state of the asset source. |
| 88 | + LifecycleState AssetSourceLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` |
| 89 | +} |
| 90 | + |
| 91 | +// GetId returns Id |
| 92 | +func (m AwsAssetSource) GetId() *string { |
| 93 | + return m.Id |
| 94 | +} |
| 95 | + |
| 96 | +// GetCompartmentId returns CompartmentId |
| 97 | +func (m AwsAssetSource) GetCompartmentId() *string { |
| 98 | + return m.CompartmentId |
| 99 | +} |
| 100 | + |
| 101 | +// GetDisplayName returns DisplayName |
| 102 | +func (m AwsAssetSource) GetDisplayName() *string { |
| 103 | + return m.DisplayName |
| 104 | +} |
| 105 | + |
| 106 | +// GetEnvironmentId returns EnvironmentId |
| 107 | +func (m AwsAssetSource) GetEnvironmentId() *string { |
| 108 | + return m.EnvironmentId |
| 109 | +} |
| 110 | + |
| 111 | +// GetInventoryId returns InventoryId |
| 112 | +func (m AwsAssetSource) GetInventoryId() *string { |
| 113 | + return m.InventoryId |
| 114 | +} |
| 115 | + |
| 116 | +// GetAssetsCompartmentId returns AssetsCompartmentId |
| 117 | +func (m AwsAssetSource) GetAssetsCompartmentId() *string { |
| 118 | + return m.AssetsCompartmentId |
| 119 | +} |
| 120 | + |
| 121 | +// GetDiscoveryScheduleId returns DiscoveryScheduleId |
| 122 | +func (m AwsAssetSource) GetDiscoveryScheduleId() *string { |
| 123 | + return m.DiscoveryScheduleId |
| 124 | +} |
| 125 | + |
| 126 | +// GetLifecycleState returns LifecycleState |
| 127 | +func (m AwsAssetSource) GetLifecycleState() AssetSourceLifecycleStateEnum { |
| 128 | + return m.LifecycleState |
| 129 | +} |
| 130 | + |
| 131 | +// GetLifecycleDetails returns LifecycleDetails |
| 132 | +func (m AwsAssetSource) GetLifecycleDetails() *string { |
| 133 | + return m.LifecycleDetails |
| 134 | +} |
| 135 | + |
| 136 | +// GetTimeCreated returns TimeCreated |
| 137 | +func (m AwsAssetSource) GetTimeCreated() *common.SDKTime { |
| 138 | + return m.TimeCreated |
| 139 | +} |
| 140 | + |
| 141 | +// GetTimeUpdated returns TimeUpdated |
| 142 | +func (m AwsAssetSource) GetTimeUpdated() *common.SDKTime { |
| 143 | + return m.TimeUpdated |
| 144 | +} |
| 145 | + |
| 146 | +// GetFreeformTags returns FreeformTags |
| 147 | +func (m AwsAssetSource) GetFreeformTags() map[string]string { |
| 148 | + return m.FreeformTags |
| 149 | +} |
| 150 | + |
| 151 | +// GetDefinedTags returns DefinedTags |
| 152 | +func (m AwsAssetSource) GetDefinedTags() map[string]map[string]interface{} { |
| 153 | + return m.DefinedTags |
| 154 | +} |
| 155 | + |
| 156 | +// GetSystemTags returns SystemTags |
| 157 | +func (m AwsAssetSource) GetSystemTags() map[string]map[string]interface{} { |
| 158 | + return m.SystemTags |
| 159 | +} |
| 160 | + |
| 161 | +func (m AwsAssetSource) String() string { |
| 162 | + return common.PointerString(m) |
| 163 | +} |
| 164 | + |
| 165 | +// ValidateEnumValue returns an error when providing an unsupported enum value |
| 166 | +// This function is being called during constructing API request process |
| 167 | +// Not recommended for calling this function directly |
| 168 | +func (m AwsAssetSource) ValidateEnumValue() (bool, error) { |
| 169 | + errMessage := []string{} |
| 170 | + |
| 171 | + if _, ok := GetMappingAssetSourceLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { |
| 172 | + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetAssetSourceLifecycleStateEnumStringValues(), ","))) |
| 173 | + } |
| 174 | + if len(errMessage) > 0 { |
| 175 | + return true, fmt.Errorf(strings.Join(errMessage, "\n")) |
| 176 | + } |
| 177 | + return false, nil |
| 178 | +} |
| 179 | + |
| 180 | +// MarshalJSON marshals to json representation |
| 181 | +func (m AwsAssetSource) MarshalJSON() (buff []byte, e error) { |
| 182 | + type MarshalTypeAwsAssetSource AwsAssetSource |
| 183 | + s := struct { |
| 184 | + DiscriminatorParam string `json:"type"` |
| 185 | + MarshalTypeAwsAssetSource |
| 186 | + }{ |
| 187 | + "AWS", |
| 188 | + (MarshalTypeAwsAssetSource)(m), |
| 189 | + } |
| 190 | + |
| 191 | + return json.Marshal(&s) |
| 192 | +} |
0 commit comments