Class: Verizon::ConnectionResponseV3
- Defined in:
- lib/verizon/models/connection_response_v3.rb
Overview
response for api/v3/clients/connection
Instance Attribute Summary collapse
-
#hosts ⇒ Array[String]
Array of hostnames corresponding to each MQTT URL.
-
#mqtt_ur_ls ⇒ Array[String]
Array of full MQTT URLs including protocol, host, and port for each available MEC.
-
#ports ⇒ Array[Integer]
Array of port numbers corresponding to each MQTT URL.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(mqtt_ur_ls = nil, hosts = SKIP, ports = SKIP) ⇒ ConnectionResponseV3
constructor
A new instance of ConnectionResponseV3.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(mqtt_ur_ls = nil, hosts = SKIP, ports = SKIP) ⇒ ConnectionResponseV3
Returns a new instance of ConnectionResponseV3.
47 48 49 50 51 |
# File 'lib/verizon/models/connection_response_v3.rb', line 47 def initialize(mqtt_ur_ls = nil, hosts = SKIP, ports = SKIP) @mqtt_ur_ls = mqtt_ur_ls @hosts = hosts unless hosts == SKIP @ports = ports unless ports == SKIP end |
Instance Attribute Details
#hosts ⇒ Array[String]
Array of hostnames corresponding to each MQTT URL.
19 20 21 |
# File 'lib/verizon/models/connection_response_v3.rb', line 19 def hosts @hosts end |
#mqtt_ur_ls ⇒ Array[String]
Array of full MQTT URLs including protocol, host, and port for each available MEC.
15 16 17 |
# File 'lib/verizon/models/connection_response_v3.rb', line 15 def mqtt_ur_ls @mqtt_ur_ls end |
#ports ⇒ Array[Integer]
Array of port numbers corresponding to each MQTT URL.
23 24 25 |
# File 'lib/verizon/models/connection_response_v3.rb', line 23 def ports @ports end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/verizon/models/connection_response_v3.rb', line 54 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. mqtt_ur_ls = hash.key?('MqttURLs') ? hash['MqttURLs'] : nil hosts = hash.key?('Hosts') ? hash['Hosts'] : SKIP ports = hash.key?('Ports') ? hash['Ports'] : SKIP # Create object from extracted values. ConnectionResponseV3.new(mqtt_ur_ls, hosts, ports) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 |
# File 'lib/verizon/models/connection_response_v3.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['mqtt_ur_ls'] = 'MqttURLs' @_hash['hosts'] = 'Hosts' @_hash['ports'] = 'Ports' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 |
# File 'lib/verizon/models/connection_response_v3.rb', line 43 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 40 |
# File 'lib/verizon/models/connection_response_v3.rb', line 35 def self.optionals %w[ hosts ports ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
75 76 77 78 79 |
# File 'lib/verizon/models/connection_response_v3.rb', line 75 def inspect class_name = self.class.name.split('::').last "<#{class_name} mqtt_ur_ls: #{@mqtt_ur_ls.inspect}, hosts: #{@hosts.inspect}, ports:"\ " #{@ports.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
69 70 71 72 |
# File 'lib/verizon/models/connection_response_v3.rb', line 69 def to_s class_name = self.class.name.split('::').last "<#{class_name} mqtt_ur_ls: #{@mqtt_ur_ls}, hosts: #{@hosts}, ports: #{@ports}>" end |