Class: MistApi::WebhookMinisReachabilityEvent

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/webhook_minis_reachability_event.rb

Overview

WebhookMinisReachabilityEvent Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(avg_latency = SKIP, device_mac = SKIP, loss_percentage = SKIP, max_latency = SKIP, min_latency = SKIP, org_id = SKIP, probe_name = SKIP, probe_target = SKIP, probe_type = SKIP, protocol = SKIP, site_id = SKIP, test_type = SKIP, timestamp = SKIP, vlan = SKIP) ⇒ WebhookMinisReachabilityEvent

Returns a new instance of WebhookMinisReachabilityEvent.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 113

def initialize(avg_latency = SKIP, device_mac = SKIP,
               loss_percentage = SKIP, max_latency = SKIP,
               min_latency = SKIP, org_id = SKIP, probe_name = SKIP,
               probe_target = SKIP, probe_type = SKIP, protocol = SKIP,
               site_id = SKIP, test_type = SKIP, timestamp = SKIP,
               vlan = SKIP)
  @avg_latency = avg_latency unless avg_latency == SKIP
  @device_mac = device_mac unless device_mac == SKIP
  @loss_percentage = loss_percentage unless loss_percentage == SKIP
  @max_latency = max_latency unless max_latency == SKIP
  @min_latency = min_latency unless min_latency == SKIP
  @org_id = org_id unless org_id == SKIP
  @probe_name = probe_name unless probe_name == SKIP
  @probe_target = probe_target unless probe_target == SKIP
  @probe_type = probe_type unless probe_type == SKIP
  @protocol = protocol unless protocol == SKIP
  @site_id = site_id unless site_id == SKIP
  @test_type = test_type unless test_type == SKIP
  @timestamp = timestamp unless timestamp == SKIP
  @vlan = vlan unless vlan == SKIP
end

Instance Attribute Details

#avg_latencyFloat

Average latency in milliseconds

Returns:

  • (Float)


14
15
16
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 14

def avg_latency
  @avg_latency
end

#device_macString

MAC address of the device performing the test

Returns:

  • (String)


18
19
20
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 18

def device_mac
  @device_mac
end

#loss_percentageFloat

Packet loss percentage

Returns:

  • (Float)


22
23
24
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 22

def loss_percentage
  @loss_percentage
end

#max_latencyFloat

Maximum latency in milliseconds

Returns:

  • (Float)


26
27
28
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 26

def max_latency
  @max_latency
end

#min_latencyFloat

Minimum latency in milliseconds

Returns:

  • (Float)


30
31
32
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 30

def min_latency
  @min_latency
end

#org_idUUID | String

Minimum latency in milliseconds

Returns:

  • (UUID | String)


34
35
36
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 34

def org_id
  @org_id
end

#probe_nameString

Name of the probe

Returns:

  • (String)


38
39
40
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 38

def probe_name
  @probe_name
end

#probe_targetString

Target host or IP for the probe

Returns:

  • (String)


42
43
44
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 42

def probe_target
  @probe_target
end

#probe_typeString

Type of probe

Returns:

  • (String)


46
47
48
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 46

def probe_type
  @probe_type
end

#protocolString

Protocol used for the test

Returns:

  • (String)


50
51
52
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 50

def protocol
  @protocol
end

#site_idUUID | String

Protocol used for the test

Returns:

  • (UUID | String)


54
55
56
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 54

def site_id
  @site_id
end

#test_typeString

Type of test performed

Returns:

  • (String)


58
59
60
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 58

def test_type
  @test_type
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


62
63
64
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 62

def timestamp
  @timestamp
end

#vlanInteger

VLAN ID used for the test

Returns:

  • (Integer)


66
67
68
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 66

def vlan
  @vlan
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 136

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  avg_latency = hash.key?('avg_latency') ? hash['avg_latency'] : SKIP
  device_mac = hash.key?('device_mac') ? hash['device_mac'] : SKIP
  loss_percentage =
    hash.key?('loss_percentage') ? hash['loss_percentage'] : SKIP
  max_latency = hash.key?('max_latency') ? hash['max_latency'] : SKIP
  min_latency = hash.key?('min_latency') ? hash['min_latency'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  probe_name = hash.key?('probe_name') ? hash['probe_name'] : SKIP
  probe_target = hash.key?('probe_target') ? hash['probe_target'] : SKIP
  probe_type = hash.key?('probe_type') ? hash['probe_type'] : SKIP
  protocol = hash.key?('protocol') ? hash['protocol'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  test_type = hash.key?('test_type') ? hash['test_type'] : SKIP
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
  vlan = hash.key?('vlan') ? hash['vlan'] : SKIP

  # Create object from extracted values.
  WebhookMinisReachabilityEvent.new(avg_latency,
                                    device_mac,
                                    loss_percentage,
                                    max_latency,
                                    min_latency,
                                    org_id,
                                    probe_name,
                                    probe_target,
                                    probe_type,
                                    protocol,
                                    site_id,
                                    test_type,
                                    timestamp,
                                    vlan)
end

.namesObject

A mapping from model property names to API property names.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 69

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['avg_latency'] = 'avg_latency'
  @_hash['device_mac'] = 'device_mac'
  @_hash['loss_percentage'] = 'loss_percentage'
  @_hash['max_latency'] = 'max_latency'
  @_hash['min_latency'] = 'min_latency'
  @_hash['org_id'] = 'org_id'
  @_hash['probe_name'] = 'probe_name'
  @_hash['probe_target'] = 'probe_target'
  @_hash['probe_type'] = 'probe_type'
  @_hash['protocol'] = 'protocol'
  @_hash['site_id'] = 'site_id'
  @_hash['test_type'] = 'test_type'
  @_hash['timestamp'] = 'timestamp'
  @_hash['vlan'] = 'vlan'
  @_hash
end

.nullablesObject

An array for nullable fields



109
110
111
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 109

def self.nullables
  []
end

.optionalsObject

An array for optional fields



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 89

def self.optionals
  %w[
    avg_latency
    device_mac
    loss_percentage
    max_latency
    min_latency
    org_id
    probe_name
    probe_target
    probe_type
    protocol
    site_id
    test_type
    timestamp
    vlan
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



175
176
177
178
179
180
181
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 175

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



194
195
196
197
198
199
200
201
202
203
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 194

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} avg_latency: #{@avg_latency.inspect}, device_mac: #{@device_mac.inspect},"\
  " loss_percentage: #{@loss_percentage.inspect}, max_latency: #{@max_latency.inspect},"\
  " min_latency: #{@min_latency.inspect}, org_id: #{@org_id.inspect}, probe_name:"\
  " #{@probe_name.inspect}, probe_target: #{@probe_target.inspect}, probe_type:"\
  " #{@probe_type.inspect}, protocol: #{@protocol.inspect}, site_id: #{@site_id.inspect},"\
  " test_type: #{@test_type.inspect}, timestamp: #{@timestamp.inspect}, vlan:"\
  " #{@vlan.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



184
185
186
187
188
189
190
191
# File 'lib/mist_api/models/webhook_minis_reachability_event.rb', line 184

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} avg_latency: #{@avg_latency}, device_mac: #{@device_mac}, loss_percentage:"\
  " #{@loss_percentage}, max_latency: #{@max_latency}, min_latency: #{@min_latency}, org_id:"\
  " #{@org_id}, probe_name: #{@probe_name}, probe_target: #{@probe_target}, probe_type:"\
  " #{@probe_type}, protocol: #{@protocol}, site_id: #{@site_id}, test_type: #{@test_type},"\
  " timestamp: #{@timestamp}, vlan: #{@vlan}>"
end