Class: Falcon::PolicymanagerExternalClassificationProperties
- Inherits:
-
Object
- Object
- Falcon::PolicymanagerExternalClassificationProperties
- Defined in:
- lib/crimson-falcon/models/policymanager_external_classification_properties.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#content_patterns ⇒ Object
Returns the value of attribute content_patterns.
-
#content_patterns_operator ⇒ Object
ContentPatternsOperator accepts values: ‘or’, ‘and’.
-
#evidence_duplication_enabled ⇒ Object
Warning: Disabling evidence duplication will also disable forensic screen capture in all the rules.
-
#file_types ⇒ Object
Returns the value of attribute file_types.
-
#mac_file_path_patterns ⇒ Object
File path pattern globs for mac.
-
#protection_mode ⇒ Object
Protection mode accepts values: ‘monitor’, ‘simulate’, ‘enforce’.
-
#rules ⇒ Object
Returns the value of attribute rules.
-
#sensitivity_labels ⇒ Object
Returns the value of attribute sensitivity_labels.
-
#web_sources ⇒ Object
Returns the value of attribute web_sources.
-
#win_file_path_patterns ⇒ Object
File path pattern globs for windows.
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 = {}) ⇒ PolicymanagerExternalClassificationProperties
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 = {}) ⇒ PolicymanagerExternalClassificationProperties
Initializes the object
126 127 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 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 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 126 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::PolicymanagerExternalClassificationProperties` 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::PolicymanagerExternalClassificationProperties`. 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?(:'content_patterns') if (value = attributes[:'content_patterns']).is_a?(Array) self.content_patterns = value end end if attributes.key?(:'content_patterns_operator') self.content_patterns_operator = attributes[:'content_patterns_operator'] end if attributes.key?(:'evidence_duplication_enabled') self.evidence_duplication_enabled = attributes[:'evidence_duplication_enabled'] end if attributes.key?(:'file_types') if (value = attributes[:'file_types']).is_a?(Array) self.file_types = value end end if attributes.key?(:'mac_file_path_patterns') if (value = attributes[:'mac_file_path_patterns']).is_a?(Array) self.mac_file_path_patterns = value end end if attributes.key?(:'protection_mode') self.protection_mode = attributes[:'protection_mode'] end if attributes.key?(:'rules') if (value = attributes[:'rules']).is_a?(Array) self.rules = value end end if attributes.key?(:'sensitivity_labels') if (value = attributes[:'sensitivity_labels']).is_a?(Array) self.sensitivity_labels = value end end if attributes.key?(:'web_sources') if (value = attributes[:'web_sources']).is_a?(Array) self.web_sources = value end end if attributes.key?(:'win_file_path_patterns') if (value = attributes[:'win_file_path_patterns']).is_a?(Array) self.win_file_path_patterns = value end end end |
Instance Attribute Details
#content_patterns ⇒ Object
Returns the value of attribute content_patterns.
34 35 36 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 34 def content_patterns @content_patterns end |
#content_patterns_operator ⇒ Object
ContentPatternsOperator accepts values: ‘or’, ‘and’
37 38 39 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 37 def content_patterns_operator @content_patterns_operator end |
#evidence_duplication_enabled ⇒ Object
Warning: Disabling evidence duplication will also disable forensic screen capture in all the rules
40 41 42 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 40 def evidence_duplication_enabled @evidence_duplication_enabled end |
#file_types ⇒ Object
Returns the value of attribute file_types.
42 43 44 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 42 def file_types @file_types end |
#mac_file_path_patterns ⇒ Object
File path pattern globs for mac
45 46 47 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 45 def mac_file_path_patterns @mac_file_path_patterns end |
#protection_mode ⇒ Object
Protection mode accepts values: ‘monitor’, ‘simulate’, ‘enforce’
48 49 50 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 48 def protection_mode @protection_mode end |
#rules ⇒ Object
Returns the value of attribute rules.
50 51 52 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 50 def rules @rules end |
#sensitivity_labels ⇒ Object
Returns the value of attribute sensitivity_labels.
52 53 54 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 52 def sensitivity_labels @sensitivity_labels end |
#web_sources ⇒ Object
Returns the value of attribute web_sources.
54 55 56 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 54 def web_sources @web_sources end |
#win_file_path_patterns ⇒ Object
File path pattern globs for windows
57 58 59 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 57 def win_file_path_patterns @win_file_path_patterns end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
98 99 100 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 98 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 82 def self.attribute_map { :'content_patterns' => :'content_patterns', :'content_patterns_operator' => :'content_patterns_operator', :'evidence_duplication_enabled' => :'evidence_duplication_enabled', :'file_types' => :'file_types', :'mac_file_path_patterns' => :'mac_file_path_patterns', :'protection_mode' => :'protection_mode', :'rules' => :'rules', :'sensitivity_labels' => :'sensitivity_labels', :'web_sources' => :'web_sources', :'win_file_path_patterns' => :'win_file_path_patterns' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
263 264 265 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 263 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
119 120 121 122 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 119 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 103 def self.openapi_types { :'content_patterns' => :'Array<String>', :'content_patterns_operator' => :'String', :'evidence_duplication_enabled' => :'Boolean', :'file_types' => :'Array<String>', :'mac_file_path_patterns' => :'Array<String>', :'protection_mode' => :'String', :'rules' => :'Array<PolicymanagerExternalRule>', :'sensitivity_labels' => :'Array<String>', :'web_sources' => :'Array<String>', :'win_file_path_patterns' => :'Array<String>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 233 def ==(o) return true if self.equal?(o) self.class == o.class && content_patterns == o.content_patterns && content_patterns_operator == o.content_patterns_operator && evidence_duplication_enabled == o.evidence_duplication_enabled && file_types == o.file_types && mac_file_path_patterns == o.mac_file_path_patterns && protection_mode == o.protection_mode && rules == o.rules && sensitivity_labels == o.sensitivity_labels && web_sources == o.web_sources && win_file_path_patterns == o.win_file_path_patterns end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 294 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
365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 365 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
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 270 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
250 251 252 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 250 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
256 257 258 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 256 def hash [content_patterns, content_patterns_operator, evidence_duplication_enabled, file_types, mac_file_path_patterns, protection_mode, rules, sensitivity_labels, web_sources, win_file_path_patterns].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
196 197 198 199 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 196 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
341 342 343 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 341 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
347 348 349 350 351 352 353 354 355 356 357 358 359 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 347 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
335 336 337 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 335 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
203 204 205 206 207 208 209 |
# File 'lib/crimson-falcon/models/policymanager_external_classification_properties.rb', line 203 def valid? content_patterns_operator_validator = EnumAttributeValidator.new('String', ["or", "and"]) return false unless content_patterns_operator_validator.valid?(@content_patterns_operator) protection_mode_validator = EnumAttributeValidator.new('String', ["monitor", "simulate", "enforce"]) return false unless protection_mode_validator.valid?(@protection_mode) true end |