Class: MistApi::WebhookDeviceUpdownsEvent

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

Overview

WebhookDeviceUpdownsEvent 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(ap = nil, ap_name = nil, org_id = nil, site_id = nil, site_name = nil, timestamp = nil, type = nil, for_site = SKIP) ⇒ WebhookDeviceUpdownsEvent

Returns a new instance of WebhookDeviceUpdownsEvent.



70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/mist_api/models/webhook_device_updowns_event.rb', line 70

def initialize(ap = nil, ap_name = nil, org_id = nil, site_id = nil,
               site_name = nil, timestamp = nil, type = nil,
               for_site = SKIP)
  @ap = ap
  @ap_name = ap_name
  @for_site = for_site unless for_site == SKIP
  @org_id = org_id
  @site_id = site_id
  @site_name = site_name
  @timestamp = timestamp
  @type = type
end

Instance Attribute Details

#apString

TODO: Write general description for this method

Returns:

  • (String)


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

def ap
  @ap
end

#ap_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def ap_name
  @ap_name
end

#for_siteTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def for_site
  @for_site
end

#org_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#site_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

#site_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def site_name
  @site_name
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


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

def timestamp
  @timestamp
end

#typeString

Epoch (seconds)

Returns:

  • (String)


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

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ap = hash.key?('ap') ? hash['ap'] : nil
  ap_name = hash.key?('ap_name') ? hash['ap_name'] : nil
  org_id = hash.key?('org_id') ? hash['org_id'] : nil
  site_id = hash.key?('site_id') ? hash['site_id'] : nil
  site_name = hash.key?('site_name') ? hash['site_name'] : nil
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : nil
  type = hash.key?('type') ? hash['type'] : nil
  for_site = hash.key?('for_site') ? hash['for_site'] : SKIP

  # Create object from extracted values.
  WebhookDeviceUpdownsEvent.new(ap,
                                ap_name,
                                org_id,
                                site_id,
                                site_name,
                                timestamp,
                                type,
                                for_site)
end

.namesObject

A mapping from model property names to API property names.



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/mist_api/models/webhook_device_updowns_event.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ap'] = 'ap'
  @_hash['ap_name'] = 'ap_name'
  @_hash['for_site'] = 'for_site'
  @_hash['org_id'] = 'org_id'
  @_hash['site_id'] = 'site_id'
  @_hash['site_name'] = 'site_name'
  @_hash['timestamp'] = 'timestamp'
  @_hash['type'] = 'type'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



59
60
61
62
63
# File 'lib/mist_api/models/webhook_device_updowns_event.rb', line 59

def self.optionals
  %w[
    for_site
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



110
111
112
113
114
115
116
117
118
119
120
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
# File 'lib/mist_api/models/webhook_device_updowns_event.rb', line 110

def self.validate(value)
  if value.instance_of? self
    return (
      APIHelper.valid_type?(value.ap,
                            ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.ap_name,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.org_id,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.site_id,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.site_name,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.timestamp,
                              ->(val) { val.instance_of? Float }) and
        APIHelper.valid_type?(value.type,
                              ->(val) { val.instance_of? String })
    )
  end

  return false unless value.instance_of? Hash

  (
    APIHelper.valid_type?(value['ap'],
                          ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['ap_name'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['org_id'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['site_id'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['site_name'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['timestamp'],
                            ->(val) { val.instance_of? Float }) and
      APIHelper.valid_type?(value['type'],
                            ->(val) { val.instance_of? String })
  )
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



159
160
161
162
163
164
# File 'lib/mist_api/models/webhook_device_updowns_event.rb', line 159

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap.inspect}, ap_name: #{@ap_name.inspect}, for_site:"\
  " #{@for_site.inspect}, org_id: #{@org_id.inspect}, site_id: #{@site_id.inspect}, site_name:"\
  " #{@site_name.inspect}, timestamp: #{@timestamp.inspect}, type: #{@type.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



151
152
153
154
155
156
# File 'lib/mist_api/models/webhook_device_updowns_event.rb', line 151

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap}, ap_name: #{@ap_name}, for_site: #{@for_site}, org_id:"\
  " #{@org_id}, site_id: #{@site_id}, site_name: #{@site_name}, timestamp: #{@timestamp},"\
  " type: #{@type}>"
end