Tentacat v1.6.0 Tentacat.Organizations.Hooks View Source
Link to this section Summary
Functions
Create webhook for an organization
Get a webhook for an organization by id
List hooks of an organization. The response will differ if the authenticated user is also owner of the organization
This will trigger a ping event to be sent to the hook
Delete an organization's webhook by it's Id
hook_body = %{
"name" => "web",
"active" => true,
"events" => [ "push", "pull_request" ],
"config" => {
"url" => "http://example.com/webhook",
"content_type" => "json"
}
}
Link to this section Functions
create(client, organization, body)
View Source
create(Tentacat.Client.t(), binary(), list()) :: Tentacat.response()
create(Tentacat.Client.t(), binary(), list()) :: Tentacat.response()
Create webhook for an organization.
Example
Tentacat.Organizations.Hooks.create(client, "github", hook_body)
More info at: http://developer.github.com/v3/orgs/hooks/#create-a-hook
find(client, organization, hook_id)
View Source
find(Tentacat.Client.t(), binary(), binary() | integer()) :: Tentacat.response()
find(Tentacat.Client.t(), binary(), binary() | integer()) :: Tentacat.response()
Get a webhook for an organization by id.
Example
Tentacat.Organizations.Hooks.find(client, "github", "1234567")
More info at: http://developer.github.com/v3/orgs/hooks/#get-single-hook
list(client \\ %Client{}, organization)
View Source
list(Tentacat.Client.t(), binary()) :: Tentacat.response()
list(Tentacat.Client.t(), binary()) :: Tentacat.response()
List hooks of an organization. The response will differ if the authenticated user is also owner of the organization
Example
Tentacat.Organizations.Hooks.list "github"
Tentacat.Organizations.Hooks.list client, "github"
More info at: http://developer.github.com/v3/orgs/hooks/#list-hooks
ping(client, organization, hook_id)
View Source
ping(Tentacat.Client.t(), binary(), binary() | integer()) :: Tentacat.response()
ping(Tentacat.Client.t(), binary(), binary() | integer()) :: Tentacat.response()
This will trigger a ping event to be sent to the hook.
Example
Tentacat.Organizations.Hooks.ping(client, "github", "1234567")
More info at: http://developer.github.com/v3/orgs/hooks/#ping-a-hook
remove(client, organization, hook_id)
View Source
remove(Tentacat.Client.t(), binary(), binary() | integer()) ::
Tentacat.response()
remove(Tentacat.Client.t(), binary(), binary() | integer()) :: Tentacat.response()
Delete an organization's webhook by it's Id.
Example
Tentacat.Organizations.Hooks.remove(client, "github", "1234567")
More info at: http://developer.github.com/v3/orgs/hooks/#delete-a-hook
update(client, organization, hook_id, body)
View Source
update(Tentacat.Client.t(), binary(), binary() | integer(), list()) ::
Tentacat.response()
update(Tentacat.Client.t(), binary(), binary() | integer(), list()) :: Tentacat.response()
hook_body = %{
"name" => "web",
"active" => true,
"events" => [ "push", "pull_request" ],
"config" => {
"url" => "http://example.com/webhook",
"content_type" => "json"
}
}
Example
Tentacat.Organizations.Hooks.update(client, "github", "1234567", hook_body)
More info at: http://developer.github.com/v3/orgs/hooks/#edit-a-hook