module Monzo::Client::Webhooks
Overview
Exposes methods for dealing with and manipulating Webhook
s as defined by the
Webhooks API documentation.
Direct including types
Defined in:
monzo/client/webhooks.crInstance Method Summary
-
#delete_webhook(webhook_id : String)
Deletes a
Webhook
with the specified webhook_id. -
#delete_webhook(webhook : Monzo::Webhook)
Deletes the specified
Webhook
. -
#register_webhook(account : Monzo::Account, url : String)
Registers a
Webhook
for the specified account, tourl
. -
#register_webhook(account_id : String, url : String)
Registers a
Webhook
for the specified account_id, tourl
. -
#webhooks(account : Monzo::Account)
Returns the
Webhook
s for the specified account. -
#webhooks(account_id : String)
Returns
Webhook
s for the specified account_id.
Instance Method Detail
def delete_webhook(webhook : Monzo::Webhook)
#
Deletes the specified Webhook
.
Returns true
when successful.
account = client.accounts.first
webhook = client.webhooks(account)
client.delete(webhook) # => true
def register_webhook(account : Monzo::Account, url : String)
#
Registers a Webhook
for the specified account, to url
.
account = client.accounts.first
client.register(account, "https://localhost") # => #<Monzo::Webhook:0x10c10db70 @id="webhook_WEBHOOKID", @account_id="acc_ACCOUNTID", @url="https://localhost">
def register_webhook(account_id : String, url : String)
#
Registers a Webhook
for the specified account_id, to url
.
def webhooks(account : Monzo::Account)
#
Returns the Webhook
s for the specified account.
account = client.accounts.first
client.webooks(account) # => #<Monzo::Webhook:0x10c10db70 @id="webhook_WEBHOOKID", @account_id="acc_ACCOUNTID", @url="https://localhost">