Class: OCI::ApmSynthetics::Models::Link

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

Overview

Details of the link between two nodes.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Link

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

  • :source (String)

    The value to assign to the #source property

  • :destination (String)

    The value to assign to the #destination property

  • :repeat_count (Integer)

    The value to assign to the #repeat_count property

  • :forwarding_loss (Float)

    The value to assign to the #forwarding_loss property

  • :delay_in_milliseconds (Float)

    The value to assign to the #delay_in_milliseconds property

  • :min_delay_in_milliseconds (Float)

    The value to assign to the #min_delay_in_milliseconds property

  • :max_delay_in_milliseconds (Float)

    The value to assign to the #max_delay_in_milliseconds property

  • :paths (Array<String>)

    The value to assign to the #paths property



97
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
# File 'lib/oci/apm_synthetics/models/link.rb', line 97

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

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

  self.repeat_count = attributes[:'repeatCount'] if attributes[:'repeatCount']

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

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

  self.forwarding_loss = attributes[:'forwardingLoss'] if attributes[:'forwardingLoss']

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

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

  self.delay_in_milliseconds = attributes[:'delayInMilliseconds'] if attributes[:'delayInMilliseconds']

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

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

  self.min_delay_in_milliseconds = attributes[:'minDelayInMilliseconds'] if attributes[:'minDelayInMilliseconds']

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

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

  self.max_delay_in_milliseconds = attributes[:'maxDelayInMilliseconds'] if attributes[:'maxDelayInMilliseconds']

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

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

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

Instance Attribute Details

#delay_in_millisecondsFloat

Difference of the packet response time between source and destination nodes, in milliseconds.

Returns:

  • (Float)


34
35
36
# File 'lib/oci/apm_synthetics/models/link.rb', line 34

def delay_in_milliseconds
  @delay_in_milliseconds
end

#destinationString

ID of the destination node.

Returns:

  • (String)


22
23
24
# File 'lib/oci/apm_synthetics/models/link.rb', line 22

def destination
  @destination
end

#forwarding_lossFloat

Average packet loss.

Returns:

  • (Float)


30
31
32
# File 'lib/oci/apm_synthetics/models/link.rb', line 30

def forwarding_loss
  @forwarding_loss
end

#idString

[Required] ID of the link.

Returns:

  • (String)


14
15
16
# File 'lib/oci/apm_synthetics/models/link.rb', line 14

def id
  @id
end

#max_delay_in_millisecondsFloat

Maximum delay in milliseconds.

Returns:

  • (Float)


42
43
44
# File 'lib/oci/apm_synthetics/models/link.rb', line 42

def max_delay_in_milliseconds
  @max_delay_in_milliseconds
end

#min_delay_in_millisecondsFloat

Minimum delay in milliseconds.

Returns:

  • (Float)


38
39
40
# File 'lib/oci/apm_synthetics/models/link.rb', line 38

def min_delay_in_milliseconds
  @min_delay_in_milliseconds
end

#pathsArray<String>

List of all path IDs of which this link is part of.

Returns:

  • (Array<String>)


46
47
48
# File 'lib/oci/apm_synthetics/models/link.rb', line 46

def paths
  @paths
end

#repeat_countInteger

Number of times the link is repeated.

Returns:

  • (Integer)


26
27
28
# File 'lib/oci/apm_synthetics/models/link.rb', line 26

def repeat_count
  @repeat_count
end

#sourceString

ID of the source node.

Returns:

  • (String)


18
19
20
# File 'lib/oci/apm_synthetics/models/link.rb', line 18

def source
  @source
end

Class Method Details

.attribute_mapObject

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



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/oci/apm_synthetics/models/link.rb', line 49

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'source': :'source',
    'destination': :'destination',
    'repeat_count': :'repeatCount',
    'forwarding_loss': :'forwardingLoss',
    'delay_in_milliseconds': :'delayInMilliseconds',
    'min_delay_in_milliseconds': :'minDelayInMilliseconds',
    'max_delay_in_milliseconds': :'maxDelayInMilliseconds',
    'paths': :'paths'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/oci/apm_synthetics/models/link.rb', line 66

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'source': :'String',
    'destination': :'String',
    'repeat_count': :'Integer',
    'forwarding_loss': :'Float',
    'delay_in_milliseconds': :'Float',
    'min_delay_in_milliseconds': :'Float',
    'max_delay_in_milliseconds': :'Float',
    'paths': :'Array<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



149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/oci/apm_synthetics/models/link.rb', line 149

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

  self.class == other.class &&
    id == other.id &&
    source == other.source &&
    destination == other.destination &&
    repeat_count == other.repeat_count &&
    forwarding_loss == other.forwarding_loss &&
    delay_in_milliseconds == other.delay_in_milliseconds &&
    min_delay_in_milliseconds == other.min_delay_in_milliseconds &&
    max_delay_in_milliseconds == other.max_delay_in_milliseconds &&
    paths == other.paths
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



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/oci/apm_synthetics/models/link.rb', line 187

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


167
168
169
# File 'lib/oci/apm_synthetics/models/link.rb', line 167

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



176
177
178
# File 'lib/oci/apm_synthetics/models/link.rb', line 176

def hash
  [id, source, destination, repeat_count, forwarding_loss, delay_in_milliseconds, min_delay_in_milliseconds, max_delay_in_milliseconds, paths].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



220
221
222
223
224
225
226
227
228
229
# File 'lib/oci/apm_synthetics/models/link.rb', line 220

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



214
215
216
# File 'lib/oci/apm_synthetics/models/link.rb', line 214

def to_s
  to_hash.to_s
end