Class: OCI::Core::Models::IpInventorySubnetResourceSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/core/models/ip_inventory_subnet_resource_summary.rb

Overview

Provides the IP Inventory details of a subnet and its associated resources.

Constant Summary collapse

IP_ADDRESS_LIFETIME_ENUM =
[
  IP_ADDRESS_LIFETIME_EPHEMERAL = 'Ephemeral'.freeze,
  IP_ADDRESS_LIFETIME_RESERVED = 'Reserved'.freeze,
  IP_ADDRESS_LIFETIME_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
PUBLIC_IP_LIFETIME_ENUM =
[
  PUBLIC_IP_LIFETIME_EPHEMERAL = 'Ephemeral'.freeze,
  PUBLIC_IP_LIFETIME_RESERVED = 'Reserved'.freeze,
  PUBLIC_IP_LIFETIME_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ASSOCIATED_PUBLIC_IP_POOL_ENUM =
[
  ASSOCIATED_PUBLIC_IP_POOL_ORACLE = 'ORACLE'.freeze,
  ASSOCIATED_PUBLIC_IP_POOL_BYOIP = 'BYOIP'.freeze,
  ASSOCIATED_PUBLIC_IP_POOL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ASSIGNED_RESOURCE_TYPE_ENUM =
[
  ASSIGNED_RESOURCE_TYPE_RESOURCE = 'Resource'.freeze,
  ASSIGNED_RESOURCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ IpInventorySubnetResourceSummary

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :ip_id (String)

    The value to assign to the #ip_id property

  • :ip_address (String)

    The value to assign to the #ip_address property

  • :ip_address_lifetime (String)

    The value to assign to the #ip_address_lifetime property

  • :parent_cidr (String)

    The value to assign to the #parent_cidr property

  • :associated_public_ip (String)

    The value to assign to the #associated_public_ip property

  • :public_ip_lifetime (String)

    The value to assign to the #public_ip_lifetime property

  • :associated_public_ip_pool (String)

    The value to assign to the #associated_public_ip_pool property

  • :dns_host_name (String)

    The value to assign to the #dns_host_name property

  • :assigned_resource_name (String)

    The value to assign to the #assigned_resource_name property

  • :assigned_resource_type (String)

    The value to assign to the #assigned_resource_type property

  • :address_type (String)

    The value to assign to the #address_type property

  • :assigned_time (DateTime)

    The value to assign to the #assigned_time property



142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 142

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.ip_id = attributes[:'ipId'] if attributes[:'ipId']

  raise 'You cannot provide both :ipId and :ip_id' if attributes.key?(:'ipId') && attributes.key?(:'ip_id')

  self.ip_id = attributes[:'ip_id'] if attributes[:'ip_id']

  self.ip_address = attributes[:'ipAddress'] if attributes[:'ipAddress']

  raise 'You cannot provide both :ipAddress and :ip_address' if attributes.key?(:'ipAddress') && attributes.key?(:'ip_address')

  self.ip_address = attributes[:'ip_address'] if attributes[:'ip_address']

  self.ip_address_lifetime = attributes[:'ipAddressLifetime'] if attributes[:'ipAddressLifetime']

  raise 'You cannot provide both :ipAddressLifetime and :ip_address_lifetime' if attributes.key?(:'ipAddressLifetime') && attributes.key?(:'ip_address_lifetime')

  self.ip_address_lifetime = attributes[:'ip_address_lifetime'] if attributes[:'ip_address_lifetime']

  self.parent_cidr = attributes[:'parentCidr'] if attributes[:'parentCidr']

  raise 'You cannot provide both :parentCidr and :parent_cidr' if attributes.key?(:'parentCidr') && attributes.key?(:'parent_cidr')

  self.parent_cidr = attributes[:'parent_cidr'] if attributes[:'parent_cidr']

  self.associated_public_ip = attributes[:'associatedPublicIp'] if attributes[:'associatedPublicIp']

  raise 'You cannot provide both :associatedPublicIp and :associated_public_ip' if attributes.key?(:'associatedPublicIp') && attributes.key?(:'associated_public_ip')

  self.associated_public_ip = attributes[:'associated_public_ip'] if attributes[:'associated_public_ip']

  self.public_ip_lifetime = attributes[:'publicIpLifetime'] if attributes[:'publicIpLifetime']

  raise 'You cannot provide both :publicIpLifetime and :public_ip_lifetime' if attributes.key?(:'publicIpLifetime') && attributes.key?(:'public_ip_lifetime')

  self.public_ip_lifetime = attributes[:'public_ip_lifetime'] if attributes[:'public_ip_lifetime']

  self.associated_public_ip_pool = attributes[:'associatedPublicIpPool'] if attributes[:'associatedPublicIpPool']

  raise 'You cannot provide both :associatedPublicIpPool and :associated_public_ip_pool' if attributes.key?(:'associatedPublicIpPool') && attributes.key?(:'associated_public_ip_pool')

  self.associated_public_ip_pool = attributes[:'associated_public_ip_pool'] if attributes[:'associated_public_ip_pool']

  self.dns_host_name = attributes[:'dnsHostName'] if attributes[:'dnsHostName']

  raise 'You cannot provide both :dnsHostName and :dns_host_name' if attributes.key?(:'dnsHostName') && attributes.key?(:'dns_host_name')

  self.dns_host_name = attributes[:'dns_host_name'] if attributes[:'dns_host_name']

  self.assigned_resource_name = attributes[:'assignedResourceName'] if attributes[:'assignedResourceName']

  raise 'You cannot provide both :assignedResourceName and :assigned_resource_name' if attributes.key?(:'assignedResourceName') && attributes.key?(:'assigned_resource_name')

  self.assigned_resource_name = attributes[:'assigned_resource_name'] if attributes[:'assigned_resource_name']

  self.assigned_resource_type = attributes[:'assignedResourceType'] if attributes[:'assignedResourceType']

  raise 'You cannot provide both :assignedResourceType and :assigned_resource_type' if attributes.key?(:'assignedResourceType') && attributes.key?(:'assigned_resource_type')

  self.assigned_resource_type = attributes[:'assigned_resource_type'] if attributes[:'assigned_resource_type']

  self.address_type = attributes[:'addressType'] if attributes[:'addressType']

  raise 'You cannot provide both :addressType and :address_type' if attributes.key?(:'addressType') && attributes.key?(:'address_type')

  self.address_type = attributes[:'address_type'] if attributes[:'address_type']

  self.assigned_time = attributes[:'assignedTime'] if attributes[:'assignedTime']

  raise 'You cannot provide both :assignedTime and :assigned_time' if attributes.key?(:'assignedTime') && attributes.key?(:'assigned_time')

  self.assigned_time = attributes[:'assigned_time'] if attributes[:'assigned_time']
end

Instance Attribute Details

#address_typeString

Address type of the allocated private IP address.

Returns:

  • (String)


78
79
80
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 78

def address_type
  @address_type
end

#assigned_resource_nameString

Name of the created resource.

Returns:

  • (String)


70
71
72
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 70

def assigned_resource_name
  @assigned_resource_name
end

#assigned_resource_typeString

Type of the resource.

Returns:

  • (String)


74
75
76
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 74

def assigned_resource_type
  @assigned_resource_type
end

#assigned_timeDateTime

Assigned time of the private IP address.

Returns:

  • (DateTime)


82
83
84
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 82

def assigned_time
  @assigned_time
end

#associated_public_ipString

Associated public IP address for the private IP address.

Returns:

  • (String)


54
55
56
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 54

def associated_public_ip
  @associated_public_ip
end

#associated_public_ip_poolString

Public IP address Pool the IP address is allocated from.

Returns:

  • (String)


62
63
64
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 62

def associated_public_ip_pool
  @associated_public_ip_pool
end

#dns_host_nameString

DNS hostname of the IP address.

Returns:

  • (String)


66
67
68
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 66

def dns_host_name
  @dns_host_name
end

#ip_addressString

Lists the allocated private IP address.

Returns:

  • (String)


42
43
44
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 42

def ip_address
  @ip_address
end

#ip_address_lifetimeString

Lifetime of the allocated private IP address.

Returns:

  • (String)


46
47
48
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 46

def ip_address_lifetime
  @ip_address_lifetime
end

#ip_idString

The OCID of the IP address.

Returns:

  • (String)


38
39
40
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 38

def ip_id
  @ip_id
end

#parent_cidrString

The address range the IP address is assigned from.

Returns:

  • (String)


50
51
52
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 50

def parent_cidr
  @parent_cidr
end

#public_ip_lifetimeString

Lifetime of the assigned public IP address.

Returns:

  • (String)


58
59
60
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 58

def public_ip_lifetime
  @public_ip_lifetime
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 85

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'ip_id': :'ipId',
    'ip_address': :'ipAddress',
    'ip_address_lifetime': :'ipAddressLifetime',
    'parent_cidr': :'parentCidr',
    'associated_public_ip': :'associatedPublicIp',
    'public_ip_lifetime': :'publicIpLifetime',
    'associated_public_ip_pool': :'associatedPublicIpPool',
    'dns_host_name': :'dnsHostName',
    'assigned_resource_name': :'assignedResourceName',
    'assigned_resource_type': :'assignedResourceType',
    'address_type': :'addressType',
    'assigned_time': :'assignedTime'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 105

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'ip_id': :'String',
    'ip_address': :'String',
    'ip_address_lifetime': :'String',
    'parent_cidr': :'String',
    'associated_public_ip': :'String',
    'public_ip_lifetime': :'String',
    'associated_public_ip_pool': :'String',
    'dns_host_name': :'String',
    'assigned_resource_name': :'String',
    'assigned_resource_type': :'String',
    'address_type': :'String',
    'assigned_time': :'DateTime'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 280

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    ip_id == other.ip_id &&
    ip_address == other.ip_address &&
    ip_address_lifetime == other.ip_address_lifetime &&
    parent_cidr == other.parent_cidr &&
    associated_public_ip == other.associated_public_ip &&
    public_ip_lifetime == other.public_ip_lifetime &&
    associated_public_ip_pool == other.associated_public_ip_pool &&
    dns_host_name == other.dns_host_name &&
    assigned_resource_name == other.assigned_resource_name &&
    assigned_resource_type == other.assigned_resource_type &&
    address_type == other.address_type &&
    assigned_time == other.assigned_time
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 321

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


301
302
303
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 301

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



310
311
312
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 310

def hash
  [ip_id, ip_address, ip_address_lifetime, parent_cidr, associated_public_ip, public_ip_lifetime, associated_public_ip_pool, dns_host_name, assigned_resource_name, assigned_resource_type, address_type, assigned_time].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



354
355
356
357
358
359
360
361
362
363
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 354

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



348
349
350
# File 'lib/oci/core/models/ip_inventory_subnet_resource_summary.rb', line 348

def to_s
  to_hash.to_s
end