Class: TalonOne::RiskDetail
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- TalonOne::RiskDetail
- Defined in:
- lib/talon_one_sdk/models/risk_detail.rb
Overview
Details of a risk, including its most severely affected entities.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#activity ⇒ Object
The activity metric the risk was detected in.
-
#affected_entities ⇒ Object
The affected entities with the highest severity ratios, in descending order.
-
#affected_entity_count ⇒ Object
The total number of entities affected by this risk.
-
#application_id ⇒ Object
The ID of the Application this risk belongs to.
-
#created ⇒ Object
The time this entity was created.
-
#criticality ⇒ Object
The critical classification bucket of this risk.
-
#description ⇒ Object
Human-readable description of the detected anomaly.
-
#entity ⇒ Object
The entity type the risk was detected in.
-
#group_key ⇒ Object
The Application group this risk was detected in.
-
#id ⇒ Object
The internal ID of this entity.
-
#modified ⇒ Object
Timestamp of the most recent update.
-
#notification_id ⇒ Object
The ID of the risk notification rule that flagged this risk.
-
#reported_date ⇒ Object
The time the ML service reported this risk.
-
#run_date ⇒ Object
The date of the ML pipeline run that detected this risk.
-
#status ⇒ Object
The triage lifecycle status of this risk.
-
#time_frame ⇒ Object
The rolling time window of the risk evaluation.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.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_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3).
-
.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.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ RiskDetail
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ RiskDetail
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 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 158 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::RiskDetail` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::RiskDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'created') self.created = attributes[:'created'] else self.created = nil end if attributes.key?(:'notification_id') self.notification_id = attributes[:'notification_id'] else self.notification_id = nil end if attributes.key?(:'run_date') self.run_date = attributes[:'run_date'] else self.run_date = nil end if attributes.key?(:'group_key') self.group_key = attributes[:'group_key'] else self.group_key = nil end if attributes.key?(:'application_id') self.application_id = attributes[:'application_id'] end if attributes.key?(:'status') self.status = attributes[:'status'] else self.status = nil end if attributes.key?(:'criticality') self.criticality = attributes[:'criticality'] else self.criticality = nil end if attributes.key?(:'entity') self.entity = attributes[:'entity'] else self.entity = nil end if attributes.key?(:'activity') self.activity = attributes[:'activity'] else self.activity = nil end if attributes.key?(:'time_frame') self.time_frame = attributes[:'time_frame'] else self.time_frame = nil end if attributes.key?(:'reported_date') self.reported_date = attributes[:'reported_date'] else self.reported_date = nil end if attributes.key?(:'affected_entity_count') self.affected_entity_count = attributes[:'affected_entity_count'] else self.affected_entity_count = nil end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'modified') self.modified = attributes[:'modified'] else self.modified = nil end if attributes.key?(:'affected_entities') if (value = attributes[:'affected_entities']).is_a?(Array) self.affected_entities = value end else self.affected_entities = nil end end |
Instance Attribute Details
#activity ⇒ Object
The activity metric the risk was detected in.
47 48 49 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 47 def activity @activity end |
#affected_entities ⇒ Object
The affected entities with the highest severity ratios, in descending order.
65 66 67 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 65 def affected_entities @affected_entities end |
#affected_entity_count ⇒ Object
The total number of entities affected by this risk.
56 57 58 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 56 def affected_entity_count @affected_entity_count end |
#application_id ⇒ Object
The ID of the Application this risk belongs to. Absent for global metrics.
35 36 37 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 35 def application_id @application_id end |
#created ⇒ Object
The time this entity was created.
23 24 25 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 23 def created @created end |
#criticality ⇒ Object
The critical classification bucket of this risk.
41 42 43 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 41 def criticality @criticality end |
#description ⇒ Object
Human-readable description of the detected anomaly.
59 60 61 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 59 def description @description end |
#entity ⇒ Object
The entity type the risk was detected in.
44 45 46 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 44 def entity @entity end |
#group_key ⇒ Object
The Application group this risk was detected in. Contains the Application ID, or ‘__GLOBAL__` for metrics that are not grouped by Application.
32 33 34 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 32 def group_key @group_key end |
#id ⇒ Object
The internal ID of this entity.
20 21 22 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 20 def id @id end |
#modified ⇒ Object
Timestamp of the most recent update.
62 63 64 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 62 def modified @modified end |
#notification_id ⇒ Object
The ID of the risk notification rule that flagged this risk.
26 27 28 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 26 def notification_id @notification_id end |
#reported_date ⇒ Object
The time the ML service reported this risk.
53 54 55 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 53 def reported_date @reported_date end |
#run_date ⇒ Object
The date of the ML pipeline run that detected this risk.
29 30 31 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 29 def run_date @run_date end |
#status ⇒ Object
The triage lifecycle status of this risk.
38 39 40 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 38 def status @status end |
#time_frame ⇒ Object
The rolling time window of the risk evaluation.
50 51 52 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 50 def time_frame @time_frame end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
112 113 114 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 112 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
117 118 119 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 117 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 90 def self.attribute_map { :'id' => :'id', :'created' => :'created', :'notification_id' => :'notificationId', :'run_date' => :'runDate', :'group_key' => :'groupKey', :'application_id' => :'applicationId', :'status' => :'status', :'criticality' => :'criticality', :'entity' => :'entity', :'activity' => :'activity', :'time_frame' => :'timeFrame', :'reported_date' => :'reportedDate', :'affected_entity_count' => :'affectedEntityCount', :'description' => :'description', :'modified' => :'modified', :'affected_entities' => :'affectedEntities' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 540 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{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[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3)
150 151 152 153 154 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 150 def self.openapi_all_of [ :'Risk' ] end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
144 145 146 147 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 144 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 122 def self.openapi_types { :'id' => :'Integer', :'created' => :'Time', :'notification_id' => :'Integer', :'run_date' => :'Date', :'group_key' => :'String', :'application_id' => :'Integer', :'status' => :'String', :'criticality' => :'String', :'entity' => :'String', :'activity' => :'String', :'time_frame' => :'String', :'reported_date' => :'Time', :'affected_entity_count' => :'Integer', :'description' => :'String', :'modified' => :'Time', :'affected_entities' => :'Array<RiskAffectedEntityItem>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 504 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && created == o.created && notification_id == o.notification_id && run_date == o.run_date && group_key == o.group_key && application_id == o.application_id && status == o.status && criticality == o.criticality && entity == o.entity && activity == o.activity && time_frame == o.time_frame && reported_date == o.reported_date && affected_entity_count == o.affected_entity_count && description == o.description && modified == o.modified && affected_entities == o.affected_entities end |
#eql?(o) ⇒ Boolean
527 528 529 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 527 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
533 534 535 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 533 def hash [id, created, notification_id, run_date, group_key, application_id, status, criticality, entity, activity, time_frame, reported_date, affected_entity_count, description, modified, affected_entities].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 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 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 269 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @created.nil? invalid_properties.push('invalid value for "created", created cannot be nil.') end if @notification_id.nil? invalid_properties.push('invalid value for "notification_id", notification_id cannot be nil.') end if @run_date.nil? invalid_properties.push('invalid value for "run_date", run_date cannot be nil.') end if @group_key.nil? invalid_properties.push('invalid value for "group_key", group_key cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @criticality.nil? invalid_properties.push('invalid value for "criticality", criticality cannot be nil.') end if @entity.nil? invalid_properties.push('invalid value for "entity", entity cannot be nil.') end if @activity.nil? invalid_properties.push('invalid value for "activity", activity cannot be nil.') end if @time_frame.nil? invalid_properties.push('invalid value for "time_frame", time_frame cannot be nil.') end if @reported_date.nil? invalid_properties.push('invalid value for "reported_date", reported_date cannot be nil.') end if @affected_entity_count.nil? invalid_properties.push('invalid value for "affected_entity_count", affected_entity_count cannot be nil.') end if @modified.nil? invalid_properties.push('invalid value for "modified", modified cannot be nil.') end if @affected_entities.nil? invalid_properties.push('invalid value for "affected_entities", affected_entities cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
562 563 564 565 566 567 568 569 570 571 572 573 574 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 562 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 |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
# File 'lib/talon_one_sdk/models/risk_detail.rb', line 333 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @created.nil? return false if @notification_id.nil? return false if @run_date.nil? return false if @group_key.nil? return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["active", "in_review", "confirmed", "discarded"]) return false unless status_validator.valid?(@status) return false if @criticality.nil? criticality_validator = EnumAttributeValidator.new('String', ["critical", "not_critical"]) return false unless criticality_validator.valid?(@criticality) return false if @entity.nil? entity_validator = EnumAttributeValidator.new('String', ["customer_profile", "customer_session"]) return false unless entity_validator.valid?(@entity) return false if @activity.nil? activity_validator = EnumAttributeValidator.new('String', ["loyalty_points_earned", "discounted_amount", "completed_orders", "coupon_attempts"]) return false unless activity_validator.valid?(@activity) return false if @time_frame.nil? time_frame_validator = EnumAttributeValidator.new('String', ["1_day", "1_week", "1_month"]) return false unless time_frame_validator.valid?(@time_frame) return false if @reported_date.nil? return false if @affected_entity_count.nil? return false if @modified.nil? return false if @affected_entities.nil? true end |