Class: Falcon::SadomainRule
- Inherits:
-
Object
- Object
- Falcon::SadomainRule
- Defined in:
- lib/crimson-falcon/models/sadomain_rule.rb
Instance Attribute Summary collapse
-
#breach_monitoring_enabled ⇒ Object
Whether to monitor for breach data.
-
#cid ⇒ Object
Returns the value of attribute cid.
-
#created_timestamp ⇒ Object
The creation time for a given rule.
-
#filter ⇒ Object
The FQL filter contained in a rule and used for searching.
-
#id ⇒ Object
The ID of a given rule.
-
#name ⇒ Object
The name of a given rule.
-
#ownership_assets ⇒ Object
Returns the value of attribute ownership_assets.
-
#permissions ⇒ Object
The permissions of a given rule.
-
#priority ⇒ Object
The priority of a given rule.
-
#status ⇒ Object
The status of a given rule.
-
#status_message ⇒ Object
The detailed status message of a given rule.
-
#substring_matching_enabled ⇒ Object
Whether to monitor for substring matches.
-
#topic ⇒ Object
The topic of a given rule.
-
#updated_timestamp ⇒ Object
The last updated time for a given rule.
-
#user_id ⇒ Object
The user ID of the user that created a given rule.
-
#user_name ⇒ Object
The user name of the user that created a given rule.
-
#user_uuid ⇒ Object
The UUID of the user that created a given rule.
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 = {}) ⇒ SadomainRule
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 = {}) ⇒ SadomainRule
Initializes the object
143 144 145 146 147 148 149 150 151 152 153 154 155 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 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 143 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::SadomainRule` 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::SadomainRule`. 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?(:'breach_monitoring_enabled') self.breach_monitoring_enabled = attributes[:'breach_monitoring_enabled'] end if attributes.key?(:'cid') self.cid = attributes[:'cid'] end if attributes.key?(:'created_timestamp') self. = attributes[:'created_timestamp'] end if attributes.key?(:'filter') self.filter = attributes[:'filter'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'ownership_assets') self.ownership_assets = attributes[:'ownership_assets'] end if attributes.key?(:'permissions') self. = attributes[:'permissions'] end if attributes.key?(:'priority') self.priority = attributes[:'priority'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'status_message') self. = attributes[:'status_message'] end if attributes.key?(:'substring_matching_enabled') self.substring_matching_enabled = attributes[:'substring_matching_enabled'] end if attributes.key?(:'topic') self.topic = attributes[:'topic'] end if attributes.key?(:'updated_timestamp') self. = attributes[:'updated_timestamp'] end if attributes.key?(:'user_id') self.user_id = attributes[:'user_id'] end if attributes.key?(:'user_name') self.user_name = attributes[:'user_name'] end if attributes.key?(:'user_uuid') self.user_uuid = attributes[:'user_uuid'] end end |
Instance Attribute Details
#breach_monitoring_enabled ⇒ Object
Whether to monitor for breach data. Available only for ‘Company Domains` and `Email addresses` rule topics. When enabled, ownership of the monitored domains or emails is required
36 37 38 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 36 def breach_monitoring_enabled @breach_monitoring_enabled end |
#cid ⇒ Object
Returns the value of attribute cid.
38 39 40 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 38 def cid @cid end |
#created_timestamp ⇒ Object
The creation time for a given rule
41 42 43 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 41 def @created_timestamp end |
#filter ⇒ Object
The FQL filter contained in a rule and used for searching. Parentheses may be added automatically for clarity
44 45 46 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 44 def filter @filter end |
#id ⇒ Object
The ID of a given rule
47 48 49 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 47 def id @id end |
#name ⇒ Object
The name of a given rule
50 51 52 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 50 def name @name end |
#ownership_assets ⇒ Object
Returns the value of attribute ownership_assets.
52 53 54 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 52 def ownership_assets @ownership_assets end |
#permissions ⇒ Object
The permissions of a given rule
55 56 57 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 55 def @permissions end |
#priority ⇒ Object
The priority of a given rule
58 59 60 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 58 def priority @priority end |
#status ⇒ Object
The status of a given rule
61 62 63 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 61 def status @status end |
#status_message ⇒ Object
The detailed status message of a given rule
64 65 66 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 64 def @status_message end |
#substring_matching_enabled ⇒ Object
Whether to monitor for substring matches. Only available for the ‘Typosquatting` rule topic
67 68 69 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 67 def substring_matching_enabled @substring_matching_enabled end |
#topic ⇒ Object
The topic of a given rule
70 71 72 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 70 def topic @topic end |
#updated_timestamp ⇒ Object
The last updated time for a given rule
73 74 75 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 73 def @updated_timestamp end |
#user_id ⇒ Object
The user ID of the user that created a given rule
76 77 78 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 76 def user_id @user_id end |
#user_name ⇒ Object
The user name of the user that created a given rule
79 80 81 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 79 def user_name @user_name end |
#user_uuid ⇒ Object
The UUID of the user that created a given rule
82 83 84 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 82 def user_uuid @user_uuid end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
108 109 110 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 108 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 85 def self.attribute_map { :'breach_monitoring_enabled' => :'breach_monitoring_enabled', :'cid' => :'cid', :'created_timestamp' => :'created_timestamp', :'filter' => :'filter', :'id' => :'id', :'name' => :'name', :'ownership_assets' => :'ownership_assets', :'permissions' => :'permissions', :'priority' => :'priority', :'status' => :'status', :'status_message' => :'status_message', :'substring_matching_enabled' => :'substring_matching_enabled', :'topic' => :'topic', :'updated_timestamp' => :'updated_timestamp', :'user_id' => :'user_id', :'user_name' => :'user_name', :'user_uuid' => :'user_uuid' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
342 343 344 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 342 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
136 137 138 139 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 136 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 113 def self.openapi_types { :'breach_monitoring_enabled' => :'Boolean', :'cid' => :'String', :'created_timestamp' => :'Time', :'filter' => :'String', :'id' => :'String', :'name' => :'String', :'ownership_assets' => :'SadomainCustomerAssets', :'permissions' => :'String', :'priority' => :'String', :'status' => :'String', :'status_message' => :'String', :'substring_matching_enabled' => :'Boolean', :'topic' => :'String', :'updated_timestamp' => :'Time', :'user_id' => :'String', :'user_name' => :'String', :'user_uuid' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 305 def ==(o) return true if self.equal?(o) self.class == o.class && breach_monitoring_enabled == o.breach_monitoring_enabled && cid == o.cid && == o. && filter == o.filter && id == o.id && name == o.name && ownership_assets == o.ownership_assets && == o. && priority == o.priority && status == o.status && == o. && substring_matching_enabled == o.substring_matching_enabled && topic == o.topic && == o. && user_id == o.user_id && user_name == o.user_name && user_uuid == o.user_uuid end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
373 374 375 376 377 378 379 380 381 382 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 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 373 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
444 445 446 447 448 449 450 451 452 453 454 455 456 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 444 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
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 349 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
329 330 331 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 329 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
335 336 337 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 335 def hash [breach_monitoring_enabled, cid, , filter, id, name, ownership_assets, , priority, status, , substring_matching_enabled, topic, , user_id, user_name, user_uuid].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 227 def list_invalid_properties invalid_properties = Array.new if @breach_monitoring_enabled.nil? invalid_properties.push('invalid value for "breach_monitoring_enabled", breach_monitoring_enabled cannot be nil.') end if @cid.nil? invalid_properties.push('invalid value for "cid", cid cannot be nil.') end if @created_timestamp.nil? invalid_properties.push('invalid value for "created_timestamp", created_timestamp cannot be nil.') end if @filter.nil? invalid_properties.push('invalid value for "filter", filter cannot be nil.') end if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @permissions.nil? invalid_properties.push('invalid value for "permissions", permissions cannot be nil.') end if @priority.nil? invalid_properties.push('invalid value for "priority", priority cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @substring_matching_enabled.nil? invalid_properties.push('invalid value for "substring_matching_enabled", substring_matching_enabled cannot be nil.') end if @topic.nil? invalid_properties.push('invalid value for "topic", topic cannot be nil.') end if @updated_timestamp.nil? invalid_properties.push('invalid value for "updated_timestamp", updated_timestamp cannot be nil.') end if @user_uuid.nil? invalid_properties.push('invalid value for "user_uuid", user_uuid cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
420 421 422 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 420 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
426 427 428 429 430 431 432 433 434 435 436 437 438 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 426 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
414 415 416 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 414 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 286 def valid? return false if @breach_monitoring_enabled.nil? return false if @cid.nil? return false if @created_timestamp.nil? return false if @filter.nil? return false if @id.nil? return false if @name.nil? return false if @permissions.nil? return false if @priority.nil? return false if @status.nil? return false if @substring_matching_enabled.nil? return false if @topic.nil? return false if @updated_timestamp.nil? return false if @user_uuid.nil? true end |