class

PlaceOS::Model::AiCorrelationFinding

Inherits PlaceOS::Model::ModelBase < PlaceOS::Model::Associations < Neuroplastic < PgORM::Base < PgORM::Validators < PgORM::Table < PgORM::Persistence < PgORM::Associations < ActiveModel::Callbacks < ActiveModel::Validation < ActiveModel::Model < DB::Mappable < DB::Serializable < YAML::Serializable < JSON::Serializable < Reference < Object

Constants

CALLBACKS = { before_save: [] of Nil, after_save: [] of Nil, before_create: [] of Nil, after_create: [] of Nil, before_update: [] of Nil, after_update: [] of Nil, before_destroy: [] of Nil, after_destroy: [] of Nil, }
Log = ::Log.for(self)
PRIMARY_KEY_TYPES = {:id => (String | Nil)} of Nil => Nil

macro level key => type

PRIMARY_KEYS = [{:id}]

Constructors

from_json(string_or_io : String | IO, trusted : Bool = false) : self
from_json(string_or_io : String | IO, root : String, trusted : Bool = false) : self

Deserializes the given JSON in string_or_io into an instance of self, assuming the JSON consists of an JSON object with key root, and whose value is the value to deserialize. Will not deserialise from fields with mass_assign: false

class User < ActiveModel::Model
  attribute name : String
  attribute google_id : UUID, mass_assign: false
end

User.from_json(%({"main": {"name": "Jason", "google_id": "f6f70bfb-c882-446d-8758-7ce47db39620"}}), root: "main") # => #<User:0x103131b20 @name="Jason">
from_trusted_json(string_or_io : String | IO, root : String) : self
from_trusted_json(string_or_io : String | IO) : self

Serialize from a trusted JSON source

from_trusted_yaml(string_or_io : String | IO) : self

Serialize from a trusted YAML source

from_yaml(string_or_io : String | IO, trusted : Bool = false) : self
new(rs : DB::ResultSet)
new(deduplication_key : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, kind : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, policy_id : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, policy_version : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, policy_hash : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, scope_key : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, tenant_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, system_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, module_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, classification : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, incident_ids_json : JSON::Any | ActiveModel::Model::None = ::ActiveModel::Model::None.new, observation_count : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, transition_count : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, window_start : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, window_end : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, summary : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, detected_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new)

Initialize PlaceOS::Model::AiCorrelationFinding from HTTP::Params.

Class methods

attributes

Returns all attribute keys.

changes(id : String | Nil | Nil = nil) : ChangeFeed

Changefeed at row (if id passed) or whole table level. Returns a ChangeFeed instance which can be used to invoke async callbacks via on or use blocking Iterator via each method.

elastic
from_rs(__temp_1594 : DB::ResultSet)
on_error(err : Exception | IO::Error)
primary_key

Base class for all Engine models

Source
table_name

Instance methods

after_create

Base class for all Engine models

after_destroy

Base class for all Engine models

after_initialize(trusted : Bool)
after_save

Base class for all Engine models

after_update

Base class for all Engine models

apply_defaults

Generate code to apply default values

assign_attributes(deduplication_key : String | Missing = Missing, kind : String | Missing = Missing, policy_id : String | Missing = Missing, policy_version : Int32 | Missing = Missing, policy_hash : String | Missing = Missing, scope_key : String | Missing = Missing, tenant_id : String | Nil | Missing = Missing, system_id : String | Nil | Missing = Missing, module_id : String | Nil | Missing = Missing, classification : String | Missing = Missing, incident_ids_json : JSON::Any | Missing = Missing, observation_count : Int32 | Missing = Missing, transition_count : Int32 | Missing = Missing, window_start : Time | Missing = Missing, window_end : Time | Missing = Missing, summary : String | Missing = Missing, detected_at : Time | Missing = Missing, id : String | Nil | Missing = Missing)

Assign to multiple attributes.

assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String))

Assign to multiple attributes via HTTP::Params.

assign_attributes(model : PlaceOS::Model::AiCorrelationFinding)

Assign to multiple attributes from a model object

assign_attributes_from_json(json, root : String)
assign_attributes_from_json(json)
assign_attributes_from_trusted_json(json, root : String)
assign_attributes_from_trusted_json(json)

Assign each field from JSON if field exists in JSON and has changed in model

assign_attributes_from_trusted_yaml(yaml)
assign_attributes_from_yaml(yaml)

Uses the YAML parser as JSON is valid YAML

attributes

Returns a Hash of all attribute values

attributes_tuple

Returns a NamedTuple of all attribute values.

before_create

Base class for all Engine models

before_destroy

Base class for all Engine models

before_save

Base class for all Engine models

before_update

Base class for all Engine models

changed?

Check if any attributes have changed.

changed_attributes

Returns a Hash with all changed attributes.

changed_json(io : IO) : Nil

Serialize the set of changed attributes to JSON.

changed_json

Serialize the set of changed attributes to JSON.

changed_persist_attributes
changed_yaml(io : IO) : Nil

Serialize the set of changed attributes to YAML.

changed_yaml

Serialize the set of changed attributes to YAML.

classification

classification getter

classification=(value : String)

classification setter

classification?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

classification_assigned?
classification_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

classification_changed?
classification_default

classification's default value

Source
classification_present?
classification_removed?
classification_was
classification_will_change!

Include classification in the set of changed attributes, whether it has changed or not.

clear_changes_information

Reset changes for all attributes.

deduplication_key

deduplication_key getter

deduplication_key=(value : String)

Setters deduplication_key setter

deduplication_key?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

deduplication_key_assigned?
deduplication_key_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

deduplication_key_changed?
deduplication_key_default

deduplication_key's default value

Source
deduplication_key_present?
deduplication_key_removed?
deduplication_key_was
deduplication_key_will_change!

Include deduplication_key in the set of changed attributes, whether it has changed or not.

detected_at

detected_at getter

detected_at=(value : Time)

detected_at setter

detected_at?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

detected_at_assigned?
detected_at_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

detected_at_changed?
detected_at_default

detected_at's default value

Source
detected_at_present?
detected_at_removed?
detected_at_was
detected_at_will_change!

Include detected_at in the set of changed attributes, whether it has changed or not.

id

id getter

id=(value : String | Nil)

id setter

id?
id_assigned?
id_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

id_changed?
id_default

id's default value

id_present?
id_removed?
id_was
id_will_change!

Include id in the set of changed attributes, whether it has changed or not.

incident_ids_json

incident_ids_json getter

incident_ids_json=(value : JSON::Any)

incident_ids_json setter

incident_ids_json?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

incident_ids_json_assigned?
incident_ids_json_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

incident_ids_json_changed?
incident_ids_json_default

incident_ids_json's default value

Source
incident_ids_json_present?
incident_ids_json_removed?
incident_ids_json_was
incident_ids_json_will_change!

Include incident_ids_json in the set of changed attributes, whether it has changed or not.

invoke_props

Base class for all Engine models

kind

kind getter

kind=(value : String)

kind setter

kind?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

kind_assigned?
kind_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

kind_changed?
kind_default

kind's default value

Source
kind_present?
kind_removed?
kind_was
kind_will_change!

Include kind in the set of changed attributes, whether it has changed or not.

module_id

module_id getter

module_id=(value : String | Nil)

module_id setter

module_id_assigned?
module_id_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

module_id_changed?
module_id_default

module_id's default value

Source
module_id_present?
module_id_removed?
module_id_was
module_id_will_change!

Include module_id in the set of changed attributes, whether it has changed or not.

observation_count

observation_count getter

observation_count=(value : Int32)

observation_count setter

observation_count?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

observation_count_assigned?
observation_count_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

observation_count_changed?
observation_count_default

observation_count's default value

Source
observation_count_present?
observation_count_removed?
observation_count_was
observation_count_will_change!

Include observation_count in the set of changed attributes, whether it has changed or not.

persistent_attributes

Returns a Hash of all attributes that can be persisted.

policy_hash

policy_hash getter

policy_hash=(value : String)

policy_hash setter

policy_hash?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

policy_hash_assigned?
policy_hash_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

policy_hash_changed?
policy_hash_default

policy_hash's default value

Source
policy_hash_present?
policy_hash_removed?
policy_hash_was
policy_hash_will_change!

Include policy_hash in the set of changed attributes, whether it has changed or not.

policy_id

policy_id getter

policy_id=(value : String)

policy_id setter

policy_id?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

policy_id_assigned?
policy_id_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

policy_id_changed?
policy_id_default

policy_id's default value

Source
policy_id_present?
policy_id_removed?
policy_id_was
policy_id_will_change!

Include policy_id in the set of changed attributes, whether it has changed or not.

policy_version

policy_version getter

policy_version=(value : Int32)

policy_version setter

policy_version?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

policy_version_assigned?
policy_version_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

policy_version_changed?
policy_version_default

policy_version's default value

Source
policy_version_present?
policy_version_removed?
policy_version_was
policy_version_will_change!

Include policy_version in the set of changed attributes, whether it has changed or not.

primary_key

Base class for all Engine models

Source
primary_key_hash
restore_attributes

Reset each attribute to their previous values and clears all changes.

scope_key

scope_key getter

scope_key=(value : String)

scope_key setter

scope_key?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

scope_key_assigned?
scope_key_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

scope_key_changed?
scope_key_default

scope_key's default value

Source
scope_key_present?
scope_key_removed?
scope_key_was
scope_key_will_change!

Include scope_key in the set of changed attributes, whether it has changed or not.

summary

summary getter

summary=(value : String)

summary setter

summary?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

summary_assigned?
summary_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

summary_changed?
summary_default

summary's default value

Source
summary_present?
summary_removed?
summary_was
summary_will_change!

Include summary in the set of changed attributes, whether it has changed or not.

system_id

system_id getter

system_id=(value : String | Nil)

system_id setter

system_id_assigned?
system_id_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

system_id_changed?
system_id_default

system_id's default value

Source
system_id_present?
system_id_removed?
system_id_was
system_id_will_change!

Include system_id in the set of changed attributes, whether it has changed or not.

table_name
tenant_id

tenant_id getter

tenant_id=(value : String | Nil)

tenant_id setter

tenant_id_assigned?
tenant_id_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

tenant_id_changed?
tenant_id_default

tenant_id's default value

Source
tenant_id_present?
tenant_id_removed?
tenant_id_was
tenant_id_will_change!

Include tenant_id in the set of changed attributes, whether it has changed or not.

transition_count

transition_count getter

transition_count=(value : Int32)

transition_count setter

transition_count?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

transition_count_assigned?
transition_count_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

transition_count_changed?
transition_count_default

transition_count's default value

Source
transition_count_present?
transition_count_removed?
transition_count_was
transition_count_will_change!

Include transition_count in the set of changed attributes, whether it has changed or not.

validate_nilability

Validate that all non-nillable fields have values.

window_end

window_end getter

window_end=(value : Time)

window_end setter

window_end?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

window_end_assigned?
window_end_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

window_end_changed?
window_end_default

window_end's default value

Source
window_end_present?
window_end_removed?
window_end_was
window_end_will_change!

Include window_end in the set of changed attributes, whether it has changed or not.

window_start

window_start getter

window_start=(value : Time)

window_start setter

window_start?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

window_start_assigned?
window_start_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

window_start_changed?
window_start_default

window_start's default value

Source
window_start_present?
window_start_removed?
window_start_was
window_start_will_change!

Include window_start in the set of changed attributes, whether it has changed or not.

Nested types