Class: Falcon::UserGetUserInventory

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UserGetUserInventory

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

  if attributes.key?(:'country')
    self.country = attributes[:'country']
  end

  if attributes.key?(:'department')
    self.department = attributes[:'department']
  end

  if attributes.key?(:'domain')
    self.domain = attributes[:'domain']
  end

  if attributes.key?(:'email')
    self.email = attributes[:'email']
  end

  if attributes.key?(:'enabled')
    self.enabled = attributes[:'enabled']
  end

  if attributes.key?(:'exposures')
    if (value = attributes[:'exposures']).is_a?(Array)
      self.exposures = value
    end
  end

  if attributes.key?(:'exposures_total')
    self.exposures_total = attributes[:'exposures_total']
  end

  if attributes.key?(:'full_name')
    self.full_name = attributes[:'full_name']
  end

  if attributes.key?(:'integrations')
    if (value = attributes[:'integrations']).is_a?(Array)
      self.integrations = value
    end
  end

  if attributes.key?(:'integrations_total')
    self.integrations_total = attributes[:'integrations_total']
  end

  if attributes.key?(:'login_names')
    if (value = attributes[:'login_names']).is_a?(Array)
      self. = value
    end
  end

  if attributes.key?(:'roles')
    self.roles = attributes[:'roles']
  end

  if attributes.key?(:'title')
    self.title = attributes[:'title']
  end

  if attributes.key?(:'user_item_identity')
    self.user_item_identity = attributes[:'user_item_identity']
  end
end

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



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

def 
  @account_id
end

#companyObject

Returns the value of attribute company.



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

def company
  @company
end

#countryObject

Returns the value of attribute country.



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

def country
  @country
end

#departmentObject

Returns the value of attribute department.



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

def department
  @department
end

#domainObject

Returns the value of attribute domain.



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

def domain
  @domain
end

#emailObject

Returns the value of attribute email.



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

def email
  @email
end

#enabledObject

Returns the value of attribute enabled.



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

def enabled
  @enabled
end

#exposuresObject

Returns the value of attribute exposures.



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

def exposures
  @exposures
end

#exposures_totalObject

Returns the value of attribute exposures_total.



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

def exposures_total
  @exposures_total
end

#full_nameObject

Returns the value of attribute full_name.



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

def full_name
  @full_name
end

#integrationsObject

Returns the value of attribute integrations.



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

def integrations
  @integrations
end

#integrations_totalObject

Returns the value of attribute integrations_total.



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

def integrations_total
  @integrations_total
end

#login_namesObject

Returns the value of attribute login_names.



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

def 
  @login_names
end

#rolesObject

Returns the value of attribute roles.



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

def roles
  @roles
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end

#user_item_identityObject

Returns the value of attribute user_item_identity.



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

def user_item_identity
  @user_item_identity
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



89
90
91
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 89

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'account_id' => :'account_id',
    :'company' => :'company',
    :'country' => :'country',
    :'department' => :'department',
    :'domain' => :'domain',
    :'email' => :'email',
    :'enabled' => :'enabled',
    :'exposures' => :'exposures',
    :'exposures_total' => :'exposures_total',
    :'full_name' => :'full_name',
    :'integrations' => :'integrations',
    :'integrations_total' => :'integrations_total',
    :'login_names' => :'login_names',
    :'roles' => :'roles',
    :'title' => :'title',
    :'user_item_identity' => :'user_item_identity'
  }
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



482
483
484
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 482

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

.openapi_nullableObject

List of attributes with nullable: true



116
117
118
119
120
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 116

def self.openapi_nullable
  Set.new([
    :'user_item_identity'
  ])
end

.openapi_typesObject

Attribute type mapping.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 94

def self.openapi_types
  {
    :'account_id' => :'String',
    :'company' => :'String',
    :'country' => :'String',
    :'department' => :'String',
    :'domain' => :'String',
    :'email' => :'String',
    :'enabled' => :'Boolean',
    :'exposures' => :'Array<ExposureUserGetUserInventory>',
    :'exposures_total' => :'Integer',
    :'full_name' => :'String',
    :'integrations' => :'Array<IntegrationUserGetUserInventory>',
    :'integrations_total' => :'Integer',
    :'login_names' => :'Array<String>',
    :'roles' => :'Integer',
    :'title' => :'String',
    :'user_item_identity' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 446

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
       == o. &&
      company == o.company &&
      country == o.country &&
      department == o.department &&
      domain == o.domain &&
      email == o.email &&
      enabled == o.enabled &&
      exposures == o.exposures &&
      exposures_total == o.exposures_total &&
      full_name == o.full_name &&
      integrations == o.integrations &&
      integrations_total == o.integrations_total &&
       == o. &&
      roles == o.roles &&
      title == o.title &&
      user_item_identity == o.user_item_identity
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



513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 513

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



584
585
586
587
588
589
590
591
592
593
594
595
596
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 584

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



489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 489

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


469
470
471
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 469

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



475
476
477
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 475

def hash
  [, company, country, department, domain, email, enabled, exposures, exposures_total, full_name, integrations, integrations_total, , roles, title, user_item_identity].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 210

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 @company.nil?
    invalid_properties.push('invalid value for "company", company cannot be nil.')
  end

  if @company.to_s.length < 1
    invalid_properties.push('invalid value for "company", the character length must be great than or equal to 1.')
  end

  if @country.nil?
    invalid_properties.push('invalid value for "country", country cannot be nil.')
  end

  if @country.to_s.length < 1
    invalid_properties.push('invalid value for "country", the character length must be great than or equal to 1.')
  end

  if @department.nil?
    invalid_properties.push('invalid value for "department", department cannot be nil.')
  end

  if @department.to_s.length < 1
    invalid_properties.push('invalid value for "department", the character length must be great than or equal to 1.')
  end

  if @domain.nil?
    invalid_properties.push('invalid value for "domain", domain cannot be nil.')
  end

  if @domain.to_s.length < 1
    invalid_properties.push('invalid value for "domain", the character length must be great than or equal to 1.')
  end

  if @email.nil?
    invalid_properties.push('invalid value for "email", email cannot be nil.')
  end

  if @email.to_s.length < 1
    invalid_properties.push('invalid value for "email", the character length must be great than or equal to 1.')
  end

  if @enabled.nil?
    invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
  end

  if @exposures.nil?
    invalid_properties.push('invalid value for "exposures", exposures cannot be nil.')
  end

  if @exposures_total.nil?
    invalid_properties.push('invalid value for "exposures_total", exposures_total cannot be nil.')
  end

  if @full_name.nil?
    invalid_properties.push('invalid value for "full_name", full_name cannot be nil.')
  end

  if @full_name.to_s.length < 1
    invalid_properties.push('invalid value for "full_name", the character length must be great than or equal to 1.')
  end

  if @integrations.nil?
    invalid_properties.push('invalid value for "integrations", integrations cannot be nil.')
  end

  if @integrations_total.nil?
    invalid_properties.push('invalid value for "integrations_total", integrations_total cannot be nil.')
  end

  if @login_names.nil?
    invalid_properties.push('invalid value for "login_names", login_names cannot be nil.')
  end

  if @roles.nil?
    invalid_properties.push('invalid value for "roles", roles cannot be nil.')
  end

  if @title.nil?
    invalid_properties.push('invalid value for "title", title cannot be nil.')
  end

  if @title.to_s.length < 1
    invalid_properties.push('invalid value for "title", the character length must be great than or equal to 1.')
  end

  if @user_item_identity.to_s.length < 1
    invalid_properties.push('invalid value for "user_item_identity", 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



560
561
562
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 560

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



566
567
568
569
570
571
572
573
574
575
576
577
578
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 566

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



554
555
556
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 554

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



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/crimson-falcon/models/user_get_user_inventory.rb', line 309

def valid?
  return false if @account_id.nil?
  return false if @company.nil?
  return false if @company.to_s.length < 1
  return false if @country.nil?
  return false if @country.to_s.length < 1
  return false if @department.nil?
  return false if @department.to_s.length < 1
  return false if @domain.nil?
  return false if @domain.to_s.length < 1
  return false if @email.nil?
  return false if @email.to_s.length < 1
  return false if @enabled.nil?
  return false if @exposures.nil?
  return false if @exposures_total.nil?
  return false if @full_name.nil?
  return false if @full_name.to_s.length < 1
  return false if @integrations.nil?
  return false if @integrations_total.nil?
  return false if @login_names.nil?
  return false if @roles.nil?
  return false if @title.nil?
  return false if @title.to_s.length < 1
  return false if @user_item_identity.to_s.length < 1
  true
end