Class: MistApi::UtilsServicePing
- Defined in:
- lib/mist_api/models/utils_service_ping.rb
Overview
UtilsServicePing Model.
Instance Attribute Summary collapse
-
#count ⇒ Integer
TODO: Write general description for this method.
-
#host ⇒ String
TODO: Write general description for this method.
-
#node ⇒ HaClusterNodeEnum
only for HA.
-
#service ⇒ String
Ping packet takes the same path as the service.
-
#size ⇒ Integer
Ping packet takes the same path as the service.
-
#tenant ⇒ String
Tenant context in which the packet is sent.
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(host = nil, service = nil, count = 10, node = SKIP, size = 56, tenant = SKIP, additional_properties = nil) ⇒ UtilsServicePing
constructor
A new instance of UtilsServicePing.
-
#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(host = nil, service = nil, count = 10, node = SKIP, size = 56, tenant = SKIP, additional_properties = nil) ⇒ UtilsServicePing
Returns a new instance of UtilsServicePing.
63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/mist_api/models/utils_service_ping.rb', line 63 def initialize(host = nil, service = nil, count = 10, node = SKIP, size = 56, tenant = SKIP, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @count = count unless count == SKIP @host = host @node = node unless node == SKIP @service = service @size = size unless size == SKIP @tenant = tenant unless tenant == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#count ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/utils_service_ping.rb', line 14 def count @count end |
#host ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/utils_service_ping.rb', line 18 def host @host end |
#node ⇒ HaClusterNodeEnum
only for HA. enum: ‘node0`, `node1`
22 23 24 |
# File 'lib/mist_api/models/utils_service_ping.rb', line 22 def node @node end |
#service ⇒ String
Ping packet takes the same path as the service
26 27 28 |
# File 'lib/mist_api/models/utils_service_ping.rb', line 26 def service @service end |
#size ⇒ Integer
Ping packet takes the same path as the service
30 31 32 |
# File 'lib/mist_api/models/utils_service_ping.rb', line 30 def size @size end |
#tenant ⇒ String
Tenant context in which the packet is sent
34 35 36 |
# File 'lib/mist_api/models/utils_service_ping.rb', line 34 def tenant @tenant end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
78 79 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 |
# File 'lib/mist_api/models/utils_service_ping.rb', line 78 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. host = hash.key?('host') ? hash['host'] : nil service = hash.key?('service') ? hash['service'] : nil count = hash['count'] ||= 10 node = hash.key?('node') ? hash['node'] : SKIP size = hash['size'] ||= 56 tenant = hash.key?('tenant') ? hash['tenant'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. UtilsServicePing.new(host, service, count, node, size, tenant, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/mist_api/models/utils_service_ping.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['count'] = 'count' @_hash['host'] = 'host' @_hash['node'] = 'node' @_hash['service'] = 'service' @_hash['size'] = 'size' @_hash['tenant'] = 'tenant' @_hash end |
.nullables ⇒ Object
An array for nullable fields
59 60 61 |
# File 'lib/mist_api/models/utils_service_ping.rb', line 59 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 |
# File 'lib/mist_api/models/utils_service_ping.rb', line 49 def self.optionals %w[ count node size tenant ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
114 115 116 117 118 119 |
# File 'lib/mist_api/models/utils_service_ping.rb', line 114 def inspect class_name = self.class.name.split('::').last "<#{class_name} count: #{@count.inspect}, host: #{@host.inspect}, node: #{@node.inspect},"\ " service: #{@service.inspect}, size: #{@size.inspect}, tenant: #{@tenant.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
107 108 109 110 111 |
# File 'lib/mist_api/models/utils_service_ping.rb', line 107 def to_s class_name = self.class.name.split('::').last "<#{class_name} count: #{@count}, host: #{@host}, node: #{@node}, service: #{@service},"\ " size: #{@size}, tenant: #{@tenant}, additional_properties: #{@additional_properties}>" end |