ExDoppler.Webhooks (ExDoppler v1.0.1)
View SourceModule for interacting with ExDoppler.Webhook
๐ Resources
- ๐ Doppler docs
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Summary
Functions
Creates a new ExDoppler.Webhook
, given a project, a webhook URL, and options
Same as create_webhook/3
but won't wrap a successful response in {:ok, response}
Same as delete_webhook/2
but won't wrap a successful response in {:ok, response}
Disables a ExDoppler.Webhook
, given a project and a webhook
Same as disable_webhook/2
but won't wrap a successful response in {:ok, response}
Enables a ExDoppler.Webhook
, given a project and a webhook
Same as enable_webhook/2
but won't wrap a successful response in {:ok, response}
Retrieves a ExDoppler.Webhook
, given a project and a webhook id
Same as get_webhook/2
but won't wrap a successful response in {:ok, response}
Same as list_webhooks/1
but won't wrap a successful response in {:ok, response}
Functions
Creates a new ExDoppler.Webhook
, given a project, a webhook URL, and options
๐ท๏ธ Params
- project - The
ExDoppler.Project
for which you want the webhooks (e.g%Project{name: "example-project"}
) - url: The webhook URL. Must be https (e.g
"https://httpbin.org/post"
) - opts: Optional modifications
- name - The name of the webhook (e.g "
my-web-hook"
) - secret - See https://docs.doppler.com/docs/webhooks#verify-webhook-with-request-signing
- payload - See https://docs.doppler.com/docs/webhooks#default-payload
- enable_configs - List of Config slugs that the webhook should be enabled for. Default:
[]
- authentication - Either
%{type: :Bearer, token: "BEARER TOKEN HERE"}
or%{type: :Basic, username: "example_user", password: "pass"}
- name - The name of the webhook (e.g "
โคต๏ธ Returns
โ On Success
{:ok, %ExDoppler.Webhook{...}}
โ On Failure
{:error, err}
๐ป Examples
iex> alias ExDoppler.Project
iex> alias ExDoppler.Webhook
iex> alias ExDoppler.Webhooks
iex> _ = Webhooks.delete_webhook!(%Project{name: "example-project"}, %Webhook{id: "doc-webhook"})
iex> {:ok, webhook} = Webhooks.create_webhook(%Project{name: "example-project"}, "https://httpbin.org/post", name: "doc-webhook", enable_configs: ["dev"], authentication: %{type: :Basic, username: "joe", password: "dirt"})
iex> :ok = Webhooks.delete_webhook!(%Project{name: "example-project"}, webhook)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as create_webhook/3
but won't wrap a successful response in {:ok, response}
Deletes a ExDoppler.Webhook
๐ท๏ธ Params
- project - The
ExDoppler.Project
for which you want the webhooks (e.g%Project{name: "example-project"}
)
โคต๏ธ Returns
โ On Success
{:ok, {:success, true}
โ On Failure
{:error, err}
๐ป Examples
iex> alias ExDoppler.Project
iex> alias ExDoppler.Webhook
iex> alias ExDoppler.Webhooks
iex> _ = Webhooks.delete_webhook!(%Project{name: "example-project"}, %Webhook{id: "doc-webhook"})
iex> {:ok, webhook} = Webhooks.create_webhook(%Project{name: "example-project"}, "https://httpbin.org/post", name: "doc-webhook", enable_configs: ["dev"], authentication: %{type: :Basic, username: "joe", password: "dirt"})
iex> :ok = Webhooks.delete_webhook!(%Project{name: "example-project"}, webhook)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as delete_webhook/2
but won't wrap a successful response in {:ok, response}
Disables a ExDoppler.Webhook
, given a project and a webhook
๐ท๏ธ Params
- project - The
ExDoppler.Project
for which you want the webhooks (e.g%Project{name: "example-project"}
) - webhook - The
ExDoppler.Webhook
to enable (e.g %Webhook{id: "my-new-webhook" ...}
โคต๏ธ Returns
โ On Success
{:ok, %ExDoppler.Webhook{...}}
โ On Failure
{:error, err}
๐ป Examples
iex> alias ExDoppler.Project
iex> alias ExDoppler.Webhook
iex> alias ExDoppler.Webhooks
iex> _ = Webhooks.delete_webhook!(%Project{name: "example-project"}, %Webhook{id: "doc-webhook"})
iex> {:ok, webhook} = Webhooks.create_webhook(%Project{name: "example-project"}, "https://httpbin.org/post", name: "doc-webhook", enable_configs: ["dev"], authentication: %{type: :Basic, username: "joe", password: "dirt"})
iex> {:ok, %Webhook{enabled: false}} = Webhooks.disable_webhook(%Project{name: "example-project"}, webhook)
iex> :ok = Webhooks.delete_webhook!(%Project{name: "example-project"}, webhook)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as disable_webhook/2
but won't wrap a successful response in {:ok, response}
Enables a ExDoppler.Webhook
, given a project and a webhook
๐ท๏ธ Params
- project - The
ExDoppler.Project
for which you want the webhooks (e.g%Project{name: "example-project"}
) - webhook - The
ExDoppler.Webhook
to enable (e.g %Webhook{id: "my-new-webhook" ...}
โคต๏ธ Returns
โ On Success
{:ok, %ExDoppler.Webhook{...}}
โ On Failure
{:error, err}
๐ป Examples
iex> alias ExDoppler.Project
iex> alias ExDoppler.Webhook
iex> alias ExDoppler.Webhooks
iex> _ = Webhooks.delete_webhook!(%Project{name: "example-project"}, %Webhook{id: "doc-webhook"})
iex> {:ok, webhook} = Webhooks.create_webhook(%Project{name: "example-project"}, "https://httpbin.org/post", name: "doc-webhook", enable_configs: ["dev"], authentication: %{type: :Basic, username: "joe", password: "dirt"})
iex> {:ok, %Webhook{enabled: true}} = Webhooks.enable_webhook(%Project{name: "example-project"}, webhook)
iex> :ok = Webhooks.delete_webhook!(%Project{name: "example-project"}, webhook)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as enable_webhook/2
but won't wrap a successful response in {:ok, response}
Retrieves a ExDoppler.Webhook
, given a project and a webhook id
๐ท๏ธ Params
- project - The
ExDoppler.Project
for which you want the webhooks (e.g%Project{name: "example-project"}
) - id - ID of the webhook to retrieve
โคต๏ธ Returns
โ On Success
{:ok, %ExDoppler.Webhook{...}}
โ On Failure
{:error, err}
๐ป Examples
iex> alias ExDoppler.Project
iex> alias ExDoppler.Webhook
iex> alias ExDoppler.Webhooks
iex> _ = Webhooks.delete_webhook!(%Project{name: "example-project"}, %Webhook{id: "doc-webhook"})
iex> {:ok, webhook} = Webhooks.create_webhook(%Project{name: "example-project"}, "https://httpbin.org/post", name: "doc-webhook", enable_configs: ["dev"], authentication: %{type: :Basic, username: "joe", password: "dirt"})
iex> {:ok, webhook} = Webhooks.get_webhook(%Project{name: "example-project"}, webhook.id)
iex> :ok = Webhooks.delete_webhook!(%Project{name: "example-project"}, webhook)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as get_webhook/2
but won't wrap a successful response in {:ok, response}
Lists ExDoppler.Webhook
๐ท๏ธ Params
- project - The
ExDoppler.Project
for which you want the webhooks (e.g%Project{name: "example-project"}
)
โคต๏ธ Returns
โ On Success
{:ok, [%ExDoppler.Webhook{...} ...]}
โ On Failure
{:error, err}
๐ป Examples
iex> alias ExDoppler.Project
iex> alias ExDoppler.Webhooks
iex> {:ok, _webhooks} = Webhooks.list_webhooks(%Project{name: "example-project"})
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as list_webhooks/1
but won't wrap a successful response in {:ok, response}