Class: OCI::Multicloud::Models::CloudServiceProviderMetadataItem
- Inherits:
-
Object
- Object
- OCI::Multicloud::Models::CloudServiceProviderMetadataItem
- Defined in:
- lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb
Overview
Cloud Service Provider metadata item. Warning - In future this object can change to generic object with future Cloud Service Provider based on CloudServiceProvider field. This can be one of CSP provider type Azure, GCP and AWS.
This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class
Direct Known Subclasses
AwsCloudServiceProviderMetadataItem, AzureCloudServiceProviderMetadataItem, GcpCloudServiceProviderMetadataItem
Constant Summary collapse
- SUBSCRIPTION_TYPE_ENUM =
[ SUBSCRIPTION_TYPE_ORACLEDBATAZURE = 'ORACLEDBATAZURE'.freeze, SUBSCRIPTION_TYPE_ORACLEDBATGOOGLE = 'ORACLEDBATGOOGLE'.freeze, SUBSCRIPTION_TYPE_ORACLEDBATAWS = 'ORACLEDBATAWS'.freeze, SUBSCRIPTION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#csp_additional_properties ⇒ Hash<String, String>
CSP Specific Additional Properties, AzureSubnetId for Azure.
-
#csp_resource_anchor_id ⇒ String
CSP resource anchor ID.
-
#csp_resource_anchor_name ⇒ String
CSP resource anchor name.
-
#region ⇒ String
The Azure, AWS or GCP region.
-
#resource_anchor_name ⇒ String
[Required] OCI resource anchor name.
-
#resource_anchor_uri ⇒ String
CSP resource anchor Uri.
-
#subscription_type ⇒ String
[Required] Oracle Cloud Infrastructure Subscription Type.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.get_subtype(object_hash) ⇒ Object
Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ CloudServiceProviderMetadataItem
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ CloudServiceProviderMetadataItem
Initializes the object
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 111 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.region = attributes[:'region'] if attributes[:'region'] self.resource_anchor_name = attributes[:'resourceAnchorName'] if attributes[:'resourceAnchorName'] raise 'You cannot provide both :resourceAnchorName and :resource_anchor_name' if attributes.key?(:'resourceAnchorName') && attributes.key?(:'resource_anchor_name') self.resource_anchor_name = attributes[:'resource_anchor_name'] if attributes[:'resource_anchor_name'] self.csp_resource_anchor_id = attributes[:'cspResourceAnchorId'] if attributes[:'cspResourceAnchorId'] raise 'You cannot provide both :cspResourceAnchorId and :csp_resource_anchor_id' if attributes.key?(:'cspResourceAnchorId') && attributes.key?(:'csp_resource_anchor_id') self.csp_resource_anchor_id = attributes[:'csp_resource_anchor_id'] if attributes[:'csp_resource_anchor_id'] self.csp_resource_anchor_name = attributes[:'cspResourceAnchorName'] if attributes[:'cspResourceAnchorName'] raise 'You cannot provide both :cspResourceAnchorName and :csp_resource_anchor_name' if attributes.key?(:'cspResourceAnchorName') && attributes.key?(:'csp_resource_anchor_name') self.csp_resource_anchor_name = attributes[:'csp_resource_anchor_name'] if attributes[:'csp_resource_anchor_name'] self.resource_anchor_uri = attributes[:'resourceAnchorUri'] if attributes[:'resourceAnchorUri'] raise 'You cannot provide both :resourceAnchorUri and :resource_anchor_uri' if attributes.key?(:'resourceAnchorUri') && attributes.key?(:'resource_anchor_uri') self.resource_anchor_uri = attributes[:'resource_anchor_uri'] if attributes[:'resource_anchor_uri'] self.csp_additional_properties = attributes[:'cspAdditionalProperties'] if attributes[:'cspAdditionalProperties'] raise 'You cannot provide both :cspAdditionalProperties and :csp_additional_properties' if attributes.key?(:'cspAdditionalProperties') && attributes.key?(:'csp_additional_properties') self.csp_additional_properties = attributes[:'csp_additional_properties'] if attributes[:'csp_additional_properties'] self.subscription_type = attributes[:'subscriptionType'] if attributes[:'subscriptionType'] raise 'You cannot provide both :subscriptionType and :subscription_type' if attributes.key?(:'subscriptionType') && attributes.key?(:'subscription_type') self.subscription_type = attributes[:'subscription_type'] if attributes[:'subscription_type'] end |
Instance Attribute Details
#csp_additional_properties ⇒ Hash<String, String>
CSP Specific Additional Properties, AzureSubnetId for Azure
45 46 47 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 45 def csp_additional_properties @csp_additional_properties end |
#csp_resource_anchor_id ⇒ String
CSP resource anchor ID.
33 34 35 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 33 def csp_resource_anchor_id @csp_resource_anchor_id end |
#csp_resource_anchor_name ⇒ String
CSP resource anchor name.
37 38 39 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 37 def csp_resource_anchor_name @csp_resource_anchor_name end |
#region ⇒ String
The Azure, AWS or GCP region.
25 26 27 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 25 def region @region end |
#resource_anchor_name ⇒ String
[Required] OCI resource anchor name.
29 30 31 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 29 def resource_anchor_name @resource_anchor_name end |
#resource_anchor_uri ⇒ String
CSP resource anchor Uri.
41 42 43 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 41 def resource_anchor_uri @resource_anchor_uri end |
#subscription_type ⇒ String
[Required] Oracle Cloud Infrastructure Subscription Type.
49 50 51 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 49 def subscription_type @subscription_type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 52 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'region': :'region', 'resource_anchor_name': :'resourceAnchorName', 'csp_resource_anchor_id': :'cspResourceAnchorId', 'csp_resource_anchor_name': :'cspResourceAnchorName', 'resource_anchor_uri': :'resourceAnchorUri', 'csp_additional_properties': :'cspAdditionalProperties', 'subscription_type': :'subscriptionType' # rubocop:enable Style/SymbolLiteral } end |
.get_subtype(object_hash) ⇒ Object
Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
86 87 88 89 90 91 92 93 94 95 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 86 def self.get_subtype(object_hash) type = object_hash[:'subscriptionType'] # rubocop:disable Style/SymbolLiteral return 'OCI::Multicloud::Models::AzureCloudServiceProviderMetadataItem' if type == 'ORACLEDBATAZURE' return 'OCI::Multicloud::Models::GcpCloudServiceProviderMetadataItem' if type == 'ORACLEDBATGOOGLE' return 'OCI::Multicloud::Models::AwsCloudServiceProviderMetadataItem' if type == 'ORACLEDBATAWS' # TODO: Log a warning when the subtype is not found. 'OCI::Multicloud::Models::CloudServiceProviderMetadataItem' end |
.swagger_types ⇒ Object
Attribute type mapping.
67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 67 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'region': :'String', 'resource_anchor_name': :'String', 'csp_resource_anchor_id': :'String', 'csp_resource_anchor_name': :'String', 'resource_anchor_uri': :'String', 'csp_additional_properties': :'Hash<String, String>', 'subscription_type': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 176 def ==(other) return true if equal?(other) self.class == other.class && region == other.region && resource_anchor_name == other.resource_anchor_name && csp_resource_anchor_id == other.csp_resource_anchor_id && csp_resource_anchor_name == other.csp_resource_anchor_name && resource_anchor_uri == other.resource_anchor_uri && csp_additional_properties == other.csp_additional_properties && subscription_type == other.subscription_type end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 212 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
192 193 194 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 192 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
201 202 203 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 201 def hash [region, resource_anchor_name, csp_resource_anchor_id, csp_resource_anchor_name, resource_anchor_uri, csp_additional_properties, subscription_type].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
245 246 247 248 249 250 251 252 253 254 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 245 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
239 240 241 |
# File 'lib/oci/multicloud/models/cloud_service_provider_metadata_item.rb', line 239 def to_s to_hash.to_s end |