Class: Falcon::ApiIntelligenceQueryEntity
- Inherits:
-
Object
- Object
- Falcon::ApiIntelligenceQueryEntity
- Defined in:
- lib/crimson-falcon/models/api_intelligence_query_entity.rb
Instance Attribute Summary collapse
-
#adversaries ⇒ Object
Returns the value of attribute adversaries.
-
#content ⇒ Object
Returns the value of attribute content.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#depends_on ⇒ Object
Returns the value of attribute depends_on.
-
#description ⇒ Object
Returns the value of attribute description.
-
#elite_analyst_notes ⇒ Object
Field only available for Counter Adversary Elite Customers.
-
#elite_query_explainer ⇒ Object
Field only available for Counter Adversary Elite Customers.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#has_elite_analyst_notes ⇒ Object
Returns the value of attribute has_elite_analyst_notes.
-
#has_elite_query_explainer ⇒ Object
Returns the value of attribute has_elite_query_explainer.
-
#id ⇒ Object
Returns the value of attribute id.
-
#kill_chain ⇒ Object
Returns the value of attribute kill_chain.
-
#language ⇒ Object
Returns the value of attribute language.
-
#last_updated_at ⇒ Object
Returns the value of attribute last_updated_at.
-
#malware_families ⇒ Object
Returns the value of attribute malware_families.
-
#mitre_technique_ids ⇒ Object
Returns the value of attribute mitre_technique_ids.
-
#name ⇒ Object
Returns the value of attribute name.
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#relates_to_community_alias ⇒ Object
Returns the value of attribute relates_to_community_alias.
-
#reports ⇒ Object
Returns the value of attribute reports.
-
#reports_count ⇒ Object
Returns the value of attribute reports_count.
-
#subscriptions ⇒ Object
Returns the value of attribute subscriptions.
-
#type ⇒ Object
Returns the value of attribute type.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ApiIntelligenceQueryEntity
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ ApiIntelligenceQueryEntity
Initializes the object
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 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 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 158 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::ApiIntelligenceQueryEntity` 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::ApiIntelligenceQueryEntity`. 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_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?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'version') self.version = attributes[:'version'] end end |
Instance Attribute Details
#adversaries ⇒ Object
Returns the value of attribute adversaries.
35 36 37 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 35 def adversaries @adversaries end |
#content ⇒ Object
Returns the value of attribute content.
37 38 39 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 37 def content @content end |
#created_at ⇒ Object
Returns the value of attribute created_at.
39 40 41 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 39 def created_at @created_at end |
#depends_on ⇒ Object
Returns the value of attribute depends_on.
41 42 43 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 41 def depends_on @depends_on end |
#description ⇒ Object
Returns the value of attribute description.
43 44 45 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 43 def description @description end |
#elite_analyst_notes ⇒ Object
Field only available for Counter Adversary Elite Customers
46 47 48 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 46 def elite_analyst_notes @elite_analyst_notes end |
#elite_query_explainer ⇒ Object
Field only available for Counter Adversary Elite Customers
49 50 51 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 49 def elite_query_explainer @elite_query_explainer end |
#environment ⇒ Object
Returns the value of attribute environment.
51 52 53 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 51 def environment @environment end |
#has_elite_analyst_notes ⇒ Object
Returns the value of attribute has_elite_analyst_notes.
53 54 55 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 53 def has_elite_analyst_notes @has_elite_analyst_notes end |
#has_elite_query_explainer ⇒ Object
Returns the value of attribute has_elite_query_explainer.
55 56 57 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 55 def has_elite_query_explainer @has_elite_query_explainer end |
#id ⇒ Object
Returns the value of attribute id.
57 58 59 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 57 def id @id end |
#kill_chain ⇒ Object
Returns the value of attribute kill_chain.
59 60 61 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 59 def kill_chain @kill_chain end |
#language ⇒ Object
Returns the value of attribute language.
61 62 63 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 61 def language @language end |
#last_updated_at ⇒ Object
Returns the value of attribute last_updated_at.
63 64 65 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 63 def last_updated_at @last_updated_at end |
#malware_families ⇒ Object
Returns the value of attribute malware_families.
65 66 67 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 65 def malware_families @malware_families end |
#mitre_technique_ids ⇒ Object
Returns the value of attribute mitre_technique_ids.
67 68 69 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 67 def mitre_technique_ids @mitre_technique_ids end |
#name ⇒ Object
Returns the value of attribute name.
69 70 71 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 69 def name @name end |
#provider ⇒ Object
Returns the value of attribute provider.
71 72 73 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 71 def provider @provider end |
#relates_to_community_alias ⇒ Object
Returns the value of attribute relates_to_community_alias.
73 74 75 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 73 def relates_to_community_alias @relates_to_community_alias end |
#reports ⇒ Object
Returns the value of attribute reports.
75 76 77 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 75 def reports @reports end |
#reports_count ⇒ Object
Returns the value of attribute reports_count.
77 78 79 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 77 def reports_count @reports_count end |
#subscriptions ⇒ Object
Returns the value of attribute subscriptions.
79 80 81 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 79 def subscriptions @subscriptions end |
#type ⇒ Object
Returns the value of attribute type.
81 82 83 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 81 def type @type end |
#version ⇒ Object
Returns the value of attribute version.
83 84 85 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 83 def version @version end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
116 117 118 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 116 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
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 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 86 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_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', :'type' => :'type', :'version' => :'version' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
400 401 402 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 400 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
151 152 153 154 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 151 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
121 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 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 121 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_technique_ids' => :'Array<String>', :'name' => :'String', :'provider' => :'String', :'relates_to_community_alias' => :'Array<String>', :'reports' => :'Array<String>', :'reports_count' => :'Integer', :'subscriptions' => :'Array<String>', :'type' => :'String', :'version' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
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 382 383 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 356 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_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 && type == o.type && version == o.version end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
431 432 433 434 435 436 437 438 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 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 431 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
502 503 504 505 506 507 508 509 510 511 512 513 514 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 502 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
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 407 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
387 388 389 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 387 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
393 394 395 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 393 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_technique_ids, name, provider, relates_to_community_alias, reports, reports_count, subscriptions, type, version].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 288 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_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
478 479 480 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 478 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
484 485 486 487 488 489 490 491 492 493 494 495 496 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 484 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_s ⇒ String
Returns the string representation of the object
472 473 474 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 472 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/crimson-falcon/models/api_intelligence_query_entity.rb', line 339 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 |