Class: OCI::ApmSynthetics::Models::NetworkConfiguration
- Inherits:
-
Object
- Object
- OCI::ApmSynthetics::Models::NetworkConfiguration
- Defined in:
- lib/oci/apm_synthetics/models/network_configuration.rb
Overview
Details of the network configuration.
Constant Summary collapse
- PROTOCOL_ENUM =
[ PROTOCOL_ICMP = 'ICMP'.freeze, PROTOCOL_TCP = 'TCP'.freeze, PROTOCOL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- PROBE_MODE_ENUM =
[ PROBE_MODE_SACK = 'SACK'.freeze, PROBE_MODE_SYN = 'SYN'.freeze, PROBE_MODE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#number_of_hops ⇒ Integer
Number of hops.
-
#probe_mode ⇒ String
Type of probe mode when TCP protocol is selected.
-
#probe_per_hop ⇒ Integer
Number of probes per hop.
-
#protocol ⇒ String
Type of protocol.
-
#transmission_rate ⇒ Integer
Number of probe packets sent out simultaneously.
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 = {}) ⇒ NetworkConfiguration
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 = {}) ⇒ NetworkConfiguration
Initializes the object
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/oci/apm_synthetics/models/network_configuration.rb', line 80 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.number_of_hops = attributes[:'numberOfHops'] if attributes[:'numberOfHops'] raise 'You cannot provide both :numberOfHops and :number_of_hops' if attributes.key?(:'numberOfHops') && attributes.key?(:'number_of_hops') self.number_of_hops = attributes[:'number_of_hops'] if attributes[:'number_of_hops'] self.probe_per_hop = attributes[:'probePerHop'] if attributes[:'probePerHop'] raise 'You cannot provide both :probePerHop and :probe_per_hop' if attributes.key?(:'probePerHop') && attributes.key?(:'probe_per_hop') self.probe_per_hop = attributes[:'probe_per_hop'] if attributes[:'probe_per_hop'] self.transmission_rate = attributes[:'transmissionRate'] if attributes[:'transmissionRate'] raise 'You cannot provide both :transmissionRate and :transmission_rate' if attributes.key?(:'transmissionRate') && attributes.key?(:'transmission_rate') self.transmission_rate = attributes[:'transmission_rate'] if attributes[:'transmission_rate'] self.protocol = attributes[:'protocol'] if attributes[:'protocol'] self.protocol = "TCP" if protocol.nil? && !attributes.key?(:'protocol') # rubocop:disable Style/StringLiterals self.probe_mode = attributes[:'probeMode'] if attributes[:'probeMode'] raise 'You cannot provide both :probeMode and :probe_mode' if attributes.key?(:'probeMode') && attributes.key?(:'probe_mode') self.probe_mode = attributes[:'probe_mode'] if attributes[:'probe_mode'] end |
Instance Attribute Details
#number_of_hops ⇒ Integer
Number of hops.
25 26 27 |
# File 'lib/oci/apm_synthetics/models/network_configuration.rb', line 25 def number_of_hops @number_of_hops end |
#probe_mode ⇒ String
Type of probe mode when TCP protocol is selected.
41 42 43 |
# File 'lib/oci/apm_synthetics/models/network_configuration.rb', line 41 def probe_mode @probe_mode end |
#probe_per_hop ⇒ Integer
Number of probes per hop.
29 30 31 |
# File 'lib/oci/apm_synthetics/models/network_configuration.rb', line 29 def probe_per_hop @probe_per_hop end |
#protocol ⇒ String
Type of protocol.
37 38 39 |
# File 'lib/oci/apm_synthetics/models/network_configuration.rb', line 37 def protocol @protocol end |
#transmission_rate ⇒ Integer
Number of probe packets sent out simultaneously.
33 34 35 |
# File 'lib/oci/apm_synthetics/models/network_configuration.rb', line 33 def transmission_rate @transmission_rate end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/oci/apm_synthetics/models/network_configuration.rb', line 44 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'number_of_hops': :'numberOfHops', 'probe_per_hop': :'probePerHop', 'transmission_rate': :'transmissionRate', 'protocol': :'protocol', 'probe_mode': :'probeMode' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/oci/apm_synthetics/models/network_configuration.rb', line 57 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'number_of_hops': :'Integer', 'probe_per_hop': :'Integer', 'transmission_rate': :'Integer', 'protocol': :'String', 'probe_mode': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
147 148 149 150 151 152 153 154 155 156 |
# File 'lib/oci/apm_synthetics/models/network_configuration.rb', line 147 def ==(other) return true if equal?(other) self.class == other.class && number_of_hops == other.number_of_hops && probe_per_hop == other.probe_per_hop && transmission_rate == other.transmission_rate && protocol == other.protocol && probe_mode == other.probe_mode end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/oci/apm_synthetics/models/network_configuration.rb', line 181 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
161 162 163 |
# File 'lib/oci/apm_synthetics/models/network_configuration.rb', line 161 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
170 171 172 |
# File 'lib/oci/apm_synthetics/models/network_configuration.rb', line 170 def hash [number_of_hops, probe_per_hop, transmission_rate, protocol, probe_mode].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
214 215 216 217 218 219 220 221 222 223 |
# File 'lib/oci/apm_synthetics/models/network_configuration.rb', line 214 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
208 209 210 |
# File 'lib/oci/apm_synthetics/models/network_configuration.rb', line 208 def to_s to_hash.to_s end |