Module: SmartHR::Client::WebhookMethods
- Included in:
- SmartHR::Client
- Defined in:
- lib/smarthr/client/webhook_methods.rb
Instance Method Summary collapse
-
#create_webhook(body:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Create a new webhook.
-
#destroy_webhook(id:) {|response_body, response_header| ... } ⇒ Object
Delete the webhook.
-
#find_webhook(id:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Get the webhook.
-
#get_webhooks(page: 1, per_page: 10) {|response_body, response_header| ... } ⇒ Array<Hashie::Mash>
Get the list of webhooks.
-
#update_webhook(id:, body:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Change the data of the specified webhook.
Instance Method Details
#create_webhook(body:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Create a new webhook
77 78 79 |
# File 'lib/smarthr/client/webhook_methods.rb', line 77 def create_webhook(body:, &block) post("/webhooks", body, &block) end |
#destroy_webhook(id:) {|response_body, response_header| ... } ⇒ Object
Delete the webhook
11 12 13 |
# File 'lib/smarthr/client/webhook_methods.rb', line 11 def destroy_webhook(id:, &block) delete("/webhooks/#{id}", &block) end |
#find_webhook(id:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Get the webhook
26 27 28 |
# File 'lib/smarthr/client/webhook_methods.rb', line 26 def find_webhook(id:, &block) get("/webhooks/#{id}", &block) end |
#get_webhooks(page: 1, per_page: 10) {|response_body, response_header| ... } ⇒ Array<Hashie::Mash>
Get the list of webhooks
58 59 60 61 62 63 64 |
# File 'lib/smarthr/client/webhook_methods.rb', line 58 def get_webhooks(page: 1, per_page: 10, &block) get("/webhooks", page: page, per_page: per_page, &block ) end |
#update_webhook(id:, body:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Change the data of the specified webhook
42 43 44 |
# File 'lib/smarthr/client/webhook_methods.rb', line 42 def update_webhook(id:, body:, &block) patch("/webhooks/#{id}", body, &block) end |