Class: MistApi::Site
- Defined in:
- lib/mist_api/models/site.rb
Overview
Site
Instance Attribute Summary collapse
-
#address ⇒ String
full address of the site.
-
#alarmtemplate_id ⇒ UUID | String
Alarm Template ID, this takes precedence over the Org-level alarmtemplate_id.
-
#aptemplate_id ⇒ UUID | String
AP Template ID, used by APs.
-
#country_code ⇒ String
Country code for the site (for AP config generation), in two-character.
-
#created_time ⇒ Float
When the object has been created, in epoch.
-
#gatewaytemplate_id ⇒ UUID | String
Gateway Template ID, used by gateways.
-
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#latlng ⇒ LatLng
Unique ID of the object instance in the Mist Organization.
-
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch.
-
#name ⇒ String
When the object has been modified for the last time, in epoch.
-
#networktemplate_id ⇒ UUID | String
Network Template ID, this takes precedence over Site Settings.
-
#notes ⇒ String
Optional, any notes about the site.
-
#org_id ⇒ UUID | String
Optional, any notes about the site.
-
#rftemplate_id ⇒ UUID | String
RF Template ID, this takes precedence over Site Settings.
-
#routertemplate_id ⇒ UUID | String
Router Template ID, used by gateways.
-
#secpolicy_id ⇒ UUID | String
SecPolicy ID.
-
#sitegroup_ids ⇒ Array[UUID | String]
Sitegroups this site belongs to.
-
#sitetemplate_id ⇒ UUID | String
Site Template ID.
-
#timezone ⇒ String
Timezone the site is at.
-
#tzoffset ⇒ Integer
Timezone the site is at.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(name = nil, address = SKIP, alarmtemplate_id = SKIP, aptemplate_id = SKIP, country_code = SKIP, created_time = SKIP, gatewaytemplate_id = SKIP, id = SKIP, latlng = SKIP, modified_time = SKIP, networktemplate_id = SKIP, notes = SKIP, org_id = SKIP, rftemplate_id = SKIP, routertemplate_id = SKIP, secpolicy_id = SKIP, sitegroup_ids = SKIP, sitetemplate_id = SKIP, timezone = 'UTC', tzoffset = 0, additional_properties = nil) ⇒ Site
constructor
A new instance of Site.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(name = nil, address = SKIP, alarmtemplate_id = SKIP, aptemplate_id = SKIP, country_code = SKIP, created_time = SKIP, gatewaytemplate_id = SKIP, id = SKIP, latlng = SKIP, modified_time = SKIP, networktemplate_id = SKIP, notes = SKIP, org_id = SKIP, rftemplate_id = SKIP, routertemplate_id = SKIP, secpolicy_id = SKIP, sitegroup_ids = SKIP, sitetemplate_id = SKIP, timezone = 'UTC', tzoffset = 0, additional_properties = nil) ⇒ Site
Returns a new instance of Site.
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/mist_api/models/site.rb', line 160 def initialize(name = nil, address = SKIP, alarmtemplate_id = SKIP, aptemplate_id = SKIP, country_code = SKIP, created_time = SKIP, gatewaytemplate_id = SKIP, id = SKIP, latlng = SKIP, modified_time = SKIP, networktemplate_id = SKIP, notes = SKIP, org_id = SKIP, rftemplate_id = SKIP, routertemplate_id = SKIP, secpolicy_id = SKIP, sitegroup_ids = SKIP, sitetemplate_id = SKIP, timezone = 'UTC', tzoffset = 0, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @address = address unless address == SKIP @alarmtemplate_id = alarmtemplate_id unless alarmtemplate_id == SKIP @aptemplate_id = aptemplate_id unless aptemplate_id == SKIP @country_code = country_code unless country_code == SKIP @created_time = created_time unless created_time == SKIP @gatewaytemplate_id = gatewaytemplate_id unless gatewaytemplate_id == SKIP @id = id unless id == SKIP @latlng = latlng unless latlng == SKIP @modified_time = modified_time unless modified_time == SKIP @name = name @networktemplate_id = networktemplate_id unless networktemplate_id == SKIP @notes = notes unless notes == SKIP @org_id = org_id unless org_id == SKIP @rftemplate_id = rftemplate_id unless rftemplate_id == SKIP @routertemplate_id = routertemplate_id unless routertemplate_id == SKIP @secpolicy_id = secpolicy_id unless secpolicy_id == SKIP @sitegroup_ids = sitegroup_ids unless sitegroup_ids == SKIP @sitetemplate_id = sitetemplate_id unless sitetemplate_id == SKIP @timezone = timezone unless timezone == SKIP @tzoffset = tzoffset unless tzoffset == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#address ⇒ String
full address of the site
14 15 16 |
# File 'lib/mist_api/models/site.rb', line 14 def address @address end |
#alarmtemplate_id ⇒ UUID | String
Alarm Template ID, this takes precedence over the Org-level alarmtemplate_id
19 20 21 |
# File 'lib/mist_api/models/site.rb', line 19 def alarmtemplate_id @alarmtemplate_id end |
#aptemplate_id ⇒ UUID | String
AP Template ID, used by APs
23 24 25 |
# File 'lib/mist_api/models/site.rb', line 23 def aptemplate_id @aptemplate_id end |
#country_code ⇒ String
Country code for the site (for AP config generation), in two-character
27 28 29 |
# File 'lib/mist_api/models/site.rb', line 27 def country_code @country_code end |
#created_time ⇒ Float
When the object has been created, in epoch
31 32 33 |
# File 'lib/mist_api/models/site.rb', line 31 def created_time @created_time end |
#gatewaytemplate_id ⇒ UUID | String
Gateway Template ID, used by gateways
35 36 37 |
# File 'lib/mist_api/models/site.rb', line 35 def gatewaytemplate_id @gatewaytemplate_id end |
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
39 40 41 |
# File 'lib/mist_api/models/site.rb', line 39 def id @id end |
#latlng ⇒ LatLng
Unique ID of the object instance in the Mist Organization
43 44 45 |
# File 'lib/mist_api/models/site.rb', line 43 def latlng @latlng end |
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch
47 48 49 |
# File 'lib/mist_api/models/site.rb', line 47 def modified_time @modified_time end |
#name ⇒ String
When the object has been modified for the last time, in epoch
51 52 53 |
# File 'lib/mist_api/models/site.rb', line 51 def name @name end |
#networktemplate_id ⇒ UUID | String
Network Template ID, this takes precedence over Site Settings
55 56 57 |
# File 'lib/mist_api/models/site.rb', line 55 def networktemplate_id @networktemplate_id end |
#notes ⇒ String
Optional, any notes about the site
59 60 61 |
# File 'lib/mist_api/models/site.rb', line 59 def notes @notes end |
#org_id ⇒ UUID | String
Optional, any notes about the site
63 64 65 |
# File 'lib/mist_api/models/site.rb', line 63 def org_id @org_id end |
#rftemplate_id ⇒ UUID | String
RF Template ID, this takes precedence over Site Settings
67 68 69 |
# File 'lib/mist_api/models/site.rb', line 67 def rftemplate_id @rftemplate_id end |
#routertemplate_id ⇒ UUID | String
Router Template ID, used by gateways
71 72 73 |
# File 'lib/mist_api/models/site.rb', line 71 def routertemplate_id @routertemplate_id end |
#secpolicy_id ⇒ UUID | String
SecPolicy ID
75 76 77 |
# File 'lib/mist_api/models/site.rb', line 75 def secpolicy_id @secpolicy_id end |
#sitegroup_ids ⇒ Array[UUID | String]
Sitegroups this site belongs to
79 80 81 |
# File 'lib/mist_api/models/site.rb', line 79 def sitegroup_ids @sitegroup_ids end |
#sitetemplate_id ⇒ UUID | String
Site Template ID
83 84 85 |
# File 'lib/mist_api/models/site.rb', line 83 def sitetemplate_id @sitetemplate_id end |
#timezone ⇒ String
Timezone the site is at
87 88 89 |
# File 'lib/mist_api/models/site.rb', line 87 def timezone @timezone end |
#tzoffset ⇒ Integer
Timezone the site is at
91 92 93 |
# File 'lib/mist_api/models/site.rb', line 91 def tzoffset @tzoffset end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/mist_api/models/site.rb', line 196 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : nil address = hash.key?('address') ? hash['address'] : SKIP alarmtemplate_id = hash.key?('alarmtemplate_id') ? hash['alarmtemplate_id'] : SKIP aptemplate_id = hash.key?('aptemplate_id') ? hash['aptemplate_id'] : SKIP country_code = hash.key?('country_code') ? hash['country_code'] : SKIP created_time = hash.key?('created_time') ? hash['created_time'] : SKIP gatewaytemplate_id = hash.key?('gatewaytemplate_id') ? hash['gatewaytemplate_id'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP latlng = LatLng.from_hash(hash['latlng']) if hash['latlng'] modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP networktemplate_id = hash.key?('networktemplate_id') ? hash['networktemplate_id'] : SKIP notes = hash.key?('notes') ? hash['notes'] : SKIP org_id = hash.key?('org_id') ? hash['org_id'] : SKIP rftemplate_id = hash.key?('rftemplate_id') ? hash['rftemplate_id'] : SKIP routertemplate_id = hash.key?('routertemplate_id') ? hash['routertemplate_id'] : SKIP secpolicy_id = hash.key?('secpolicy_id') ? hash['secpolicy_id'] : SKIP sitegroup_ids = hash.key?('sitegroup_ids') ? hash['sitegroup_ids'] : SKIP sitetemplate_id = hash.key?('sitetemplate_id') ? hash['sitetemplate_id'] : SKIP timezone = hash['timezone'] ||= 'UTC' tzoffset = hash['tzoffset'] ||= 0 # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. Site.new(name, address, alarmtemplate_id, aptemplate_id, country_code, created_time, gatewaytemplate_id, id, latlng, modified_time, networktemplate_id, notes, org_id, rftemplate_id, routertemplate_id, secpolicy_id, sitegroup_ids, sitetemplate_id, timezone, tzoffset, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/mist_api/models/site.rb', line 94 def self.names @_hash = {} if @_hash.nil? @_hash['address'] = 'address' @_hash['alarmtemplate_id'] = 'alarmtemplate_id' @_hash['aptemplate_id'] = 'aptemplate_id' @_hash['country_code'] = 'country_code' @_hash['created_time'] = 'created_time' @_hash['gatewaytemplate_id'] = 'gatewaytemplate_id' @_hash['id'] = 'id' @_hash['latlng'] = 'latlng' @_hash['modified_time'] = 'modified_time' @_hash['name'] = 'name' @_hash['networktemplate_id'] = 'networktemplate_id' @_hash['notes'] = 'notes' @_hash['org_id'] = 'org_id' @_hash['rftemplate_id'] = 'rftemplate_id' @_hash['routertemplate_id'] = 'routertemplate_id' @_hash['secpolicy_id'] = 'secpolicy_id' @_hash['sitegroup_ids'] = 'sitegroup_ids' @_hash['sitetemplate_id'] = 'sitetemplate_id' @_hash['timezone'] = 'timezone' @_hash['tzoffset'] = 'tzoffset' @_hash end |
.nullables ⇒ Object
An array for nullable fields
145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/mist_api/models/site.rb', line 145 def self.nullables %w[ address alarmtemplate_id aptemplate_id gatewaytemplate_id networktemplate_id notes rftemplate_id routertemplate_id secpolicy_id sitetemplate_id ] end |
.optionals ⇒ Object
An array for optional fields
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/mist_api/models/site.rb', line 120 def self.optionals %w[ address alarmtemplate_id aptemplate_id country_code created_time gatewaytemplate_id id latlng modified_time networktemplate_id notes org_id rftemplate_id routertemplate_id secpolicy_id sitegroup_ids sitetemplate_id timezone tzoffset ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/mist_api/models/site.rb', line 272 def inspect class_name = self.class.name.split('::').last "<#{class_name} address: #{@address.inspect}, alarmtemplate_id:"\ " #{@alarmtemplate_id.inspect}, aptemplate_id: #{@aptemplate_id.inspect}, country_code:"\ " #{@country_code.inspect}, created_time: #{@created_time.inspect}, gatewaytemplate_id:"\ " #{@gatewaytemplate_id.inspect}, id: #{@id.inspect}, latlng: #{@latlng.inspect},"\ " modified_time: #{@modified_time.inspect}, name: #{@name.inspect}, networktemplate_id:"\ " #{@networktemplate_id.inspect}, notes: #{@notes.inspect}, org_id: #{@org_id.inspect},"\ " rftemplate_id: #{@rftemplate_id.inspect}, routertemplate_id:"\ " #{@routertemplate_id.inspect}, secpolicy_id: #{@secpolicy_id.inspect}, sitegroup_ids:"\ " #{@sitegroup_ids.inspect}, sitetemplate_id: #{@sitetemplate_id.inspect}, timezone:"\ " #{@timezone.inspect}, tzoffset: #{@tzoffset.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/mist_api/models/site.rb', line 258 def to_s class_name = self.class.name.split('::').last "<#{class_name} address: #{@address}, alarmtemplate_id: #{@alarmtemplate_id},"\ " aptemplate_id: #{@aptemplate_id}, country_code: #{@country_code}, created_time:"\ " #{@created_time}, gatewaytemplate_id: #{@gatewaytemplate_id}, id: #{@id}, latlng:"\ " #{@latlng}, modified_time: #{@modified_time}, name: #{@name}, networktemplate_id:"\ " #{@networktemplate_id}, notes: #{@notes}, org_id: #{@org_id}, rftemplate_id:"\ " #{@rftemplate_id}, routertemplate_id: #{@routertemplate_id}, secpolicy_id:"\ " #{@secpolicy_id}, sitegroup_ids: #{@sitegroup_ids}, sitetemplate_id: #{@sitetemplate_id},"\ " timezone: #{@timezone}, tzoffset: #{@tzoffset}, additional_properties:"\ " #{@additional_properties}>" end |