class

PlaceOS::Model::AiEscalationRecord

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(incident_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, procedure_id : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, procedure_version : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, procedure_hash : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, owner_queue : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, response_sla_minutes : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, reason : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, required_artefacts_json : JSON::Any | ActiveModel::Model::None = ::ActiveModel::Model::None.new, delivery_status : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, delivery_destination : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, delivery_error : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, response_due_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, escalated_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new)

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

Class methods

attributes

Returns all attribute keys.

by_incident_id(id)

Look up instances of this model dependent on the foreign key

Source
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_1605 : DB::ResultSet)
on_error(err : Exception | IO::Error)
primary_key

Base class for all Engine models

Source
table_name

Instance methods

__ai_incident
__ai_incident=(__ai_incident : AiIncident | Nil)
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

ai_incident

Retrieves the parent relationship

Source
ai_incident!
Source
ai_incident=(parent : AiIncident)

Sets the parent relationship

Source
apply_defaults

Generate code to apply default values

assign_attributes(incident_id : String | Nil | Missing = Missing, procedure_id : String | Missing = Missing, procedure_version : Int32 | Missing = Missing, procedure_hash : String | Missing = Missing, owner_queue : String | Missing = Missing, response_sla_minutes : Int32 | Missing = Missing, reason : String | Missing = Missing, required_artefacts_json : JSON::Any | Missing = Missing, delivery_status : String | Missing = Missing, delivery_destination : String | Missing = Missing, delivery_error : String | Nil | Missing = Missing, response_due_at : Time | Missing = Missing, escalated_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::AiEscalationRecord)

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.

clear_changes_information

Reset changes for all attributes.

delivery_destination

delivery_destination getter

delivery_destination=(value : String)

delivery_destination setter

delivery_destination?

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.

delivery_destination_assigned?
delivery_destination_change

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

delivery_destination_changed?
delivery_destination_default

delivery_destination's default value

Source
delivery_destination_present?
delivery_destination_removed?
delivery_destination_was
delivery_destination_will_change!

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

delivery_error

delivery_error getter

delivery_error=(value : String | Nil)

delivery_error setter

delivery_error_assigned?
delivery_error_change

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

delivery_error_changed?
delivery_error_default

delivery_error's default value

Source
delivery_error_present?
delivery_error_removed?
delivery_error_was
delivery_error_will_change!

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

delivery_status

delivery_status getter

delivery_status=(value : String)

delivery_status setter

delivery_status?

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.

delivery_status_assigned?
delivery_status_change

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

delivery_status_changed?
delivery_status_default

delivery_status's default value

Source
delivery_status_present?
delivery_status_removed?
delivery_status_was
delivery_status_will_change!

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

escalated_at

escalated_at getter

escalated_at=(value : Time)

escalated_at setter

escalated_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.

escalated_at_assigned?
escalated_at_change

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

escalated_at_changed?
escalated_at_default

escalated_at's default value

Source
escalated_at_present?
escalated_at_removed?
escalated_at_was
escalated_at_will_change!

Include escalated_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_id

incident_id getter

incident_id=(value : String | Nil)

Setters incident_id setter

incident_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.

incident_id_assigned?
incident_id_change

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

incident_id_changed?
incident_id_default

incident_id's default value

incident_id_present?
incident_id_removed?
incident_id_was
incident_id_will_change!

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

invoke_props

Base class for all Engine models

owner_queue

owner_queue getter

owner_queue=(value : String)

owner_queue setter

owner_queue?

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.

owner_queue_assigned?
owner_queue_change

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

owner_queue_changed?
owner_queue_default

owner_queue's default value

Source
owner_queue_present?
owner_queue_removed?
owner_queue_was
owner_queue_will_change!

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

persistent_attributes

Returns a Hash of all attributes that can be persisted.

primary_key

Base class for all Engine models

Source
primary_key_hash
procedure_hash

procedure_hash getter

procedure_hash=(value : String)

procedure_hash setter

procedure_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.

procedure_hash_assigned?
procedure_hash_change

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

procedure_hash_changed?
procedure_hash_default

procedure_hash's default value

Source
procedure_hash_present?
procedure_hash_removed?
procedure_hash_was
procedure_hash_will_change!

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

procedure_id

procedure_id getter

procedure_id=(value : String)

procedure_id setter

procedure_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.

procedure_id_assigned?
procedure_id_change

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

procedure_id_changed?
procedure_id_default

procedure_id's default value

Source
procedure_id_present?
procedure_id_removed?
procedure_id_was
procedure_id_will_change!

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

procedure_version

procedure_version getter

procedure_version=(value : Int32)

procedure_version setter

procedure_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.

procedure_version_assigned?
procedure_version_change

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

procedure_version_changed?
procedure_version_default

procedure_version's default value

Source
procedure_version_present?
procedure_version_removed?
procedure_version_was
procedure_version_will_change!

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

reason

reason getter

reason=(value : String)

reason setter

reason?

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.

reason_assigned?
reason_change

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

reason_changed?
reason_default

reason's default value

Source
reason_present?
reason_removed?
reason_was
reason_will_change!

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

required_artefacts_json

required_artefacts_json getter

required_artefacts_json=(value : JSON::Any)

required_artefacts_json setter

required_artefacts_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.

required_artefacts_json_assigned?
required_artefacts_json_change

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

required_artefacts_json_changed?
required_artefacts_json_default

required_artefacts_json's default value

Source
required_artefacts_json_present?
required_artefacts_json_removed?
required_artefacts_json_was
required_artefacts_json_will_change!

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

reset_associations
Source
response_due_at

response_due_at getter

response_due_at=(value : Time)

response_due_at setter

response_due_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.

response_due_at_assigned?
response_due_at_change

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

response_due_at_changed?
response_due_at_default

response_due_at's default value

Source
response_due_at_present?
response_due_at_removed?
response_due_at_was
response_due_at_will_change!

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

response_sla_minutes

response_sla_minutes getter

response_sla_minutes=(value : Int32)

response_sla_minutes setter

response_sla_minutes?

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.

response_sla_minutes_assigned?
response_sla_minutes_change

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

response_sla_minutes_changed?
response_sla_minutes_default

response_sla_minutes's default value

Source
response_sla_minutes_present?
response_sla_minutes_removed?
response_sla_minutes_was
response_sla_minutes_will_change!

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

restore_attributes

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

table_name
validate_nilability

Validate that all non-nillable fields have values.

Nested types