Class: MistApi::StatsOrg

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

Overview

Org statistics

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(alarmtemplate_id = nil, allow_mist = nil, created_time = nil, id = nil, modified_time = nil, msp_id = nil, name = nil, num_devices = nil, num_devices_connected = nil, num_devices_disconnected = nil, num_inventory = nil, num_sites = nil, orggroup_ids = nil, session_expiry = nil, sle = nil) ⇒ StatsOrg

Returns a new instance of StatsOrg.



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/mist_api/models/stats_org.rb', line 103

def initialize(alarmtemplate_id = nil, allow_mist = nil, created_time = nil,
               id = nil, modified_time = nil, msp_id = nil, name = nil,
               num_devices = nil, num_devices_connected = nil,
               num_devices_disconnected = nil, num_inventory = nil,
               num_sites = nil, orggroup_ids = nil, session_expiry = nil,
               sle = nil)
  @alarmtemplate_id = alarmtemplate_id
  @allow_mist = allow_mist
  @created_time = created_time
  @id = id
  @modified_time = modified_time
  @msp_id = msp_id
  @name = name
  @num_devices = num_devices
  @num_devices_connected = num_devices_connected
  @num_devices_disconnected = num_devices_disconnected
  @num_inventory = num_inventory
  @num_sites = num_sites
  @orggroup_ids = orggroup_ids
  @session_expiry = session_expiry
  @sle = sle
end

Instance Attribute Details

#alarmtemplate_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


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

def alarmtemplate_id
  @alarmtemplate_id
end

#allow_mistTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def allow_mist
  @allow_mist
end

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


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

def created_time
  @created_time
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#modified_timeFloat

When the object has been modified for the last time, in epoch

Returns:

  • (Float)


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

def modified_time
  @modified_time
end

#msp_idUUID | String

When the object has been modified for the last time, in epoch

Returns:

  • (UUID | String)


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

def msp_id
  @msp_id
end

#nameString

When the object has been modified for the last time, in epoch

Returns:

  • (String)


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

def name
  @name
end

#num_devicesInteger

When the object has been modified for the last time, in epoch

Returns:

  • (Integer)


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

def num_devices
  @num_devices
end

#num_devices_connectedInteger

When the object has been modified for the last time, in epoch

Returns:

  • (Integer)


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

def num_devices_connected
  @num_devices_connected
end

#num_devices_disconnectedInteger

When the object has been modified for the last time, in epoch

Returns:

  • (Integer)


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

def num_devices_disconnected
  @num_devices_disconnected
end

#num_inventoryInteger

When the object has been modified for the last time, in epoch

Returns:

  • (Integer)


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

def num_inventory
  @num_inventory
end

#num_sitesInteger

When the object has been modified for the last time, in epoch

Returns:

  • (Integer)


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

def num_sites
  @num_sites
end

#orggroup_idsArray[UUID | String]

When the object has been modified for the last time, in epoch

Returns:

  • (Array[UUID | String])


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

def orggroup_ids
  @orggroup_ids
end

#session_expiryInteger

When the object has been modified for the last time, in epoch

Returns:

  • (Integer)


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

def session_expiry
  @session_expiry
end

#sleArray[StatsOrgSle]

When the object has been modified for the last time, in epoch

Returns:



70
71
72
# File 'lib/mist_api/models/stats_org.rb', line 70

def sle
  @sle
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/mist_api/models/stats_org.rb', line 127

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  alarmtemplate_id =
    hash.key?('alarmtemplate_id') ? hash['alarmtemplate_id'] : nil
  allow_mist = hash.key?('allow_mist') ? hash['allow_mist'] : nil
  created_time = hash.key?('created_time') ? hash['created_time'] : nil
  id = hash.key?('id') ? hash['id'] : nil
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : nil
  msp_id = hash.key?('msp_id') ? hash['msp_id'] : nil
  name = hash.key?('name') ? hash['name'] : nil
  num_devices = hash.key?('num_devices') ? hash['num_devices'] : nil
  num_devices_connected =
    hash.key?('num_devices_connected') ? hash['num_devices_connected'] : nil
  num_devices_disconnected =
    hash.key?('num_devices_disconnected') ? hash['num_devices_disconnected'] : nil
  num_inventory = hash.key?('num_inventory') ? hash['num_inventory'] : nil
  num_sites = hash.key?('num_sites') ? hash['num_sites'] : nil
  orggroup_ids = hash.key?('orggroup_ids') ? hash['orggroup_ids'] : nil
  session_expiry =
    hash.key?('session_expiry') ? hash['session_expiry'] : nil
  # Parameter is an array, so we need to iterate through it
  sle = nil
  unless hash['sle'].nil?
    sle = []
    hash['sle'].each do |structure|
      sle << (StatsOrgSle.from_hash(structure) if structure)
    end
  end

  sle = nil unless hash.key?('sle')

  # Create object from extracted values.
  StatsOrg.new(alarmtemplate_id,
               allow_mist,
               created_time,
               id,
               modified_time,
               msp_id,
               name,
               num_devices,
               num_devices_connected,
               num_devices_disconnected,
               num_inventory,
               num_sites,
               orggroup_ids,
               session_expiry,
               sle)
end

.namesObject

A mapping from model property names to API property names.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/mist_api/models/stats_org.rb', line 73

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['alarmtemplate_id'] = 'alarmtemplate_id'
  @_hash['allow_mist'] = 'allow_mist'
  @_hash['created_time'] = 'created_time'
  @_hash['id'] = 'id'
  @_hash['modified_time'] = 'modified_time'
  @_hash['msp_id'] = 'msp_id'
  @_hash['name'] = 'name'
  @_hash['num_devices'] = 'num_devices'
  @_hash['num_devices_connected'] = 'num_devices_connected'
  @_hash['num_devices_disconnected'] = 'num_devices_disconnected'
  @_hash['num_inventory'] = 'num_inventory'
  @_hash['num_sites'] = 'num_sites'
  @_hash['orggroup_ids'] = 'orggroup_ids'
  @_hash['session_expiry'] = 'session_expiry'
  @_hash['sle'] = 'sle'
  @_hash
end

.nullablesObject

An array for nullable fields



99
100
101
# File 'lib/mist_api/models/stats_org.rb', line 99

def self.nullables
  []
end

.optionalsObject

An array for optional fields



94
95
96
# File 'lib/mist_api/models/stats_org.rb', line 94

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



190
191
192
193
194
195
196
197
198
199
200
# File 'lib/mist_api/models/stats_org.rb', line 190

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} alarmtemplate_id: #{@alarmtemplate_id.inspect}, allow_mist:"\
  " #{@allow_mist.inspect}, created_time: #{@created_time.inspect}, id: #{@id.inspect},"\
  " modified_time: #{@modified_time.inspect}, msp_id: #{@msp_id.inspect}, name:"\
  " #{@name.inspect}, num_devices: #{@num_devices.inspect}, num_devices_connected:"\
  " #{@num_devices_connected.inspect}, num_devices_disconnected:"\
  " #{@num_devices_disconnected.inspect}, num_inventory: #{@num_inventory.inspect}, num_sites:"\
  " #{@num_sites.inspect}, orggroup_ids: #{@orggroup_ids.inspect}, session_expiry:"\
  " #{@session_expiry.inspect}, sle: #{@sle.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



179
180
181
182
183
184
185
186
187
# File 'lib/mist_api/models/stats_org.rb', line 179

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} alarmtemplate_id: #{@alarmtemplate_id}, allow_mist: #{@allow_mist},"\
  " created_time: #{@created_time}, id: #{@id}, modified_time: #{@modified_time}, msp_id:"\
  " #{@msp_id}, name: #{@name}, num_devices: #{@num_devices}, num_devices_connected:"\
  " #{@num_devices_connected}, num_devices_disconnected: #{@num_devices_disconnected},"\
  " num_inventory: #{@num_inventory}, num_sites: #{@num_sites}, orggroup_ids:"\
  " #{@orggroup_ids}, session_expiry: #{@session_expiry}, sle: #{@sle}>"
end