Class: Falcon::ModelsAPICustomerAndImage

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ModelsAPICustomerAndImage

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

Returns the value of attribute ai_related.



35
36
37
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 35

def ai_related
  @ai_related
end

#base_image_idObject

Returns the value of attribute base_image_id.



37
38
39
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 37

def base_image_id
  @base_image_id
end

#base_osObject

Returns the value of attribute base_os.



39
40
41
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 39

def base_os
  @base_os
end

#base_os_versionObject

Returns the value of attribute base_os_version.



41
42
43
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 41

def base_os_version
  @base_os_version
end

#cidObject

Returns the value of attribute cid.



43
44
45
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 43

def cid
  @cid
end

#configObject

Returns the value of attribute config.



45
46
47
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 45

def config
  @config
end

#created_atObject

Returns the value of attribute created_at.



47
48
49
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 47

def created_at
  @created_at
end

#crowdstrike_userObject

Returns the value of attribute crowdstrike_user.



49
50
51
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 49

def crowdstrike_user
  @crowdstrike_user
end

#digestObject

Returns the value of attribute digest.



51
52
53
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 51

def digest
  @digest
end

#eol_dateObject

Returns the value of attribute eol_date.



53
54
55
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 53

def eol_date
  @eol_date
end

#first_scannedObject

Returns the value of attribute first_scanned.



55
56
57
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 55

def first_scanned
  @first_scanned
end

#image_idObject

Returns the value of attribute image_id.



57
58
59
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 57

def image_id
  @image_id
end

#image_scanning_activeObject

Returns the value of attribute image_scanning_active.



59
60
61
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 59

def image_scanning_active
  @image_scanning_active
end

#image_sizeObject

Returns the value of attribute image_size.



61
62
63
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 61

def image_size
  @image_size
end

#is_base_imageObject

Returns the value of attribute is_base_image.



63
64
65
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 63

def is_base_image
  @is_base_image
end

#registryObject

Returns the value of attribute registry.



65
66
67
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 65

def registry
  @registry
end

#repositoryObject

Returns the value of attribute repository.



67
68
69
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 67

def repository
  @repository
end

#sourceObject

Returns the value of attribute source.



69
70
71
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 69

def source
  @source
end

#source_base_imageObject

Returns the value of attribute source_base_image.



71
72
73
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 71

def source_base_image
  @source_base_image
end

#tagObject

Returns the value of attribute tag.



73
74
75
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 73

def tag
  @tag
end

#updated_atObject

Returns the value of attribute updated_at.



75
76
77
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 75

def updated_at
  @updated_at
end

#uuidObject

Returns the value of attribute uuid.



77
78
79
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 77

def uuid
  @uuid
end

#warningObject

Returns the value of attribute warning.



79
80
81
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 79

def warning
  @warning
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



111
112
113
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 111

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 82

def self.attribute_map
  {
    :'ai_related' => :'ai_related',
    :'base_image_id' => :'base_image_id',
    :'base_os' => :'base_os',
    :'base_os_version' => :'base_os_version',
    :'cid' => :'cid',
    :'config' => :'config',
    :'created_at' => :'created_at',
    :'crowdstrike_user' => :'crowdstrike_user',
    :'digest' => :'digest',
    :'eol_date' => :'eol_date',
    :'first_scanned' => :'first_scanned',
    :'image_id' => :'image_id',
    :'image_scanning_active' => :'image_scanning_active',
    :'image_size' => :'image_size',
    :'is_base_image' => :'is_base_image',
    :'registry' => :'registry',
    :'repository' => :'repository',
    :'source' => :'source',
    :'source_base_image' => :'source_base_image',
    :'tag' => :'tag',
    :'updated_at' => :'updated_at',
    :'uuid' => :'uuid',
    :'warning' => :'warning'
  }
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



421
422
423
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 421

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

.openapi_nullableObject

List of attributes with nullable: true



145
146
147
148
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 145

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



116
117
118
119
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/crimson-falcon/models/models_api_customer_and_image.rb', line 116

def self.openapi_types
  {
    :'ai_related' => :'Boolean',
    :'base_image_id' => :'String',
    :'base_os' => :'String',
    :'base_os_version' => :'String',
    :'cid' => :'String',
    :'config' => :'ModelsLightWeightConfig',
    :'created_at' => :'String',
    :'crowdstrike_user' => :'String',
    :'digest' => :'String',
    :'eol_date' => :'String',
    :'first_scanned' => :'String',
    :'image_id' => :'String',
    :'image_scanning_active' => :'Boolean',
    :'image_size' => :'Integer',
    :'is_base_image' => :'Boolean',
    :'registry' => :'String',
    :'repository' => :'String',
    :'source' => :'String',
    :'source_base_image' => :'ModelsImageDetails',
    :'tag' => :'String',
    :'updated_at' => :'String',
    :'uuid' => :'String',
    :'warning' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 378

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      ai_related == o.ai_related &&
      base_image_id == o.base_image_id &&
      base_os == o.base_os &&
      base_os_version == o.base_os_version &&
      cid == o.cid &&
      config == o.config &&
      created_at == o.created_at &&
      crowdstrike_user == o.crowdstrike_user &&
      digest == o.digest &&
      eol_date == o.eol_date &&
      first_scanned == o.first_scanned &&
      image_id == o.image_id &&
      image_scanning_active == o.image_scanning_active &&
      image_size == o.image_size &&
      is_base_image == o.is_base_image &&
      registry == o.registry &&
      repository == o.repository &&
      source == o.source &&
      source_base_image == o.source_base_image &&
      tag == o.tag &&
      updated_at == o.updated_at &&
      uuid == o.uuid &&
      warning == o.warning
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



452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 452

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



523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 523

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



428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 428

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


408
409
410
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 408

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



414
415
416
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 414

def hash
  [ai_related, base_image_id, base_os, base_os_version, cid, config, created_at, crowdstrike_user, digest, eol_date, first_scanned, image_id, image_scanning_active, image_size, is_base_image, registry, repository, source, source_base_image, tag, updated_at, uuid, warning].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
306
307
308
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
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 260

def list_invalid_properties
  invalid_properties = Array.new
  if @ai_related.nil?
    invalid_properties.push('invalid value for "ai_related", ai_related cannot be nil.')
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



499
500
501
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 499

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



505
506
507
508
509
510
511
512
513
514
515
516
517
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 505

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



493
494
495
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 493

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



351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/crimson-falcon/models/models_api_customer_and_image.rb', line 351

def valid?
  return false if @ai_related.nil?
  return false if @base_os.nil?
  return false if @base_os_version.nil?
  return false if @cid.nil?
  return false if @created_at.nil?
  return false if @crowdstrike_user.nil?
  return false if @digest.nil?
  return false if @eol_date.nil?
  return false if @first_scanned.nil?
  return false if @image_id.nil?
  return false if @image_scanning_active.nil?
  return false if @image_size.nil?
  return false if @is_base_image.nil?
  return false if @registry.nil?
  return false if @repository.nil?
  return false if @source.nil?
  return false if @source_base_image.nil?
  return false if @tag.nil?
  return false if @updated_at.nil?
  return false if @uuid.nil?
  return false if @warning.nil?
  true
end