Class: Hachi::Clients::Alert

Inherits:
Base
  • Object
show all
Defined in:
lib/hachi/clients/alert.rb

Instance Attribute Summary

Attributes inherited from Base

#api_endpoint, #api_key, #api_version

Instance Method Summary collapse

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

Parameters:

  • payload (Hash)

Returns:

  • (Hash)


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

Parameters:

  • id (String)

    Alert ID

Returns:

  • (String)


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

Parameters:

  • id (String)

    Alert ID

Returns:

  • (Hash)


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

Parameters:

  • id (String)
  • payload (Hash)

Returns:

  • (Hash)


49
50
51
# File 'lib/hachi/clients/alert.rb', line 49

def update(id, **payload)
  patch("/alert/#{id}", json: payload) { |json| json }
end