class

PlaceOS::Model::AiVerificationRun

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, attempt : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, status : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, checks_json : JSON::Any | ActiveModel::Model::None = ::ActiveModel::Model::None.new, evidence_json : JSON::Any | ActiveModel::Model::None = ::ActiveModel::Model::None.new, started_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, completed_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, next_retry_at : Time | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new)

Initialize PlaceOS::Model::AiVerificationRun 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_1686 : 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, attempt : Int32 | Missing = Missing, status : String | Missing = Missing, checks_json : JSON::Any | Missing = Missing, evidence_json : JSON::Any | Missing = Missing, started_at : Time | Missing = Missing, completed_at : Time | Missing = Missing, next_retry_at : Time | Nil | 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::AiVerificationRun)

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

attempt

attempt getter

attempt=(value : Int32)

attempt setter

attempt?

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.

attempt_assigned?
attempt_change

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

attempt_changed?
attempt_default

attempt's default value

Source
attempt_present?
attempt_removed?
attempt_was
attempt_will_change!

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

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.

checks_json

checks_json getter

checks_json=(value : JSON::Any)

checks_json setter

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

checks_json_assigned?
checks_json_change

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

checks_json_changed?
checks_json_default

checks_json's default value

Source
checks_json_present?
checks_json_removed?
checks_json_was
checks_json_will_change!

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

clear_changes_information

Reset changes for all attributes.

completed_at

completed_at getter

completed_at=(value : Time)

completed_at setter

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

completed_at_assigned?
completed_at_change

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

completed_at_changed?
completed_at_default

completed_at's default value

Source
completed_at_present?
completed_at_removed?
completed_at_was
completed_at_will_change!

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

evidence_json

evidence_json getter

evidence_json=(value : JSON::Any)

evidence_json setter

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

evidence_json_assigned?
evidence_json_change

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

evidence_json_changed?
evidence_json_default

evidence_json's default value

Source
evidence_json_present?
evidence_json_removed?
evidence_json_was
evidence_json_will_change!

Include evidence_json 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

next_retry_at

next_retry_at getter

next_retry_at=(value : Time | Nil)

next_retry_at setter

next_retry_at_assigned?
next_retry_at_change

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

next_retry_at_changed?
next_retry_at_default

next_retry_at's default value

Source
next_retry_at_present?
next_retry_at_removed?
next_retry_at_was
next_retry_at_will_change!

Include next_retry_at 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.

reset_associations
Source
restore_attributes

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

started_at

started_at getter

started_at=(value : Time)

started_at setter

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

started_at_assigned?
started_at_change

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

started_at_changed?
started_at_default

started_at's default value

Source
started_at_present?
started_at_removed?
started_at_was
started_at_will_change!

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

status

status getter

status=(value : String)

status setter

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.

status_assigned?
status_change

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

status_changed?
status_default

status's default value

Source
status_present?
status_removed?
status_was
status_will_change!

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

table_name
validate_nilability

Validate that all non-nillable fields have values.

Nested types