Class: Falcon::ModelsAPIDriftIndicators

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ModelsAPIDriftIndicators

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 160

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.key?(:'parent_process_id')
    self.parent_process_id = attributes[:'parent_process_id']
  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?(:'prevented')
    self.prevented = attributes[:'prevented']
  end

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

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

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

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

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

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

Instance Attribute Details

#agent_idObject

Returns the value of attribute agent_id.



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

def agent_id
  @agent_id
end

#aidObject

Returns the value of attribute aid.



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

def aid
  @aid
end

#cidObject

Returns the value of attribute cid.



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

def cid
  @cid
end

#cloud_nameObject

Returns the value of attribute cloud_name.



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

def cloud_name
  @cloud_name
end

#command_lineObject

Returns the value of attribute command_line.



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

def command_line
  @command_line
end

#computer_nameObject

Returns the value of attribute computer_name.



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

def computer_name
  @computer_name
end

#container_idObject

Returns the value of attribute container_id.



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

def container_id
  @container_id
end

#detection_descriptionObject

Returns the value of attribute detection_description.



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

def detection_description
  @detection_description
end

#detection_idObject

Returns the value of attribute detection_id.



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

def detection_id
  @detection_id
end

#detection_nameObject

Returns the value of attribute detection_name.



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

def detection_name
  @detection_name
end

#file_nameObject

Returns the value of attribute file_name.



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

def file_name
  @file_name
end

#host_idObject

Returns the value of attribute host_id.



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

def host_id
  @host_id
end

#indicator_process_idObject

Returns the value of attribute indicator_process_id.



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

def indicator_process_id
  @indicator_process_id
end

#namespaceObject

Returns the value of attribute namespace.



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

def namespace
  @namespace
end

#occurred_atObject

Returns the value of attribute occurred_at.



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

def occurred_at
  @occurred_at
end

#parent_process_idObject

Returns the value of attribute parent_process_id.



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

def parent_process_id
  @parent_process_id
end

#pod_idObject

Returns the value of attribute pod_id.



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

def pod_id
  @pod_id
end

#pod_nameObject

Returns the value of attribute pod_name.



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

def pod_name
  @pod_name
end

#preventedObject

Returns the value of attribute prevented.



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

def prevented
  @prevented
end

#prevention_statusObject

Returns the value of attribute prevention_status.



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

def prevention_status
  @prevention_status
end

#prevention_status_stringObject

Returns the value of attribute prevention_status_string.



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

def prevention_status_string
  @prevention_status_string
end

#scheduler_nameObject

Returns the value of attribute scheduler_name.



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

def scheduler_name
  @scheduler_name
end

#severityObject

Returns the value of attribute severity.



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

def severity
  @severity
end

#sha256Object

Returns the value of attribute sha256.



81
82
83
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 81

def sha256
  @sha256
end

#timestampObject

Returns the value of attribute timestamp.



83
84
85
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 83

def timestamp
  @timestamp
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



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

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 86

def self.attribute_map
  {
    :'agent_id' => :'agent_id',
    :'aid' => :'aid',
    :'cid' => :'cid',
    :'cloud_name' => :'cloud_name',
    :'command_line' => :'command_line',
    :'computer_name' => :'computer_name',
    :'container_id' => :'container_id',
    :'detection_description' => :'detection_description',
    :'detection_id' => :'detection_id',
    :'detection_name' => :'detection_name',
    :'file_name' => :'file_name',
    :'host_id' => :'host_id',
    :'indicator_process_id' => :'indicator_process_id',
    :'namespace' => :'namespace',
    :'occurred_at' => :'occurred_at',
    :'parent_process_id' => :'parent_process_id',
    :'pod_id' => :'pod_id',
    :'pod_name' => :'pod_name',
    :'prevented' => :'prevented',
    :'prevention_status' => :'prevention_status',
    :'prevention_status_string' => :'prevention_status_string',
    :'scheduler_name' => :'scheduler_name',
    :'severity' => :'severity',
    :'sha256' => :'sha256',
    :'timestamp' => :'timestamp'
  }
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



461
462
463
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 461

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

.openapi_nullableObject

List of attributes with nullable: true



153
154
155
156
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 153

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

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'agent_id' => :'String',
    :'aid' => :'String',
    :'cid' => :'String',
    :'cloud_name' => :'String',
    :'command_line' => :'String',
    :'computer_name' => :'String',
    :'container_id' => :'String',
    :'detection_description' => :'String',
    :'detection_id' => :'String',
    :'detection_name' => :'String',
    :'file_name' => :'String',
    :'host_id' => :'String',
    :'indicator_process_id' => :'String',
    :'namespace' => :'String',
    :'occurred_at' => :'String',
    :'parent_process_id' => :'String',
    :'pod_id' => :'String',
    :'pod_name' => :'String',
    :'prevented' => :'Boolean',
    :'prevention_status' => :'Array<String>',
    :'prevention_status_string' => :'String',
    :'scheduler_name' => :'String',
    :'severity' => :'String',
    :'sha256' => :'String',
    :'timestamp' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 416

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      agent_id == o.agent_id &&
      aid == o.aid &&
      cid == o.cid &&
      cloud_name == o.cloud_name &&
      command_line == o.command_line &&
      computer_name == o.computer_name &&
      container_id == o.container_id &&
      detection_description == o.detection_description &&
      detection_id == o.detection_id &&
      detection_name == o.detection_name &&
      file_name == o.file_name &&
      host_id == o.host_id &&
      indicator_process_id == o.indicator_process_id &&
      namespace == o.namespace &&
      occurred_at == o.occurred_at &&
      parent_process_id == o.parent_process_id &&
      pod_id == o.pod_id &&
      pod_name == o.pod_name &&
      prevented == o.prevented &&
      prevention_status == o.prevention_status &&
      prevention_status_string == o.prevention_status_string &&
      scheduler_name == o.scheduler_name &&
      severity == o.severity &&
      sha256 == o.sha256 &&
      timestamp == o.timestamp
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



492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 492

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



563
564
565
566
567
568
569
570
571
572
573
574
575
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 563

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



468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 468

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


448
449
450
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 448

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



454
455
456
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 454

def hash
  [agent_id, aid, cid, cloud_name, command_line, computer_name, container_id, detection_description, detection_id, detection_name, file_name, host_id, indicator_process_id, namespace, occurred_at, parent_process_id, pod_id, pod_name, prevented, prevention_status, prevention_status_string, scheduler_name, severity, sha256, timestamp].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 278

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



539
540
541
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 539

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



545
546
547
548
549
550
551
552
553
554
555
556
557
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 545

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



533
534
535
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 533

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



385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/crimson-falcon/models/models_api_drift_indicators.rb', line 385

def valid?
  return false if @agent_id.nil?
  return false if @aid.nil?
  return false if @cid.nil?
  return false if @cloud_name.nil?
  return false if @command_line.nil?
  return false if @computer_name.nil?
  return false if @container_id.nil?
  return false if @detection_description.nil?
  return false if @detection_id.nil?
  return false if @detection_name.nil?
  return false if @file_name.nil?
  return false if @host_id.nil?
  return false if @indicator_process_id.nil?
  return false if @namespace.nil?
  return false if @occurred_at.nil?
  return false if @parent_process_id.nil?
  return false if @pod_id.nil?
  return false if @pod_name.nil?
  return false if @prevented.nil?
  return false if @prevention_status.nil?
  return false if @prevention_status_string.nil?
  return false if @scheduler_name.nil?
  return false if @severity.nil?
  return false if @sha256.nil?
  return false if @timestamp.nil?
  true
end