Class: OCI::ApmSynthetics::Models::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/apm_synthetics/models/node.rb

Overview

Details of the network node.

Constant Summary collapse

TYPE_ENUM =
[
  TYPE_SOURCE = 'SOURCE'.freeze,
  TYPE_DESTINATION = 'DESTINATION'.freeze,
  TYPE_ANONYMOUS = 'ANONYMOUS'.freeze,
  TYPE_INTERNAL = 'INTERNAL'.freeze,
  TYPE_DANGLING = 'DANGLING'.freeze,
  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 = {}) ⇒ Node

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :ip_address (String)

    The value to assign to the #ip_address property

  • :display_name (String)

    The value to assign to the #display_name property

  • :geo_info (String)

    The value to assign to the #geo_info property

  • :outgoing_links (Array<String>)

    The value to assign to the #outgoing_links property

  • :consecutive_anonymous_count (Integer)

    The value to assign to the #consecutive_anonymous_count property

  • :level (Integer)

    The value to assign to the #level property

  • :avg_packet_response_time_in_ms (Float)

    The value to assign to the #avg_packet_response_time_in_ms property

  • :avg_packet_loss_percent (Float)

    The value to assign to the #avg_packet_loss_percent property

  • :type (String)

    The value to assign to the #type property



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
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/oci/apm_synthetics/models/node.rb', line 113

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.id = attributes[:'id'] if attributes[:'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.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

  self.geo_info = attributes[:'geoInfo'] if attributes[:'geoInfo']

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

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

  self.outgoing_links = attributes[:'outgoingLinks'] if attributes[:'outgoingLinks']

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

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

  self.consecutive_anonymous_count = attributes[:'consecutiveAnonymousCount'] if attributes[:'consecutiveAnonymousCount']

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

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

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

  self.avg_packet_response_time_in_ms = attributes[:'avgPacketResponseTimeInMs'] if attributes[:'avgPacketResponseTimeInMs']

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

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

  self.avg_packet_loss_percent = attributes[:'avgPacketLossPercent'] if attributes[:'avgPacketLossPercent']

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

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

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

Instance Attribute Details

#avg_packet_loss_percentFloat

Percentage of the average packet loss.

Returns:

  • (Float)


55
56
57
# File 'lib/oci/apm_synthetics/models/node.rb', line 55

def avg_packet_loss_percent
  @avg_packet_loss_percent
end

#avg_packet_response_time_in_msFloat

Average packet response time in milliseconds.

Returns:

  • (Float)


51
52
53
# File 'lib/oci/apm_synthetics/models/node.rb', line 51

def avg_packet_response_time_in_ms
  @avg_packet_response_time_in_ms
end

#consecutive_anonymous_countInteger

Number of consecutive anonymous network nodes.

Returns:

  • (Integer)


43
44
45
# File 'lib/oci/apm_synthetics/models/node.rb', line 43

def consecutive_anonymous_count
  @consecutive_anonymous_count
end

#display_nameString

Display name of the network node.

Returns:

  • (String)


31
32
33
# File 'lib/oci/apm_synthetics/models/node.rb', line 31

def display_name
  @display_name
end

#geo_infoString

Geographical information of the network node.

Returns:

  • (String)


35
36
37
# File 'lib/oci/apm_synthetics/models/node.rb', line 35

def geo_info
  @geo_info
end

#idString

[Required] ID of the network node.

Returns:

  • (String)


23
24
25
# File 'lib/oci/apm_synthetics/models/node.rb', line 23

def id
  @id
end

#ip_addressString

IP address of the network node.

Returns:

  • (String)


27
28
29
# File 'lib/oci/apm_synthetics/models/node.rb', line 27

def ip_address
  @ip_address
end

#levelInteger

Level of the network node.

Returns:

  • (Integer)


47
48
49
# File 'lib/oci/apm_synthetics/models/node.rb', line 47

def level
  @level
end

Outgoing links from the network node.

Returns:

  • (Array<String>)


39
40
41
# File 'lib/oci/apm_synthetics/models/node.rb', line 39

def outgoing_links
  @outgoing_links
end

#typeString

Type of network node.

Returns:

  • (String)


59
60
61
# File 'lib/oci/apm_synthetics/models/node.rb', line 59

def type
  @type
end

Class Method Details

.attribute_mapObject

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



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/oci/apm_synthetics/models/node.rb', line 62

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'ip_address': :'ipAddress',
    'display_name': :'displayName',
    'geo_info': :'geoInfo',
    'outgoing_links': :'outgoingLinks',
    'consecutive_anonymous_count': :'consecutiveAnonymousCount',
    'level': :'level',
    'avg_packet_response_time_in_ms': :'avgPacketResponseTimeInMs',
    'avg_packet_loss_percent': :'avgPacketLossPercent',
    'type': :'type'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/oci/apm_synthetics/models/node.rb', line 80

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'ip_address': :'String',
    'display_name': :'String',
    'geo_info': :'String',
    'outgoing_links': :'Array<String>',
    'consecutive_anonymous_count': :'Integer',
    'level': :'Integer',
    'avg_packet_response_time_in_ms': :'Float',
    'avg_packet_loss_percent': :'Float',
    'type': :'String'
    # 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



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/oci/apm_synthetics/models/node.rb', line 188

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

  self.class == other.class &&
    id == other.id &&
    ip_address == other.ip_address &&
    display_name == other.display_name &&
    geo_info == other.geo_info &&
    outgoing_links == other.outgoing_links &&
    consecutive_anonymous_count == other.consecutive_anonymous_count &&
    level == other.level &&
    avg_packet_response_time_in_ms == other.avg_packet_response_time_in_ms &&
    avg_packet_loss_percent == other.avg_packet_loss_percent &&
    type == other.type
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



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/oci/apm_synthetics/models/node.rb', line 227

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


207
208
209
# File 'lib/oci/apm_synthetics/models/node.rb', line 207

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



216
217
218
# File 'lib/oci/apm_synthetics/models/node.rb', line 216

def hash
  [id, ip_address, display_name, geo_info, outgoing_links, consecutive_anonymous_count, level, avg_packet_response_time_in_ms, avg_packet_loss_percent, type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



260
261
262
263
264
265
266
267
268
269
# File 'lib/oci/apm_synthetics/models/node.rb', line 260

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



254
255
256
# File 'lib/oci/apm_synthetics/models/node.rb', line 254

def to_s
  to_hash.to_s
end