Tentacat v0.7.2 Tentacat.Organizations.Hooks

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"
}

}

Functions

create(organization, body, client)

Specs

create(binary, list, Tentacat.Client.t) :: Tentacat.response

Create webhook for an organization.

Example

Tentacat.Organizations.Hooks.create("github", hook_body, client)

More info at: http://developer.github.com/v3/orgs/hooks/#create-a-hook

find(organization, hook_id, client)

Specs

find(binary, binary | integer, Tentacat.Client.t) :: Tentacat.response

Get a webhook for an organization by id.

Example

Tentacat.Organizations.Hooks.find("github", "1234567", client)

More info at: http://developer.github.com/v3/orgs/hooks/#get-single-hook

list(organization, client \\ %Tentacat.Client{})

Specs

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 "github", client

More info at: http://developer.github.com/v3/orgs/hooks/#list-hooks

ping(organization, hook_id, client)

Specs

ping(binary, binary | integer, Tentacat.Client.t) :: Tentacat.response

This will trigger a ping event to be sent to the hook.

Example

Tentacat.Organizations.Hooks.ping("github", "1234567", client)

More info at: http://developer.github.com/v3/orgs/hooks/#ping-a-hook

remove(organization, hook_id, client)

Specs

remove(binary, binary | integer, Tentacat.Client.t) :: Tentacat.response

Delete an organization’s webhook by it’s Id.

Example

Tentacat.Organizations.Hooks.remove("github", "1234567", client)

More info at: http://developer.github.com/v3/orgs/hooks/#delete-a-hook

update(organization, hook_id, body, client)

Specs

update(binary, binary | integer, list, Tentacat.Client.t) :: 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("github", "1234567", hook_body, client)

More info at: http://developer.github.com/v3/orgs/hooks/#edit-a-hook