Class: Falcon::Device3550eb212db1414995c297cdbfe5cc16
- Inherits:
-
Object
- Object
- Falcon::Device3550eb212db1414995c297cdbfe5cc16
- Defined in:
- lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#apps_count ⇒ Object
Returns the value of attribute apps_count.
-
#device_name ⇒ Object
Returns the value of attribute device_name.
-
#globally_compliant ⇒ Object
Returns the value of attribute globally_compliant.
-
#globally_managed ⇒ Object
Returns the value of attribute globally_managed.
-
#has_user_association ⇒ Object
Returns the value of attribute has_user_association.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_seen ⇒ Object
Returns the value of attribute last_seen.
-
#mac_address_list ⇒ Object
Returns the value of attribute mac_address_list.
-
#os ⇒ Object
Returns the value of attribute os.
-
#os_version ⇒ Object
Returns the value of attribute os_version.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#privileged_roles_count ⇒ Object
Returns the value of attribute privileged_roles_count.
-
#reported_apps ⇒ Object
Returns the value of attribute reported_apps.
-
#reporters ⇒ Object
Returns the value of attribute reporters.
-
#user_email ⇒ Object
Returns the value of attribute user_email.
-
#user_exists ⇒ Object
Returns the value of attribute user_exists.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Device3550eb212db1414995c297cdbfe5cc16
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Device3550eb212db1414995c297cdbfe5cc16
Initializes the object
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 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 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 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 142 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::Device3550eb212db1414995c297cdbfe5cc16` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Falcon::Device3550eb212db1414995c297cdbfe5cc16`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'account_id') self.account_id = attributes[:'account_id'] end if attributes.key?(:'apps_count') self.apps_count = attributes[:'apps_count'] end if attributes.key?(:'device_name') self.device_name = attributes[:'device_name'] end if attributes.key?(:'globally_compliant') self.globally_compliant = attributes[:'globally_compliant'] end if attributes.key?(:'globally_managed') self.globally_managed = attributes[:'globally_managed'] end if attributes.key?(:'has_user_association') self.has_user_association = attributes[:'has_user_association'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'last_seen') self.last_seen = attributes[:'last_seen'] end if attributes.key?(:'mac_address_list') if (value = attributes[:'mac_address_list']).is_a?(Array) self.mac_address_list = value end end if attributes.key?(:'os') self.os = attributes[:'os'] end if attributes.key?(:'os_version') self.os_version = attributes[:'os_version'] end if attributes.key?(:'platform') self.platform = attributes[:'platform'] end if attributes.key?(:'privileged_roles_count') self.privileged_roles_count = attributes[:'privileged_roles_count'] end if attributes.key?(:'reported_apps') if (value = attributes[:'reported_apps']).is_a?(Array) self.reported_apps = value end end if attributes.key?(:'reporters') if (value = attributes[:'reporters']).is_a?(Array) self.reporters = value end end if attributes.key?(:'user_email') self.user_email = attributes[:'user_email'] end if attributes.key?(:'user_exists') self.user_exists = attributes[:'user_exists'] end end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
35 36 37 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 35 def account_id @account_id end |
#apps_count ⇒ Object
Returns the value of attribute apps_count.
37 38 39 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 37 def apps_count @apps_count end |
#device_name ⇒ Object
Returns the value of attribute device_name.
39 40 41 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 39 def device_name @device_name end |
#globally_compliant ⇒ Object
Returns the value of attribute globally_compliant.
41 42 43 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 41 def globally_compliant @globally_compliant end |
#globally_managed ⇒ Object
Returns the value of attribute globally_managed.
43 44 45 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 43 def globally_managed @globally_managed end |
#has_user_association ⇒ Object
Returns the value of attribute has_user_association.
45 46 47 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 45 def has_user_association @has_user_association end |
#id ⇒ Object
Returns the value of attribute id.
47 48 49 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 47 def id @id end |
#last_seen ⇒ Object
Returns the value of attribute last_seen.
49 50 51 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 49 def last_seen @last_seen end |
#mac_address_list ⇒ Object
Returns the value of attribute mac_address_list.
51 52 53 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 51 def mac_address_list @mac_address_list end |
#os ⇒ Object
Returns the value of attribute os.
53 54 55 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 53 def os @os end |
#os_version ⇒ Object
Returns the value of attribute os_version.
55 56 57 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 55 def os_version @os_version end |
#platform ⇒ Object
Returns the value of attribute platform.
57 58 59 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 57 def platform @platform end |
#privileged_roles_count ⇒ Object
Returns the value of attribute privileged_roles_count.
59 60 61 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 59 def privileged_roles_count @privileged_roles_count end |
#reported_apps ⇒ Object
Returns the value of attribute reported_apps.
61 62 63 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 61 def reported_apps @reported_apps end |
#reporters ⇒ Object
Returns the value of attribute reporters.
63 64 65 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 63 def reporters @reporters end |
#user_email ⇒ Object
Returns the value of attribute user_email.
65 66 67 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 65 def user_email @user_email end |
#user_exists ⇒ Object
Returns the value of attribute user_exists.
67 68 69 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 67 def user_exists @user_exists end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
93 94 95 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 93 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 70 def self.attribute_map { :'account_id' => :'account_id', :'apps_count' => :'apps_count', :'device_name' => :'device_name', :'globally_compliant' => :'globally_compliant', :'globally_managed' => :'globally_managed', :'has_user_association' => :'has_user_association', :'id' => :'id', :'last_seen' => :'last_seen', :'mac_address_list' => :'mac_address_list', :'os' => :'os', :'os_version' => :'os_version', :'platform' => :'platform', :'privileged_roles_count' => :'privileged_roles_count', :'reported_apps' => :'reported_apps', :'reporters' => :'reporters', :'user_email' => :'user_email', :'user_exists' => :'user_exists' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
436 437 438 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 436 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 121 def self.openapi_nullable Set.new([ :'apps_count', :'device_name', :'globally_compliant', :'globally_managed', :'has_user_association', :'last_seen', :'mac_address_list', :'os', :'os_version', :'platform', :'privileged_roles_count', :'reported_apps', :'user_email', :'user_exists' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 98 def self.openapi_types { :'account_id' => :'String', :'apps_count' => :'Integer', :'device_name' => :'String', :'globally_compliant' => :'String', :'globally_managed' => :'String', :'has_user_association' => :'Boolean', :'id' => :'String', :'last_seen' => :'String', :'mac_address_list' => :'Array<String>', :'os' => :'String', :'os_version' => :'String', :'platform' => :'String', :'privileged_roles_count' => :'Integer', :'reported_apps' => :'Array<String>', :'reporters' => :'Array<String>', :'user_email' => :'String', :'user_exists' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 399 def ==(o) return true if self.equal?(o) self.class == o.class && account_id == o.account_id && apps_count == o.apps_count && device_name == o.device_name && globally_compliant == o.globally_compliant && globally_managed == o.globally_managed && has_user_association == o.has_user_association && id == o.id && last_seen == o.last_seen && mac_address_list == o.mac_address_list && os == o.os && os_version == o.os_version && platform == o.platform && privileged_roles_count == o.privileged_roles_count && reported_apps == o.reported_apps && reporters == o.reporters && user_email == o.user_email && user_exists == o.user_exists end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 467 def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = Falcon.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
538 539 540 541 542 543 544 545 546 547 548 549 550 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 538 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 443 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
423 424 425 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 423 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
429 430 431 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 429 def hash [account_id, apps_count, device_name, globally_compliant, globally_managed, has_user_association, id, last_seen, mac_address_list, os, os_version, platform, privileged_roles_count, reported_apps, reporters, user_email, user_exists].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 232 def list_invalid_properties invalid_properties = Array.new if @account_id.nil? invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') end if @device_name.to_s.length < 1 invalid_properties.push('invalid value for "device_name", the character length must be great than or equal to 1.') end if @globally_compliant.to_s.length < 1 invalid_properties.push('invalid value for "globally_compliant", the character length must be great than or equal to 1.') end if @globally_managed.to_s.length < 1 invalid_properties.push('invalid value for "globally_managed", the character length must be great than or equal to 1.') end if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @id.to_s.length < 1 invalid_properties.push('invalid value for "id", the character length must be great than or equal to 1.') end if @last_seen.to_s.length < 1 invalid_properties.push('invalid value for "last_seen", the character length must be great than or equal to 1.') end if @os.to_s.length < 1 invalid_properties.push('invalid value for "os", the character length must be great than or equal to 1.') end if @os_version.to_s.length < 1 invalid_properties.push('invalid value for "os_version", the character length must be great than or equal to 1.') end if @platform.to_s.length < 1 invalid_properties.push('invalid value for "platform", the character length must be great than or equal to 1.') end if @reporters.nil? invalid_properties.push('invalid value for "reporters", reporters cannot be nil.') end if @user_email.to_s.length < 1 invalid_properties.push('invalid value for "user_email", the character length must be great than or equal to 1.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
514 515 516 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 514 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
520 521 522 523 524 525 526 527 528 529 530 531 532 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 520 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
508 509 510 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 508 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/crimson-falcon/models/device3550eb212db1414995c297cdbfe5cc16.rb', line 287 def valid? return false if @account_id.nil? return false if @device_name.to_s.length < 1 return false if @globally_compliant.to_s.length < 1 return false if @globally_managed.to_s.length < 1 return false if @id.nil? return false if @id.to_s.length < 1 return false if @last_seen.to_s.length < 1 return false if @os.to_s.length < 1 return false if @os_version.to_s.length < 1 return false if @platform.to_s.length < 1 return false if @reporters.nil? return false if @user_email.to_s.length < 1 true end |