Class: Falcon::FigapiLookupIndicator
- Inherits:
-
Object
- Object
- Falcon::FigapiLookupIndicator
- Defined in:
- lib/crimson-falcon/models/figapi_lookup_indicator.rb
Instance Attribute Summary collapse
-
#adversaries ⇒ Object
Returns the value of attribute adversaries.
-
#affected_customers ⇒ Object
Total range of customers affected by this indicator.
-
#certificates ⇒ Object
Returns the value of attribute certificates.
-
#countries ⇒ Object
Returns the value of attribute countries.
-
#domain_details ⇒ Object
Returns the value of attribute domain_details.
-
#file_details ⇒ Object
Returns the value of attribute file_details.
-
#first_seen ⇒ Object
Indicators first seen.
-
#id ⇒ Object
The indicator ID.
-
#ipv4_details ⇒ Object
Returns the value of attribute ipv4_details.
-
#ipv6_details ⇒ Object
Returns the value of attribute ipv6_details.
-
#kill_chain ⇒ Object
Multi field property describing indicators kill-chain, possible properties: ‘ActionOnObjectives`, `C2`, `Delivery`, `Exploitation`, `Installation`, `Reconnaissance`, `Weaponization`.
-
#last_seen ⇒ Object
Indicators last seen.
-
#last_updated ⇒ Object
Returns the value of attribute last_updated.
-
#lookup_value ⇒ Object
The value matched to this indicator.
-
#malicious_confidence ⇒ Object
Indicates a confidence level by which an indicator is considered to be malicious, this can be one of: ‘Low`, `Medium`, `High`.
-
#malicious_confidence_validated_time ⇒ Object
Indicates when was the confidence was last set.
-
#publish_date ⇒ Object
Returns the value of attribute publish_date.
-
#reports ⇒ Object
Returns the value of attribute reports.
-
#sectors ⇒ Object
Returns the value of attribute sectors.
-
#threat_types ⇒ Object
Returns the value of attribute threat_types.
-
#threats ⇒ Object
Returns the value of attribute threats.
-
#type ⇒ Object
Type of the indicator, this can be one of: ‘File`, `Domain`, `IPv4`, `IPv6`, `URL`.
-
#url_details ⇒ Object
Returns the value of attribute url_details.
-
#vulnerabilities ⇒ Object
Returns the value of attribute vulnerabilities.
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 = {}) ⇒ FigapiLookupIndicator
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 = {}) ⇒ FigapiLookupIndicator
Initializes the object
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 285 286 287 288 289 290 291 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 165 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::FigapiLookupIndicator` 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::FigapiLookupIndicator`. 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?(:'affected_customers') self.affected_customers = attributes[:'affected_customers'] end if attributes.key?(:'certificates') if (value = attributes[:'certificates']).is_a?(Array) self.certificates = value end end if attributes.key?(:'countries') if (value = attributes[:'countries']).is_a?(Array) self.countries = value end end if attributes.key?(:'domain_details') self.domain_details = attributes[:'domain_details'] end if attributes.key?(:'file_details') self.file_details = attributes[:'file_details'] end if attributes.key?(:'first_seen') self.first_seen = attributes[:'first_seen'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'ipv4_details') self.ipv4_details = attributes[:'ipv4_details'] end if attributes.key?(:'ipv6_details') self.ipv6_details = attributes[:'ipv6_details'] end if attributes.key?(:'kill_chain') if (value = attributes[:'kill_chain']).is_a?(Array) self.kill_chain = value end end if attributes.key?(:'last_seen') self.last_seen = attributes[:'last_seen'] end if attributes.key?(:'last_updated') self.last_updated = attributes[:'last_updated'] end if attributes.key?(:'lookup_value') self.lookup_value = attributes[:'lookup_value'] end if attributes.key?(:'malicious_confidence') self.malicious_confidence = attributes[:'malicious_confidence'] end if attributes.key?(:'malicious_confidence_validated_time') self.malicious_confidence_validated_time = attributes[:'malicious_confidence_validated_time'] end if attributes.key?(:'publish_date') self.publish_date = attributes[:'publish_date'] end if attributes.key?(:'reports') if (value = attributes[:'reports']).is_a?(Array) self.reports = value end end if attributes.key?(:'sectors') if (value = attributes[:'sectors']).is_a?(Array) self.sectors = value end end if attributes.key?(:'threat_types') if (value = attributes[:'threat_types']).is_a?(Array) self.threat_types = value end end if attributes.key?(:'threats') if (value = attributes[:'threats']).is_a?(Array) self.threats = value end end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'url_details') self.url_details = attributes[:'url_details'] end if attributes.key?(:'vulnerabilities') if (value = attributes[:'vulnerabilities']).is_a?(Array) self.vulnerabilities = value end end end |
Instance Attribute Details
#adversaries ⇒ Object
Returns the value of attribute adversaries.
35 36 37 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 35 def adversaries @adversaries end |
#affected_customers ⇒ Object
Total range of customers affected by this indicator
38 39 40 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 38 def affected_customers @affected_customers end |
#certificates ⇒ Object
Returns the value of attribute certificates.
40 41 42 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 40 def certificates @certificates end |
#countries ⇒ Object
Returns the value of attribute countries.
42 43 44 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 42 def countries @countries end |
#domain_details ⇒ Object
Returns the value of attribute domain_details.
44 45 46 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 44 def domain_details @domain_details end |
#file_details ⇒ Object
Returns the value of attribute file_details.
46 47 48 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 46 def file_details @file_details end |
#first_seen ⇒ Object
Indicators first seen
49 50 51 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 49 def first_seen @first_seen end |
#id ⇒ Object
The indicator ID. Concatenation of type and indicator fields. Based on the CKB2 vertex ID.
52 53 54 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 52 def id @id end |
#ipv4_details ⇒ Object
Returns the value of attribute ipv4_details.
54 55 56 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 54 def ipv4_details @ipv4_details end |
#ipv6_details ⇒ Object
Returns the value of attribute ipv6_details.
56 57 58 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 56 def ipv6_details @ipv6_details end |
#kill_chain ⇒ Object
Multi field property describing indicators kill-chain, possible properties: ‘ActionOnObjectives`, `C2`, `Delivery`, `Exploitation`, `Installation`, `Reconnaissance`, `Weaponization`
59 60 61 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 59 def kill_chain @kill_chain end |
#last_seen ⇒ Object
Indicators last seen
62 63 64 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 62 def last_seen @last_seen end |
#last_updated ⇒ Object
Returns the value of attribute last_updated.
64 65 66 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 64 def last_updated @last_updated end |
#lookup_value ⇒ Object
The value matched to this indicator
67 68 69 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 67 def lookup_value @lookup_value end |
#malicious_confidence ⇒ Object
Indicates a confidence level by which an indicator is considered to be malicious, this can be one of: ‘Low`, `Medium`, `High`
70 71 72 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 70 def malicious_confidence @malicious_confidence end |
#malicious_confidence_validated_time ⇒ Object
Indicates when was the confidence was last set
73 74 75 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 73 def malicious_confidence_validated_time @malicious_confidence_validated_time end |
#publish_date ⇒ Object
Returns the value of attribute publish_date.
75 76 77 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 75 def publish_date @publish_date end |
#reports ⇒ Object
Returns the value of attribute reports.
77 78 79 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 77 def reports @reports end |
#sectors ⇒ Object
Returns the value of attribute sectors.
79 80 81 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 79 def sectors @sectors end |
#threat_types ⇒ Object
Returns the value of attribute threat_types.
81 82 83 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 81 def threat_types @threat_types end |
#threats ⇒ Object
Returns the value of attribute threats.
83 84 85 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 83 def threats @threats end |
#type ⇒ Object
Type of the indicator, this can be one of: ‘File`, `Domain`, `IPv4`, `IPv6`, `URL`
86 87 88 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 86 def type @type end |
#url_details ⇒ Object
Returns the value of attribute url_details.
88 89 90 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 88 def url_details @url_details end |
#vulnerabilities ⇒ Object
Returns the value of attribute vulnerabilities.
90 91 92 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 90 def vulnerabilities @vulnerabilities end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
123 124 125 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 123 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
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 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 93 def self.attribute_map { :'adversaries' => :'Adversaries', :'affected_customers' => :'AffectedCustomers', :'certificates' => :'Certificates', :'countries' => :'Countries', :'domain_details' => :'DomainDetails', :'file_details' => :'FileDetails', :'first_seen' => :'FirstSeen', :'id' => :'ID', :'ipv4_details' => :'IPv4Details', :'ipv6_details' => :'IPv6Details', :'kill_chain' => :'KillChain', :'last_seen' => :'LastSeen', :'last_updated' => :'LastUpdated', :'lookup_value' => :'LookupValue', :'malicious_confidence' => :'MaliciousConfidence', :'malicious_confidence_validated_time' => :'MaliciousConfidenceValidatedTime', :'publish_date' => :'PublishDate', :'reports' => :'Reports', :'sectors' => :'Sectors', :'threat_types' => :'ThreatTypes', :'threats' => :'Threats', :'type' => :'Type', :'url_details' => :'URLDetails', :'vulnerabilities' => :'Vulnerabilities' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
352 353 354 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 352 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
158 159 160 161 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 158 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
128 129 130 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 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 128 def self.openapi_types { :'adversaries' => :'Array<FigapiAdversary>', :'affected_customers' => :'String', :'certificates' => :'Array<FigapiX509Certificate>', :'countries' => :'Array<FigapiCountry>', :'domain_details' => :'FigapiDomain', :'file_details' => :'FigapiFile', :'first_seen' => :'String', :'id' => :'String', :'ipv4_details' => :'FigapiIPv4', :'ipv6_details' => :'FigapiIPv6', :'kill_chain' => :'Array<String>', :'last_seen' => :'String', :'last_updated' => :'String', :'lookup_value' => :'String', :'malicious_confidence' => :'String', :'malicious_confidence_validated_time' => :'String', :'publish_date' => :'String', :'reports' => :'Array<FigapiReport>', :'sectors' => :'Array<FigapiSector>', :'threat_types' => :'Array<String>', :'threats' => :'Array<FigapiThreat>', :'type' => :'String', :'url_details' => :'FigapiURL', :'vulnerabilities' => :'Array<FigapiVulnerability>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
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/figapi_lookup_indicator.rb', line 308 def ==(o) return true if self.equal?(o) self.class == o.class && adversaries == o.adversaries && affected_customers == o.affected_customers && certificates == o.certificates && countries == o.countries && domain_details == o.domain_details && file_details == o.file_details && first_seen == o.first_seen && id == o.id && ipv4_details == o.ipv4_details && ipv6_details == o.ipv6_details && kill_chain == o.kill_chain && last_seen == o.last_seen && last_updated == o.last_updated && lookup_value == o.lookup_value && malicious_confidence == o.malicious_confidence && malicious_confidence_validated_time == o.malicious_confidence_validated_time && publish_date == o.publish_date && reports == o.reports && sectors == o.sectors && threat_types == o.threat_types && threats == o.threats && type == o.type && url_details == o.url_details && vulnerabilities == o.vulnerabilities end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
383 384 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 413 414 415 416 417 418 419 420 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 383 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
454 455 456 457 458 459 460 461 462 463 464 465 466 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 454 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
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 359 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
339 340 341 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 339 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
345 346 347 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 345 def hash [adversaries, affected_customers, certificates, countries, domain_details, file_details, first_seen, id, ipv4_details, ipv6_details, kill_chain, last_seen, last_updated, lookup_value, malicious_confidence, malicious_confidence_validated_time, publish_date, reports, sectors, threat_types, threats, type, url_details, vulnerabilities].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
295 296 297 298 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 295 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
430 431 432 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 430 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
436 437 438 439 440 441 442 443 444 445 446 447 448 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 436 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
424 425 426 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 424 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
302 303 304 |
# File 'lib/crimson-falcon/models/figapi_lookup_indicator.rb', line 302 def valid? true end |