Class: Falcon::CaohuntingapiIntelligenceQueryEntity

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CaohuntingapiIntelligenceQueryEntity

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#adversariesObject

Returns the value of attribute adversaries.



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

def adversaries
  @adversaries
end

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

#created_atObject

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#depends_onObject

Returns the value of attribute depends_on.



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

def depends_on
  @depends_on
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#elite_analyst_notesObject

Field only available for Counter Adversary Elite Customers



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

def elite_analyst_notes
  @elite_analyst_notes
end

#elite_query_explainerObject

Field only available for Counter Adversary Elite Customers



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

def elite_query_explainer
  @elite_query_explainer
end

#environmentObject

Returns the value of attribute environment.



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

def environment
  @environment
end

#has_elite_analyst_notesObject

Returns the value of attribute has_elite_analyst_notes.



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

def has_elite_analyst_notes
  @has_elite_analyst_notes
end

#has_elite_query_explainerObject

Returns the value of attribute has_elite_query_explainer.



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

def has_elite_query_explainer
  @has_elite_query_explainer
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#kill_chainObject

Returns the value of attribute kill_chain.



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

def kill_chain
  @kill_chain
end

#languageObject

Returns the value of attribute language.



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

def language
  @language
end

#last_updated_atObject

Returns the value of attribute last_updated_at.



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

def last_updated_at
  @last_updated_at
end

#malware_familiesObject

Returns the value of attribute malware_families.



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

def malware_families
  @malware_families
end

#mitreObject

Returns the value of attribute mitre.



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

def mitre
  @mitre
end

#mitre_technique_idsObject

Returns the value of attribute mitre_technique_ids.



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

def mitre_technique_ids
  @mitre_technique_ids
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#providerObject

Returns the value of attribute provider.



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

def provider
  @provider
end

#relates_to_community_aliasObject

Returns the value of attribute relates_to_community_alias.



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

def relates_to_community_alias
  @relates_to_community_alias
end

#reportsObject

Returns the value of attribute reports.



76
77
78
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 76

def reports
  @reports
end

#reports_countObject

Returns the value of attribute reports_count.



78
79
80
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 78

def reports_count
  @reports_count
end

#subscriptionsObject

Returns the value of attribute subscriptions.



80
81
82
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 80

def subscriptions
  @subscriptions
end

#translated_languagesObject

Field that returns all the available AI Translations Target Languages for a query



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

def translated_languages
  @translated_languages
end

#translationsObject

Optional field that would be filled only if specifically requested via the include_translated_content queryParam



86
87
88
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 86

def translations
  @translations
end

#typeObject

Returns the value of attribute type.



88
89
90
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 88

def type
  @type
end

#versionObject

Returns the value of attribute version.



90
91
92
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 90

def version
  @version
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



126
127
128
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 126

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 93

def self.attribute_map
  {
    :'adversaries' => :'adversaries',
    :'content' => :'content',
    :'created_at' => :'created_at',
    :'depends_on' => :'depends_on',
    :'description' => :'description',
    :'elite_analyst_notes' => :'elite_analyst_notes',
    :'elite_query_explainer' => :'elite_query_explainer',
    :'environment' => :'environment',
    :'has_elite_analyst_notes' => :'has_elite_analyst_notes',
    :'has_elite_query_explainer' => :'has_elite_query_explainer',
    :'id' => :'id',
    :'kill_chain' => :'kill_chain',
    :'language' => :'language',
    :'last_updated_at' => :'last_updated_at',
    :'malware_families' => :'malware_families',
    :'mitre' => :'mitre',
    :'mitre_technique_ids' => :'mitre_technique_ids',
    :'name' => :'name',
    :'provider' => :'provider',
    :'relates_to_community_alias' => :'relates_to_community_alias',
    :'reports' => :'reports',
    :'reports_count' => :'reports_count',
    :'subscriptions' => :'subscriptions',
    :'translated_languages' => :'translated_languages',
    :'translations' => :'translations',
    :'type' => :'type',
    :'version' => :'version'
  }
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



434
435
436
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 434

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

.openapi_nullableObject

List of attributes with nullable: true



164
165
166
167
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 164

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

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'adversaries' => :'Array<String>',
    :'content' => :'String',
    :'created_at' => :'Time',
    :'depends_on' => :'Array<String>',
    :'description' => :'String',
    :'elite_analyst_notes' => :'String',
    :'elite_query_explainer' => :'String',
    :'environment' => :'Array<String>',
    :'has_elite_analyst_notes' => :'Boolean',
    :'has_elite_query_explainer' => :'Boolean',
    :'id' => :'String',
    :'kill_chain' => :'Array<String>',
    :'language' => :'String',
    :'last_updated_at' => :'Time',
    :'malware_families' => :'Array<String>',
    :'mitre' => :'Array<CaohuntingapiMitreData>',
    :'mitre_technique_ids' => :'Array<String>',
    :'name' => :'String',
    :'provider' => :'String',
    :'relates_to_community_alias' => :'Array<String>',
    :'reports' => :'Array<String>',
    :'reports_count' => :'Integer',
    :'subscriptions' => :'Array<String>',
    :'translated_languages' => :'Array<String>',
    :'translations' => :'Array<CaohuntingapiTranslation>',
    :'type' => :'String',
    :'version' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
413
414
415
416
417
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 387

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      adversaries == o.adversaries &&
      content == o.content &&
      created_at == o.created_at &&
      depends_on == o.depends_on &&
      description == o.description &&
      elite_analyst_notes == o.elite_analyst_notes &&
      elite_query_explainer == o.elite_query_explainer &&
      environment == o.environment &&
      has_elite_analyst_notes == o.has_elite_analyst_notes &&
      has_elite_query_explainer == o.has_elite_query_explainer &&
      id == o.id &&
      kill_chain == o.kill_chain &&
      language == o.language &&
      last_updated_at == o.last_updated_at &&
      malware_families == o.malware_families &&
      mitre == o.mitre &&
      mitre_technique_ids == o.mitre_technique_ids &&
      name == o.name &&
      provider == o.provider &&
      relates_to_community_alias == o.relates_to_community_alias &&
      reports == o.reports &&
      reports_count == o.reports_count &&
      subscriptions == o.subscriptions &&
      translated_languages == o.translated_languages &&
      translations == o.translations &&
      type == o.type &&
      version == o.version
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



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
490
491
492
493
494
495
496
497
498
499
500
501
502
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 465

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



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

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



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

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


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

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



427
428
429
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 427

def hash
  [adversaries, content, created_at, depends_on, description, elite_analyst_notes, elite_query_explainer, environment, has_elite_analyst_notes, has_elite_query_explainer, id, kill_chain, language, last_updated_at, malware_families, mitre, mitre_technique_ids, name, provider, relates_to_community_alias, reports, reports_count, subscriptions, translated_languages, translations, type, version].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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

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

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

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

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

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

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

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

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

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

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

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



512
513
514
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 512

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



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

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



506
507
508
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 506

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



370
371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/crimson-falcon/models/caohuntingapi_intelligence_query_entity.rb', line 370

def valid?
  return false if @created_at.nil?
  return false if @has_elite_analyst_notes.nil?
  return false if @has_elite_query_explainer.nil?
  return false if @id.nil?
  return false if @language.nil?
  return false if @last_updated_at.nil?
  return false if @name.nil?
  return false if @provider.nil?
  return false if @reports_count.nil?
  return false if @type.nil?
  return false if @version.nil?
  true
end