Class: OCI::ApmSynthetics::Models::Link
- Inherits:
-
Object
- Object
- OCI::ApmSynthetics::Models::Link
- Defined in:
- lib/oci/apm_synthetics/models/link.rb
Overview
Details of the link between two nodes.
Instance Attribute Summary collapse
-
#delay_in_milliseconds ⇒ Float
Difference of the packet response time between source and destination nodes, in milliseconds.
-
#destination ⇒ String
ID of the destination node.
-
#forwarding_loss ⇒ Float
Average packet loss.
-
#id ⇒ String
[Required] ID of the link.
-
#max_delay_in_milliseconds ⇒ Float
Maximum delay in milliseconds.
-
#min_delay_in_milliseconds ⇒ Float
Minimum delay in milliseconds.
-
#paths ⇒ Array<String>
List of all path IDs of which this link is part of.
-
#repeat_count ⇒ Integer
Number of times the link is repeated.
-
#source ⇒ String
ID of the source node.
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 = {}) ⇒ Link
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 = {}) ⇒ Link
Initializes the object
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_milliseconds ⇒ Float
Difference of the packet response time between source and destination nodes, in milliseconds.
34 35 36 |
# File 'lib/oci/apm_synthetics/models/link.rb', line 34 def delay_in_milliseconds @delay_in_milliseconds end |
#destination ⇒ String
ID of the destination node.
22 23 24 |
# File 'lib/oci/apm_synthetics/models/link.rb', line 22 def destination @destination end |
#forwarding_loss ⇒ Float
Average packet loss.
30 31 32 |
# File 'lib/oci/apm_synthetics/models/link.rb', line 30 def forwarding_loss @forwarding_loss end |
#id ⇒ String
[Required] ID of the link.
14 15 16 |
# File 'lib/oci/apm_synthetics/models/link.rb', line 14 def id @id end |
#max_delay_in_milliseconds ⇒ Float
Maximum delay in milliseconds.
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_milliseconds ⇒ Float
Minimum delay in milliseconds.
38 39 40 |
# File 'lib/oci/apm_synthetics/models/link.rb', line 38 def min_delay_in_milliseconds @min_delay_in_milliseconds end |
#paths ⇒ Array<String>
List of all path IDs of which this link is part of.
46 47 48 |
# File 'lib/oci/apm_synthetics/models/link.rb', line 46 def paths @paths end |
#repeat_count ⇒ Integer
Number of times the link is repeated.
26 27 28 |
# File 'lib/oci/apm_synthetics/models/link.rb', line 26 def repeat_count @repeat_count end |
#source ⇒ String
ID of the source node.
18 19 20 |
# File 'lib/oci/apm_synthetics/models/link.rb', line 18 def source @source end |
Class Method Details
.attribute_map ⇒ Object
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_types ⇒ Object
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.
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
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
167 168 169 |
# File 'lib/oci/apm_synthetics/models/link.rb', line 167 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
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_hash ⇒ 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_s ⇒ String
Returns the string representation of the object
214 215 216 |
# File 'lib/oci/apm_synthetics/models/link.rb', line 214 def to_s to_hash.to_s end |