Class: Falcon::DomainScanRunConfig
- Inherits:
-
Object
- Object
- Falcon::DomainScanRunConfig
- Defined in:
- lib/crimson-falcon/models/domain_scan_run_config.rb
Overview
Represents configurations to use for one time scan run
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#additional_tcp_ports ⇒ Object
The set of additional TCP ports.
-
#additional_udp_ports ⇒ Object
The set of additional UDP ports.
-
#auto_include_new_detections ⇒ Object
Indicates whether to include new released detections automatically.
-
#detections ⇒ Object
The detections to use for the scan.
-
#fragile_device_detection ⇒ Object
Indicates whether fragile device detection is enabled or not.
-
#ignore_tcp_resets ⇒ Object
Indicates whether or not to ignore TCP resets.
-
#ports_scan_level ⇒ Object
Port level selection.
-
#scan_exclusion ⇒ Object
Returns the value of attribute scan_exclusion.
-
#scan_intensity ⇒ Object
The scan intensity.
-
#target_asset ⇒ Object
Returns the value of attribute target_asset.
-
#target_asset_filter ⇒ Object
Returns the value of attribute target_asset_filter.
-
#target_asset_vuln ⇒ Object
Returns the value of attribute target_asset_vuln.
-
#target_external_ip ⇒ Object
Returns the value of attribute target_external_ip.
-
#target_ip ⇒ Object
Returns the value of attribute target_ip.
-
#target_type ⇒ Object
Target type specification.
-
#type ⇒ Object
The scan type.
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 = {}) ⇒ DomainScanRunConfig
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 = {}) ⇒ DomainScanRunConfig
Initializes the object
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 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 156 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::DomainScanRunConfig` 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::DomainScanRunConfig`. 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?(:'additional_tcp_ports') if (value = attributes[:'additional_tcp_ports']).is_a?(Array) self.additional_tcp_ports = value end end if attributes.key?(:'additional_udp_ports') if (value = attributes[:'additional_udp_ports']).is_a?(Array) self.additional_udp_ports = value end end if attributes.key?(:'auto_include_new_detections') self.auto_include_new_detections = attributes[:'auto_include_new_detections'] end if attributes.key?(:'detections') if (value = attributes[:'detections']).is_a?(Array) self.detections = value end end if attributes.key?(:'fragile_device_detection') self.fragile_device_detection = attributes[:'fragile_device_detection'] end if attributes.key?(:'ignore_tcp_resets') self.ignore_tcp_resets = attributes[:'ignore_tcp_resets'] end if attributes.key?(:'ports_scan_level') self.ports_scan_level = attributes[:'ports_scan_level'] end if attributes.key?(:'scan_exclusion') self.scan_exclusion = attributes[:'scan_exclusion'] end if attributes.key?(:'scan_intensity') self.scan_intensity = attributes[:'scan_intensity'] end if attributes.key?(:'target_asset') self.target_asset = attributes[:'target_asset'] end if attributes.key?(:'target_asset_filter') self.target_asset_filter = attributes[:'target_asset_filter'] end if attributes.key?(:'target_asset_vuln') self.target_asset_vuln = attributes[:'target_asset_vuln'] end if attributes.key?(:'target_external_ip') self.target_external_ip = attributes[:'target_external_ip'] end if attributes.key?(:'target_ip') self.target_ip = attributes[:'target_ip'] end if attributes.key?(:'target_type') self.target_type = attributes[:'target_type'] end if attributes.key?(:'type') self.type = attributes[:'type'] end end |
Instance Attribute Details
#additional_tcp_ports ⇒ Object
The set of additional TCP ports
36 37 38 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 36 def additional_tcp_ports @additional_tcp_ports end |
#additional_udp_ports ⇒ Object
The set of additional UDP ports
39 40 41 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 39 def additional_udp_ports @additional_udp_ports end |
#auto_include_new_detections ⇒ Object
Indicates whether to include new released detections automatically
42 43 44 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 42 def auto_include_new_detections @auto_include_new_detections end |
#detections ⇒ Object
The detections to use for the scan
45 46 47 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 45 def detections @detections end |
#fragile_device_detection ⇒ Object
Indicates whether fragile device detection is enabled or not
48 49 50 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 48 def fragile_device_detection @fragile_device_detection end |
#ignore_tcp_resets ⇒ Object
Indicates whether or not to ignore TCP resets
51 52 53 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 51 def ignore_tcp_resets @ignore_tcp_resets end |
#ports_scan_level ⇒ Object
Port level selection
54 55 56 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 54 def ports_scan_level @ports_scan_level end |
#scan_exclusion ⇒ Object
Returns the value of attribute scan_exclusion.
56 57 58 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 56 def scan_exclusion @scan_exclusion end |
#scan_intensity ⇒ Object
The scan intensity
59 60 61 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 59 def scan_intensity @scan_intensity end |
#target_asset ⇒ Object
Returns the value of attribute target_asset.
61 62 63 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 61 def target_asset @target_asset end |
#target_asset_filter ⇒ Object
Returns the value of attribute target_asset_filter.
63 64 65 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 63 def target_asset_filter @target_asset_filter end |
#target_asset_vuln ⇒ Object
Returns the value of attribute target_asset_vuln.
65 66 67 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 65 def target_asset_vuln @target_asset_vuln end |
#target_external_ip ⇒ Object
Returns the value of attribute target_external_ip.
67 68 69 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 67 def target_external_ip @target_external_ip end |
#target_ip ⇒ Object
Returns the value of attribute target_ip.
69 70 71 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 69 def target_ip @target_ip end |
#target_type ⇒ Object
Target type specification. Each value must have its corresponding object configured - target_ip/target_asset/target_asset_vuln/target_asset_filter
72 73 74 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 72 def target_type @target_type end |
#type ⇒ Object
The scan type
75 76 77 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 75 def type @type end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
122 123 124 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 122 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 100 def self.attribute_map { :'additional_tcp_ports' => :'additional_tcp_ports', :'additional_udp_ports' => :'additional_udp_ports', :'auto_include_new_detections' => :'auto_include_new_detections', :'detections' => :'detections', :'fragile_device_detection' => :'fragile_device_detection', :'ignore_tcp_resets' => :'ignore_tcp_resets', :'ports_scan_level' => :'ports_scan_level', :'scan_exclusion' => :'scan_exclusion', :'scan_intensity' => :'scan_intensity', :'target_asset' => :'target_asset', :'target_asset_filter' => :'target_asset_filter', :'target_asset_vuln' => :'target_asset_vuln', :'target_external_ip' => :'target_external_ip', :'target_ip' => :'target_ip', :'target_type' => :'target_type', :'type' => :'type' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
359 360 361 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 359 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
149 150 151 152 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 149 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 127 def self.openapi_types { :'additional_tcp_ports' => :'Array<String>', :'additional_udp_ports' => :'Array<String>', :'auto_include_new_detections' => :'Boolean', :'detections' => :'Array<String>', :'fragile_device_detection' => :'Boolean', :'ignore_tcp_resets' => :'Boolean', :'ports_scan_level' => :'String', :'scan_exclusion' => :'DomainScanExclusion', :'scan_intensity' => :'String', :'target_asset' => :'DomainTargetAsset', :'target_asset_filter' => :'DomainTargetAssetFilter', :'target_asset_vuln' => :'DomainTargetAssetVulnerability', :'target_external_ip' => :'DomainTargetExternalIP', :'target_ip' => :'DomainTargetIP', :'target_type' => :'String', :'type' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 323 def ==(o) return true if self.equal?(o) self.class == o.class && additional_tcp_ports == o.additional_tcp_ports && additional_udp_ports == o.additional_udp_ports && auto_include_new_detections == o.auto_include_new_detections && detections == o.detections && fragile_device_detection == o.fragile_device_detection && ignore_tcp_resets == o.ignore_tcp_resets && ports_scan_level == o.ports_scan_level && scan_exclusion == o.scan_exclusion && scan_intensity == o.scan_intensity && target_asset == o.target_asset && target_asset_filter == o.target_asset_filter && target_asset_vuln == o.target_asset_vuln && target_external_ip == o.target_external_ip && target_ip == o.target_ip && target_type == o.target_type && type == o.type end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 421 422 423 424 425 426 427 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 390 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
461 462 463 464 465 466 467 468 469 470 471 472 473 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 461 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
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 366 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
346 347 348 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 346 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
352 353 354 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 352 def hash [additional_tcp_ports, additional_udp_ports, auto_include_new_detections, detections, fragile_device_detection, ignore_tcp_resets, ports_scan_level, scan_exclusion, scan_intensity, target_asset, target_asset_filter, target_asset_vuln, target_external_ip, target_ip, target_type, type].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 242 def list_invalid_properties invalid_properties = Array.new if @ports_scan_level.nil? invalid_properties.push('invalid value for "ports_scan_level", ports_scan_level cannot be nil.') end if @scan_intensity.nil? invalid_properties.push('invalid value for "scan_intensity", scan_intensity cannot be nil.') end if @target_type.nil? invalid_properties.push('invalid value for "target_type", target_type cannot be nil.') end if @type.nil? invalid_properties.push('invalid value for "type", type cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
437 438 439 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 437 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
443 444 445 446 447 448 449 450 451 452 453 454 455 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 443 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
431 432 433 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 431 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/crimson-falcon/models/domain_scan_run_config.rb', line 265 def valid? return false if @ports_scan_level.nil? ports_scan_level_validator = EnumAttributeValidator.new('String', ["default,all_ports,custom"]) return false unless ports_scan_level_validator.valid?(@ports_scan_level) return false if @scan_intensity.nil? scan_intensity_validator = EnumAttributeValidator.new('String', ["basic,standard,cautious,maximum"]) return false unless scan_intensity_validator.valid?(@scan_intensity) return false if @target_type.nil? target_type_validator = EnumAttributeValidator.new('String', ["ip,asset,asset_filter,asset_vuln,external_ip"]) return false unless target_type_validator.valid?(@target_type) return false if @type.nil? type_validator = EnumAttributeValidator.new('String', ["discovery,assessment"]) return false unless type_validator.valid?(@type) true end |