Class: OCI::Core::Models::InventorySubnetSummary
- Inherits:
-
Object
- Object
- OCI::Core::Models::InventorySubnetSummary
- Defined in:
- lib/oci/core/models/inventory_subnet_summary.rb
Overview
Lists subnet and its associated resources.
Constant Summary collapse
- RESOURCE_TYPE_ENUM =
[ RESOURCE_TYPE_SUBNET = 'Subnet'.freeze, RESOURCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#compartment_id ⇒ String
The OCID of the compartment.
-
#dns_domain_name ⇒ String
DNS domain name of the subnet.
-
#inventory_resource_summary ⇒ Array<OCI::Core::Models::InventoryResourceSummary>
Lists the
ResourceCollection
object. -
#inventory_subnet_cidr_collection ⇒ Array<OCI::Core::Models::InventorySubnetCidrBlockSummary>
Lists CIDRs and utilization within the subnet.
-
#region ⇒ String
Region name of the subnet.
-
#resource_type ⇒ String
Resource types of the subnet.
-
#subnet_id ⇒ String
The OCID of the subnet.
-
#subnet_name ⇒ String
Name of the subnet within a VCN.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.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 = {}) ⇒ InventorySubnetSummary
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 = {}) ⇒ InventorySubnetSummary
Initializes the object
98 99 100 101 102 103 104 105 106 107 108 109 110 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 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 98 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.subnet_id = attributes[:'subnetId'] if attributes[:'subnetId'] raise 'You cannot provide both :subnetId and :subnet_id' if attributes.key?(:'subnetId') && attributes.key?(:'subnet_id') self.subnet_id = attributes[:'subnet_id'] if attributes[:'subnet_id'] self.subnet_name = attributes[:'subnetName'] if attributes[:'subnetName'] raise 'You cannot provide both :subnetName and :subnet_name' if attributes.key?(:'subnetName') && attributes.key?(:'subnet_name') self.subnet_name = attributes[:'subnet_name'] if attributes[:'subnet_name'] self.resource_type = attributes[:'resourceType'] if attributes[:'resourceType'] raise 'You cannot provide both :resourceType and :resource_type' if attributes.key?(:'resourceType') && attributes.key?(:'resource_type') self.resource_type = attributes[:'resource_type'] if attributes[:'resource_type'] self.inventory_subnet_cidr_collection = attributes[:'inventorySubnetCidrCollection'] if attributes[:'inventorySubnetCidrCollection'] raise 'You cannot provide both :inventorySubnetCidrCollection and :inventory_subnet_cidr_collection' if attributes.key?(:'inventorySubnetCidrCollection') && attributes.key?(:'inventory_subnet_cidr_collection') self.inventory_subnet_cidr_collection = attributes[:'inventory_subnet_cidr_collection'] if attributes[:'inventory_subnet_cidr_collection'] self.dns_domain_name = attributes[:'dnsDomainName'] if attributes[:'dnsDomainName'] raise 'You cannot provide both :dnsDomainName and :dns_domain_name' if attributes.key?(:'dnsDomainName') && attributes.key?(:'dns_domain_name') self.dns_domain_name = attributes[:'dns_domain_name'] if attributes[:'dns_domain_name'] self.region = attributes[:'region'] if attributes[:'region'] self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId'] raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id') self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id'] self.inventory_resource_summary = attributes[:'inventoryResourceSummary'] if attributes[:'inventoryResourceSummary'] raise 'You cannot provide both :inventoryResourceSummary and :inventory_resource_summary' if attributes.key?(:'inventoryResourceSummary') && attributes.key?(:'inventory_resource_summary') self.inventory_resource_summary = attributes[:'inventory_resource_summary'] if attributes[:'inventory_resource_summary'] end |
Instance Attribute Details
#compartment_id ⇒ String
The OCID of the compartment.
45 46 47 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 45 def compartment_id @compartment_id end |
#dns_domain_name ⇒ String
DNS domain name of the subnet.
37 38 39 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 37 def dns_domain_name @dns_domain_name end |
#inventory_resource_summary ⇒ Array<OCI::Core::Models::InventoryResourceSummary>
Lists the ResourceCollection
object.
50 51 52 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 50 def inventory_resource_summary @inventory_resource_summary end |
#inventory_subnet_cidr_collection ⇒ Array<OCI::Core::Models::InventorySubnetCidrBlockSummary>
Lists CIDRs and utilization within the subnet.
33 34 35 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 33 def inventory_subnet_cidr_collection @inventory_subnet_cidr_collection end |
#region ⇒ String
Region name of the subnet.
41 42 43 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 41 def region @region end |
#resource_type ⇒ String
Resource types of the subnet.
28 29 30 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 28 def resource_type @resource_type end |
#subnet_id ⇒ String
The OCID of the subnet.
20 21 22 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 20 def subnet_id @subnet_id end |
#subnet_name ⇒ String
Name of the subnet within a VCN.
24 25 26 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 24 def subnet_name @subnet_name end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 53 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'subnet_id': :'subnetId', 'subnet_name': :'subnetName', 'resource_type': :'resourceType', 'inventory_subnet_cidr_collection': :'inventorySubnetCidrCollection', 'dns_domain_name': :'dnsDomainName', 'region': :'region', 'compartment_id': :'compartmentId', 'inventory_resource_summary': :'inventoryResourceSummary' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 69 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'subnet_id': :'String', 'subnet_name': :'String', 'resource_type': :'String', 'inventory_subnet_cidr_collection': :'Array<OCI::Core::Models::InventorySubnetCidrBlockSummary>', 'dns_domain_name': :'String', 'region': :'String', 'compartment_id': :'String', 'inventory_resource_summary': :'Array<OCI::Core::Models::InventoryResourceSummary>' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
169 170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 169 def ==(other) return true if equal?(other) self.class == other.class && subnet_id == other.subnet_id && subnet_name == other.subnet_name && resource_type == other.resource_type && inventory_subnet_cidr_collection == other.inventory_subnet_cidr_collection && dns_domain_name == other.dns_domain_name && region == other.region && compartment_id == other.compartment_id && inventory_resource_summary == other.inventory_resource_summary end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 206 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
186 187 188 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 186 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
195 196 197 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 195 def hash [subnet_id, subnet_name, resource_type, inventory_subnet_cidr_collection, dns_domain_name, region, compartment_id, inventory_resource_summary].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
239 240 241 242 243 244 245 246 247 248 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 239 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
233 234 235 |
# File 'lib/oci/core/models/inventory_subnet_summary.rb', line 233 def to_s to_hash.to_s end |