Class: Hachi::Clients::Alert
Instance Attribute Summary
Attributes inherited from Base
#api_endpoint, #api_key, #api_version
Instance Method Summary collapse
-
#create(**payload) ⇒ Hash
Create an alert.
-
#delete_by_id(id) ⇒ String
Delete an alert.
-
#get_by_id(id) ⇒ Hash
Get an alert.
-
#update(id, **payload) ⇒ Hash
Update an alert.
Methods inherited from Base
#delete, #get, #initialize, #patch, #post
Methods included from Awrence::Methods
#to_camel_keys, #to_camelback_keys
Constructor Details
This class inherits a constructor from Hachi::Clients::Base
Instance Method Details
#create(**payload) ⇒ Hash
Create an alert
38 39 40 |
# File 'lib/hachi/clients/alert.rb', line 38 def create(**payload) post("/alert", json: payload) { |json| json } end |
#delete_by_id(id) ⇒ String
Delete an alert
27 28 29 |
# File 'lib/hachi/clients/alert.rb', line 27 def delete_by_id(id) delete("/alert/#{id}") { |json| json } end |
#get_by_id(id) ⇒ Hash
Get an alert
16 17 18 |
# File 'lib/hachi/clients/alert.rb', line 16 def get_by_id(id) get("/alert/#{id}") { |json| json } end |
#update(id, **payload) ⇒ Hash
Update an alert
49 50 51 |
# File 'lib/hachi/clients/alert.rb', line 49 def update(id, **payload) patch("/alert/#{id}", json: payload) { |json| json } end |