class PlaceOS::Api::Webhook::ExecParams
- PlaceOS::Api::Webhook::ExecParams
- PlaceOS::Api::Webhook::WebhookParams
- PlaceOS::Api::Params
- ActiveModel::Model
- Reference
- Object
Defined in:
placeos-rest-api/controllers/webhook.crConstructors
- .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. - .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(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .new(pull : JSON::PullParser)
- .new(mod : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, index : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, method : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, id : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, secret : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new)
-
.new(params : HTTP::Params | Hash(String, String) | Tuple(String, String))
Initialize PlaceOS::Api::Webhook::ExecParams from
HTTP::Params
.
Class Method Summary
-
.attributes : Array(Symbol)
Returns all attribute keys.
Instance Method Summary
- #after_initialize(trusted : Bool)
-
#apply_defaults
Generate code to apply default values
-
#assign_attributes(mod : String | Missing = Missing, index : Int32 | Missing = Missing, method : String | Missing = Missing, id : String | Missing = Missing, secret : String | Missing = Missing)
Assign to multiple attributes.
-
#assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String))
Assign to mulitple attributes via
HTTP::Params
. - #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. -
#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 : String
Serialize the set of changed attributes to JSON.
-
#changed_yaml(io : IO) : Nil
Serialize the set of changed attributes to YAML.
-
#changed_yaml : String
Serialize the set of changed attributes to YAML.
-
#clear_changes_information
Reset changes for all attributes.
- #friendly
-
#id : String
#id
getter -
#id=(value : String)
#id
setter -
#index : Int32
#index
getter -
#index=(value : Int32)
#index
setter - #index? : Int32 | Nil
-
#index_change : Tuple(Int32 | Nil, Int32 | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #index_changed? : Bool
-
#index_default : Int32
#index
's default value - #index_present? : Bool
- #index_was : Int32 | Nil
-
#index_will_change! : Nil
Include
#index
in the set of changed attributes, whether it has changed or not. -
#method : String
#method
getter -
#method=(value : String)
#method
setter - #method? : String | Nil
-
#method_change : Tuple(String | Nil, String | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #method_changed? : Bool
-
#method_default : String
#method
's default value - #method_present? : Bool
- #method_was : String | Nil
-
#method_will_change! : Nil
Include
#method
in the set of changed attributes, whether it has changed or not. -
#mod : String
#mod
getter -
#mod=(value : String)
Setters
#mod
setter - #mod? : String | Nil
-
#mod_change : Tuple(String | Nil, String | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
- #mod_changed? : Bool
-
#mod_default : String
#mod
's default value - #mod_present? : Bool
- #mod_was : String | Nil
-
#mod_will_change! : Nil
Include
#mod
in the set of changed attributes, whether it has changed or not. -
#persistent_attributes
Returns a
Hash
of all attributes that can be persisted. -
#restore_attributes
Reset each attribute to their previous values and clears all changes.
-
#secret : String
#secret
getter -
#secret=(value : String)
#secret
setter -
#validate_nilability
Validate that all non-nillable fields have values.
Instance methods inherited from class PlaceOS::Api::Webhook::WebhookParams
after_initialize(trusted : Bool)
after_initialize,
apply_defaults
apply_defaults,
assign_attributes(id : String | Missing = Missing, secret : String | Missing = Missing)assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String)) assign_attributes, assign_attributes_from_json(json, root : String)
assign_attributes_from_json(json) assign_attributes_from_json, assign_attributes_from_trusted_json(json, root : String)
assign_attributes_from_trusted_json(json) assign_attributes_from_trusted_json, assign_attributes_from_trusted_yaml(yaml) assign_attributes_from_trusted_yaml, assign_attributes_from_yaml(yaml) assign_attributes_from_yaml, attributes attributes, attributes_tuple attributes_tuple, changed? changed?, changed_attributes changed_attributes, changed_json(io : IO) : Nil
changed_json : String changed_json, changed_yaml(io : IO) : Nil
changed_yaml : String changed_yaml, clear_changes_information clear_changes_information, id : String id, id=(value : String) id=, id? : String | Nil id?, id_change : Tuple(String | Nil, String | Nil) | Nil id_change, id_changed? : Bool id_changed?, id_default : String id_default, id_present? : Bool id_present?, id_was : String | Nil id_was, id_will_change! : Nil id_will_change!, persistent_attributes persistent_attributes, restore_attributes restore_attributes, secret : String secret, secret=(value : String) secret=, secret? : String | Nil secret?, secret_change : Tuple(String | Nil, String | Nil) | Nil secret_change, secret_changed? : Bool secret_changed?, secret_default : String secret_default, secret_present? : Bool secret_present?, secret_was : String | Nil secret_was, secret_will_change! : Nil secret_will_change!, validate_nilability validate_nilability
Constructor methods inherited from class PlaceOS::Api::Webhook::WebhookParams
from_json(string_or_io : String | IO, trusted : Bool = false) : selffrom_json(string_or_io : String | IO, root : String, trusted : Bool = false) : self from_json, from_trusted_json(string_or_io : String | IO, root : String) : self
from_trusted_json(string_or_io : String | IO) : self from_trusted_json, from_trusted_yaml(string_or_io : String | IO) : self from_trusted_yaml, from_yaml(string_or_io : String | IO, trusted : Bool = false) : self from_yaml, new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
new(pull : JSON::PullParser)
new(id : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, secret : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new)
new(params : HTTP::Params | Hash(String, String) | Tuple(String, String)) new
Class methods inherited from class PlaceOS::Api::Webhook::WebhookParams
attributes : Array(Symbol)
attributes
Instance methods inherited from class PlaceOS::Api::Params
apply_defaults
apply_defaults,
assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String))assign_attributes assign_attributes, attributes attributes, attributes_tuple attributes_tuple, persistent_attributes persistent_attributes, validate! validate!
Constructor methods inherited from class PlaceOS::Api::Params
new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)new(pull : JSON::PullParser) new
Class methods inherited from class PlaceOS::Api::Params
attributes : Array(Symbol)
attributes
Constructor Detail
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">
Serialize from a trusted JSON source
Serialize from a trusted YAML source
Initialize PlaceOS::Api::Webhook::ExecParams from HTTP::Params
.
Class Method Detail
Instance Method Detail
Assign to multiple attributes.
Assign to mulitple attributes via HTTP::Params
.
Assign each field from JSON if field exists in JSON and has changed in model
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #index
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #method
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed