class SmartRecruiters::WebhooksResource
Constants
- WEBHOOK_API
Public Instance Methods
activate(webhook_id:, **attributes)
click to toggle source
# File lib/smartrecruiters/resources/webhooks.rb, line 24 def activate(webhook_id:, **attributes) put_request("#{WEBHOOK_API}/subscriptions/#{webhook_id}/activation", body: attributes) end
callbacks_log(webhook_id:, **params)
click to toggle source
# File lib/smartrecruiters/resources/webhooks.rb, line 28 def callbacks_log(webhook_id:, **params) response = get_request("#{WEBHOOK_API}/subscriptions/#{webhook_id}/callbacks-log", params: params) Collection.from_response(response, type: CallbacksLog) end
create(**attributes)
click to toggle source
# File lib/smartrecruiters/resources/webhooks.rb, line 12 def create(**attributes) Webhook.new post_request("#{WEBHOOK_API}/subscriptions", body: attributes).body end
delete(webhook_id:)
click to toggle source
# File lib/smartrecruiters/resources/webhooks.rb, line 20 def delete(webhook_id:) delete_request("#{WEBHOOK_API}/subscriptions/#{webhook_id}") end
generate_secret(webhook_id:, **attributes)
click to toggle source
# File lib/smartrecruiters/resources/webhooks.rb, line 33 def generate_secret(webhook_id:, **attributes) Object.new post_request("#{WEBHOOK_API}/subscriptions/#{webhook_id}/secret-key", body: attributes).body end
list(**params)
click to toggle source
# File lib/smartrecruiters/resources/webhooks.rb, line 7 def list(**params) response = get_request("#{WEBHOOK_API}/subscriptions", params: params) Collection.from_response(response, type: Webhook) end
retrieve(webhook_id:)
click to toggle source
# File lib/smartrecruiters/resources/webhooks.rb, line 16 def retrieve(webhook_id:) Webhook.new get_request("#{WEBHOOK_API}/subscriptions/#{webhook_id}").body end
retrieve_secret(webhook_id:)
click to toggle source
# File lib/smartrecruiters/resources/webhooks.rb, line 37 def retrieve_secret(webhook_id:) Object.new get_request("#{WEBHOOK_API}/subscriptions/#{webhook_id}/secret-key").body end