Class: Falcon::ModelsAPIUnidentifiedContainer

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ModelsAPIUnidentifiedContainer

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 143

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#assessed_imagesObject

Returns the value of attribute assessed_images.



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

def assessed_images
  @assessed_images
end

#assessed_images_countObject

Returns the value of attribute assessed_images_count.



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

def assessed_images_count
  @assessed_images_count
end

#cidObject

Returns the value of attribute cid.



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

def cid
  @cid
end

#cluster_nameObject

Returns the value of attribute cluster_name.



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

def cluster_name
  @cluster_name
end

#containers_impactedObject

Returns the value of attribute containers_impacted.



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

def containers_impacted
  @containers_impacted
end

#containers_impacted_countObject

Returns the value of attribute containers_impacted_count.



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

def containers_impacted_count
  @containers_impacted_count
end

#detect_timestampObject

Returns the value of attribute detect_timestamp.



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

def detect_timestamp
  @detect_timestamp
end

#detections_countObject

Returns the value of attribute detections_count.



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

def detections_count
  @detections_count
end

#first_seenObject

Returns the value of attribute first_seen.



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

def first_seen
  @first_seen
end

#host_idObject

Returns the value of attribute host_id.



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

def host_id
  @host_id
end

#image_assessment_detections_countObject

Returns the value of attribute image_assessment_detections_count.



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

def image_assessment_detections_count
  @image_assessment_detections_count
end

#last_seenObject

Returns the value of attribute last_seen.



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

def last_seen
  @last_seen
end

#namespaceObject

Returns the value of attribute namespace.



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

def namespace
  @namespace
end

#node_nameObject

Returns the value of attribute node_name.



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

def node_name
  @node_name
end

#pod_idObject

Returns the value of attribute pod_id.



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

def pod_id
  @pod_id
end

#pod_nameObject

Returns the value of attribute pod_name.



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

def pod_name
  @pod_name
end

#runtime_detections_countObject

Returns the value of attribute runtime_detections_count.



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

def runtime_detections_count
  @runtime_detections_count
end

#severityObject

Returns the value of attribute severity.



68
69
70
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 68

def severity
  @severity
end

#unassessed_imagesObject

Returns the value of attribute unassessed_images.



70
71
72
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 70

def unassessed_images
  @unassessed_images
end

#unassessed_images_countObject

Returns the value of attribute unassessed_images_count.



72
73
74
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 72

def unassessed_images_count
  @unassessed_images_count
end

#visible_to_k8sObject

Returns the value of attribute visible_to_k8s.



74
75
76
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 74

def visible_to_k8s
  @visible_to_k8s
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



104
105
106
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 104

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 77

def self.attribute_map
  {
    :'assessed_images' => :'assessed_images',
    :'assessed_images_count' => :'assessed_images_count',
    :'cid' => :'cid',
    :'cluster_name' => :'cluster_name',
    :'containers_impacted' => :'containers_impacted',
    :'containers_impacted_count' => :'containers_impacted_count',
    :'detect_timestamp' => :'detect_timestamp',
    :'detections_count' => :'detections_count',
    :'first_seen' => :'first_seen',
    :'host_id' => :'host_id',
    :'image_assessment_detections_count' => :'image_assessment_detections_count',
    :'last_seen' => :'last_seen',
    :'namespace' => :'namespace',
    :'node_name' => :'node_name',
    :'pod_id' => :'pod_id',
    :'pod_name' => :'pod_name',
    :'runtime_detections_count' => :'runtime_detections_count',
    :'severity' => :'severity',
    :'unassessed_images' => :'unassessed_images',
    :'unassessed_images_count' => :'unassessed_images_count',
    :'visible_to_k8s' => :'visible_to_k8s'
  }
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



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

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

.openapi_nullableObject

List of attributes with nullable: true



136
137
138
139
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 136

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

.openapi_typesObject

Attribute type mapping.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 109

def self.openapi_types
  {
    :'assessed_images' => :'Array<ModelsImageInformation>',
    :'assessed_images_count' => :'String',
    :'cid' => :'String',
    :'cluster_name' => :'String',
    :'containers_impacted' => :'Array<ModelsContainerInformation>',
    :'containers_impacted_count' => :'String',
    :'detect_timestamp' => :'String',
    :'detections_count' => :'String',
    :'first_seen' => :'String',
    :'host_id' => :'String',
    :'image_assessment_detections_count' => :'String',
    :'last_seen' => :'String',
    :'namespace' => :'String',
    :'node_name' => :'String',
    :'pod_id' => :'String',
    :'pod_name' => :'String',
    :'runtime_detections_count' => :'String',
    :'severity' => :'String',
    :'unassessed_images' => :'Array<ModelsImageInformation>',
    :'unassessed_images_count' => :'String',
    :'visible_to_k8s' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 367

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      assessed_images == o.assessed_images &&
      assessed_images_count == o.assessed_images_count &&
      cid == o.cid &&
      cluster_name == o.cluster_name &&
      containers_impacted == o.containers_impacted &&
      containers_impacted_count == o.containers_impacted_count &&
      detect_timestamp == o.detect_timestamp &&
      detections_count == o.detections_count &&
      first_seen == o.first_seen &&
      host_id == o.host_id &&
      image_assessment_detections_count == o.image_assessment_detections_count &&
      last_seen == o.last_seen &&
      namespace == o.namespace &&
      node_name == o.node_name &&
      pod_id == o.pod_id &&
      pod_name == o.pod_name &&
      runtime_detections_count == o.runtime_detections_count &&
      severity == o.severity &&
      unassessed_images == o.unassessed_images &&
      unassessed_images_count == o.unassessed_images_count &&
      visible_to_k8s == o.visible_to_k8s
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



439
440
441
442
443
444
445
446
447
448
449
450
451
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
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 439

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



510
511
512
513
514
515
516
517
518
519
520
521
522
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 510

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



415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 415

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


395
396
397
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 395

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



401
402
403
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 401

def hash
  [assessed_images, assessed_images_count, cid, cluster_name, containers_impacted, containers_impacted_count, detect_timestamp, detections_count, first_seen, host_id, image_assessment_detections_count, last_seen, namespace, node_name, pod_id, pod_name, runtime_detections_count, severity, unassessed_images, unassessed_images_count, visible_to_k8s].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



486
487
488
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 486

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



492
493
494
495
496
497
498
499
500
501
502
503
504
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 492

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



480
481
482
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 480

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



340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/crimson-falcon/models/models_api_unidentified_container.rb', line 340

def valid?
  return false if @assessed_images.nil?
  return false if @assessed_images_count.nil?
  return false if @cid.nil?
  return false if @cluster_name.nil?
  return false if @containers_impacted.nil?
  return false if @containers_impacted_count.nil?
  return false if @detect_timestamp.nil?
  return false if @detections_count.nil?
  return false if @first_seen.nil?
  return false if @host_id.nil?
  return false if @image_assessment_detections_count.nil?
  return false if @last_seen.nil?
  return false if @namespace.nil?
  return false if @node_name.nil?
  return false if @pod_id.nil?
  return false if @pod_name.nil?
  return false if @runtime_detections_count.nil?
  return false if @severity.nil?
  return false if @unassessed_images.nil?
  return false if @unassessed_images_count.nil?
  return false if @visible_to_k8s.nil?
  true
end