Dnsimple.Webhooks (dnsimple v3.1.0) View Source

Provides functions to interact with the webhook endpoints.

See:

Link to this section Summary

Link to this section Functions

Link to this function

create_webhook(client, account_id, attributes, options \\ [])

View Source

Specs

create_webhook(Dnsimple.Client.t(), String.t() | integer(), map(), Keyword.t()) ::
  {:ok | :error, Dnsimple.Response.t()}

Creates a new webhook.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Webhooks.create_webhook(client, account_id = "1010", %{
  url: "https://test.host/handler"
})
Link to this function

delete_webhook(client, account_id, webhook_id, options \\ [])

View Source

Specs

delete_webhook(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Deletes a webhook.

Warning: this is a destructive operation.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Webhooks.delete_webhook(client, account_id = "1010", webhook_id = 1234)
Link to this function

get_webhook(client, account_id, webhook_id, options \\ [])

View Source

Specs

get_webhook(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Returns a webhook.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Webhooks.get_webhook(client, account_id = "1010", webhook_id = 1234)
Link to this function

list_webhooks(client, account_id, options \\ [])

View Source

Lists the existing webhooks in the account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Webhooks.list_webhooks(client, account_id = "1010")