class

PlaceOS::Model::AiMaintenanceRun

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(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, schedule_bucket : Int64 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, status : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, target_count : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, incident_ids_json : JSON::Any | ActiveModel::Model::None = ::ActiveModel::Model::None.new, classification_counts_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, error : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new)

Initialize PlaceOS::Model::AiMaintenanceRun 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_1652 : 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(procedure_id : String | Missing = Missing, procedure_version : Int32 | Missing = Missing, procedure_hash : String | Missing = Missing, schedule_bucket : Int64 | Missing = Missing, status : String | Missing = Missing, target_count : Int32 | Missing = Missing, incident_ids_json : JSON::Any | Missing = Missing, classification_counts_json : JSON::Any | Missing = Missing, started_at : Time | Missing = Missing, completed_at : Time | Missing = Missing, error : String | 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::AiMaintenanceRun)

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_counts_json

classification_counts_json getter

classification_counts_json=(value : JSON::Any)

classification_counts_json setter

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

classification_counts_json_assigned?
classification_counts_json_change

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

classification_counts_json_changed?
classification_counts_json_default

classification_counts_json's default value

Source
classification_counts_json_present?
classification_counts_json_removed?
classification_counts_json_was
classification_counts_json_will_change!

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

error

error getter

error=(value : String | Nil)

error setter

error_assigned?
error_change

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

error_changed?
error_default

error's default value

Source
error_present?
error_removed?
error_was
error_will_change!

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

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)

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

restore_attributes

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

schedule_bucket

schedule_bucket getter

schedule_bucket=(value : Int64)

schedule_bucket setter

schedule_bucket?

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.

schedule_bucket_assigned?
schedule_bucket_change

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

schedule_bucket_changed?
schedule_bucket_default

schedule_bucket's default value

Source
schedule_bucket_present?
schedule_bucket_removed?
schedule_bucket_was
schedule_bucket_will_change!

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

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
target_count

target_count getter

target_count=(value : Int32)

target_count setter

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

target_count_assigned?
target_count_change

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

target_count_changed?
target_count_default

target_count's default value

Source
target_count_present?
target_count_removed?
target_count_was
target_count_will_change!

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

validate_nilability

Validate that all non-nillable fields have values.

Nested types