Class: MistApi::WebhookClientInfoEvent

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

Overview

WebhookClientInfoEvent 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(hostname = SKIP, ip = SKIP, mac = SKIP, org_id = SKIP, site_id = SKIP, timestamp = SKIP) ⇒ WebhookClientInfoEvent

Returns a new instance of WebhookClientInfoEvent.



65
66
67
68
69
70
71
72
73
# File 'lib/mist_api/models/webhook_client_info_event.rb', line 65

def initialize(hostname = SKIP, ip = SKIP, mac = SKIP, org_id = SKIP,
               site_id = SKIP, timestamp = SKIP)
  @hostname = hostname unless hostname == SKIP
  @ip = ip unless ip == SKIP
  @mac = mac unless mac == SKIP
  @org_id = org_id unless org_id == SKIP
  @site_id = site_id unless site_id == SKIP
  @timestamp = timestamp unless timestamp == SKIP
end

Instance Attribute Details

#hostnameString

Hostname of client

Returns:

  • (String)


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

def hostname
  @hostname
end

#ipString

IP address of client

Returns:

  • (String)


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

def ip
  @ip
end

#macString

client’s MAC Address

Returns:

  • (String)


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

def mac
  @mac
end

#org_idUUID | String

client’s MAC Address

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#site_idUUID | String

client’s MAC Address

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


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

def timestamp
  @timestamp
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  hostname = hash.key?('hostname') ? hash['hostname'] : SKIP
  ip = hash.key?('ip') ? hash['ip'] : SKIP
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP

  # Create object from extracted values.
  WebhookClientInfoEvent.new(hostname,
                             ip,
                             mac,
                             org_id,
                             site_id,
                             timestamp)
end

.namesObject

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/webhook_client_info_event.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['hostname'] = 'hostname'
  @_hash['ip'] = 'ip'
  @_hash['mac'] = 'mac'
  @_hash['org_id'] = 'org_id'
  @_hash['site_id'] = 'site_id'
  @_hash['timestamp'] = 'timestamp'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
# File 'lib/mist_api/models/webhook_client_info_event.rb', line 61

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
57
58
# File 'lib/mist_api/models/webhook_client_info_event.rb', line 49

def self.optionals
  %w[
    hostname
    ip
    mac
    org_id
    site_id
    timestamp
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



98
99
100
101
102
103
104
# File 'lib/mist_api/models/webhook_client_info_event.rb', line 98

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.



114
115
116
117
118
119
# File 'lib/mist_api/models/webhook_client_info_event.rb', line 114

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} hostname: #{@hostname.inspect}, ip: #{@ip.inspect}, mac: #{@mac.inspect},"\
  " org_id: #{@org_id.inspect}, site_id: #{@site_id.inspect}, timestamp:"\
  " #{@timestamp.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



107
108
109
110
111
# File 'lib/mist_api/models/webhook_client_info_event.rb', line 107

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} hostname: #{@hostname}, ip: #{@ip}, mac: #{@mac}, org_id: #{@org_id},"\
  " site_id: #{@site_id}, timestamp: #{@timestamp}>"
end