Class: Falcon::DeviceGetDeviceInventory

Inherits:
Object
  • Object
show all
Defined in:
lib/crimson-falcon/models/device_get_device_inventory.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DeviceGetDeviceInventory

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
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
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 141

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::DeviceGetDeviceInventory` 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::DeviceGetDeviceInventory`. 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. = 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_idObject

Returns the value of attribute account_id.



34
35
36
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 34

def 
  @account_id
end

#apps_countObject

Returns the value of attribute apps_count.



36
37
38
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 36

def apps_count
  @apps_count
end

#device_nameObject

Returns the value of attribute device_name.



38
39
40
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 38

def device_name
  @device_name
end

#globally_compliantObject

Returns the value of attribute globally_compliant.



40
41
42
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 40

def globally_compliant
  @globally_compliant
end

#globally_managedObject

Returns the value of attribute globally_managed.



42
43
44
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 42

def globally_managed
  @globally_managed
end

#has_user_associationObject

Returns the value of attribute has_user_association.



44
45
46
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 44

def has_user_association
  @has_user_association
end

#idObject

Returns the value of attribute id.



46
47
48
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 46

def id
  @id
end

#last_seenObject

Returns the value of attribute last_seen.



48
49
50
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 48

def last_seen
  @last_seen
end

#mac_address_listObject

Returns the value of attribute mac_address_list.



50
51
52
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 50

def mac_address_list
  @mac_address_list
end

#osObject

Returns the value of attribute os.



52
53
54
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 52

def os
  @os
end

#os_versionObject

Returns the value of attribute os_version.



54
55
56
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 54

def os_version
  @os_version
end

#platformObject

Returns the value of attribute platform.



56
57
58
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 56

def platform
  @platform
end

#privileged_roles_countObject

Returns the value of attribute privileged_roles_count.



58
59
60
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 58

def privileged_roles_count
  @privileged_roles_count
end

#reported_appsObject

Returns the value of attribute reported_apps.



60
61
62
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 60

def reported_apps
  @reported_apps
end

#reportersObject

Returns the value of attribute reporters.



62
63
64
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 62

def reporters
  @reporters
end

#user_emailObject

Returns the value of attribute user_email.



64
65
66
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 64

def user_email
  @user_email
end

#user_existsObject

Returns the value of attribute user_exists.



66
67
68
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 66

def user_exists
  @user_exists
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



92
93
94
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 92

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 69

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



435
436
437
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 435

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 120

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_typesObject

Attribute type mapping.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 97

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.

Parameters:

  • Object (Object)

    to be compared



398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 398

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
       == o. &&
      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

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



466
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
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 466

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

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



537
538
539
540
541
542
543
544
545
546
547
548
549
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 537

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 442

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

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


422
423
424
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 422

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



428
429
430
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 428

def hash
  [, 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_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



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
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
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 231

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_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



513
514
515
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 513

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



519
520
521
522
523
524
525
526
527
528
529
530
531
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 519

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



507
508
509
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 507

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/crimson-falcon/models/device_get_device_inventory.rb', line 286

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