Class: MistApi::WebhookMinisApplicationEvent

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

Overview

WebhookMinisApplicationEvent 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(device_mac = SKIP, ip = SKIP, latency = SKIP, org_id = SKIP, probe_name = SKIP, probe_type = SKIP, site_id = SKIP, src_ip = SKIP, success = SKIP, test_type = SynthetictestConfigCustomProbeTypeEnum::ICMP, timestamp = SKIP, vlan = SKIP) ⇒ WebhookMinisApplicationEvent

Returns a new instance of WebhookMinisApplicationEvent.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/mist_api/models/webhook_minis_application_event.rb', line 101

def initialize(device_mac = SKIP, ip = SKIP, latency = SKIP, org_id = SKIP,
               probe_name = SKIP, probe_type = SKIP, site_id = SKIP,
               src_ip = SKIP, success = SKIP,
               test_type = SynthetictestConfigCustomProbeTypeEnum::ICMP,
               timestamp = SKIP, vlan = SKIP)
  @device_mac = device_mac unless device_mac == SKIP
  @ip = ip unless ip == SKIP
  @latency = latency unless latency == SKIP
  @org_id = org_id unless org_id == SKIP
  @probe_name = probe_name unless probe_name == SKIP
  @probe_type = probe_type unless probe_type == SKIP
  @site_id = site_id unless site_id == SKIP
  @src_ip = src_ip unless src_ip == SKIP
  @success = success unless success == SKIP
  @test_type = test_type unless test_type == SKIP
  @timestamp = timestamp unless timestamp == SKIP
  @vlan = vlan unless vlan == SKIP
end

Instance Attribute Details

#device_macString

MAC address of the device

Returns:

  • (String)


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

def device_mac
  @device_mac
end

#ipString

IP address test was performed to

Returns:

  • (String)


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

def ip
  @ip
end

#latencyInteger

latency in milliseconds

Returns:

  • (Integer)


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

def latency
  @latency
end

#org_idUUID | String

latency in milliseconds

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#probe_nameString

Name of the probe

Returns:

  • (String)


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

def probe_name
  @probe_name
end

#probe_typeString

Type of probe

Returns:

  • (String)


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

def probe_type
  @probe_type
end

#site_idUUID | String

Type of probe

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

#src_ipString

Source IP address of the test

Returns:

  • (String)


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

def src_ip
  @src_ip
end

#successTrueClass | FalseClass

Whether the test was successful

Returns:

  • (TrueClass | FalseClass)


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

def success
  @success
end

#test_typeSynthetictestConfigCustomProbeTypeEnum

enum: ‘application`, `curl`, `icmp`, `reachability`, `tcp`



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

def test_type
  @test_type
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


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

def timestamp
  @timestamp
end

#vlanInteger

VLAN ID used for the test

Returns:

  • (Integer)


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

def vlan
  @vlan
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/mist_api/models/webhook_minis_application_event.rb', line 121

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  device_mac = hash.key?('device_mac') ? hash['device_mac'] : SKIP
  ip = hash.key?('ip') ? hash['ip'] : SKIP
  latency = hash.key?('latency') ? hash['latency'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  probe_name = hash.key?('probe_name') ? hash['probe_name'] : SKIP
  probe_type = hash.key?('probe_type') ? hash['probe_type'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  src_ip = hash.key?('src_ip') ? hash['src_ip'] : SKIP
  success = hash.key?('success') ? hash['success'] : SKIP
  test_type =
    hash['test_type'] ||= SynthetictestConfigCustomProbeTypeEnum::ICMP
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
  vlan = hash.key?('vlan') ? hash['vlan'] : SKIP

  # Create object from extracted values.
  WebhookMinisApplicationEvent.new(device_mac,
                                   ip,
                                   latency,
                                   org_id,
                                   probe_name,
                                   probe_type,
                                   site_id,
                                   src_ip,
                                   success,
                                   test_type,
                                   timestamp,
                                   vlan)
end

.namesObject

A mapping from model property names to API property names.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/mist_api/models/webhook_minis_application_event.rb', line 61

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['device_mac'] = 'device_mac'
  @_hash['ip'] = 'ip'
  @_hash['latency'] = 'latency'
  @_hash['org_id'] = 'org_id'
  @_hash['probe_name'] = 'probe_name'
  @_hash['probe_type'] = 'probe_type'
  @_hash['site_id'] = 'site_id'
  @_hash['src_ip'] = 'src_ip'
  @_hash['success'] = 'success'
  @_hash['test_type'] = 'test_type'
  @_hash['timestamp'] = 'timestamp'
  @_hash['vlan'] = 'vlan'
  @_hash
end

.nullablesObject

An array for nullable fields



97
98
99
# File 'lib/mist_api/models/webhook_minis_application_event.rb', line 97

def self.nullables
  []
end

.optionalsObject

An array for optional fields



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/mist_api/models/webhook_minis_application_event.rb', line 79

def self.optionals
  %w[
    device_mac
    ip
    latency
    org_id
    probe_name
    probe_type
    site_id
    src_ip
    success
    test_type
    timestamp
    vlan
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



156
157
158
159
160
161
162
# File 'lib/mist_api/models/webhook_minis_application_event.rb', line 156

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.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} device_mac: #{@device_mac.inspect}, ip: #{@ip.inspect}, latency:"\
  " #{@latency.inspect}, org_id: #{@org_id.inspect}, probe_name: #{@probe_name.inspect},"\
  " probe_type: #{@probe_type.inspect}, site_id: #{@site_id.inspect}, src_ip:"\
  " #{@src_ip.inspect}, success: #{@success.inspect}, test_type: #{@test_type.inspect},"\
  " timestamp: #{@timestamp.inspect}, vlan: #{@vlan.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



165
166
167
168
169
170
171
# File 'lib/mist_api/models/webhook_minis_application_event.rb', line 165

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} device_mac: #{@device_mac}, ip: #{@ip}, latency: #{@latency}, org_id:"\
  " #{@org_id}, probe_name: #{@probe_name}, probe_type: #{@probe_type}, site_id: #{@site_id},"\
  " src_ip: #{@src_ip}, success: #{@success}, test_type: #{@test_type}, timestamp:"\
  " #{@timestamp}, vlan: #{@vlan}>"
end