Tentacat v1.2.0 Tentacat.Pulls

Summary

Functions

create(client, owner, repo, body)

Specs

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

Create a pull request

Pull Request body example:

%{
  "title" => "Amazing new feature",
  "body"  => "Please pull this in!",
  "head"  => "octocat:new-feature",
  "base"  => "master"
 }

Alternative input (using an existing issue):

%{
  "issue" => "5",
  "head"  => "octocat:new-feature",
  "base"  => "master"
 }

Example

Tentacat.Pulls.create client, "elixir-lang", "elixir", body

More info at: https://developer.github.com/v3/pulls/#create-a-pull-request

filter(client \\ %Client{}, owner, repo, filters)

Specs

filter(Tentacat.Client.t, binary, binary, map) :: Tentacat.response

Filter pull requests

Example

Tentacat.Pulls.filter "elixir-lang", "elixir", %{state: "open"}
Tentacat.Pulls.filter client, "elixir-lang", "elixir", %{state: "open"}

More info at: https://developer.github.com/v3/pulls/#parameters

find(client \\ %Client{}, owner, repo, number)

Specs

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

Get a single pull request

Example

Tentacat.Pulls.find "elixir-lang", "elixir", "2974"
Tentacat.Pulls.find client, "elixir-lang", "elixir", "2974"

More info at: https://developer.github.com/v3/pulls/#get-a-single-pull-request

has_been_merged(client, owner, repo, number)

Specs

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

Get if a pull request has been merged

Example

Tentacat.Pulls.has_been_merged client, "elixir-lang", "elixir", "4876"

More info at: https://developer.github.com/v3/pulls/#get-if-a-pull-request-has-been-merged

list(client \\ %Client{}, owner, repo)

Specs

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

List pull requests

Example

Tentacat.Pulls.list "elixir-lang", "elixir"
Tentacat.Pulls.list client, "elixir-lang", "elixir"

More info at: https://developer.github.com/v3/pulls/#list-pull-requests

merge(client, owner, repo, number, body)

Specs

merge(Tentacat.Client.t, binary, binary, binary | integer, list | map) :: Tentacat.response

Merge a pull request (Merge Button)

Pull Request Merge body example:

%{
  "commit_message" => "not the default commit_message",
  "sha"  => "8e50d79f2ba0d665b9966908cbf22c6f463228d6"
 }

Example

Tentacat.Pulls.merge client, "elixir-lang", "elixir", "4876", body

More info at: https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button

update(client, owner, repo, number, body)

Specs

update(Tentacat.Client.t, binary, binary, binary | integer, list | map) :: Tentacat.response

Update a pull request

Pull Request body example:

%{
  "title" => "new title",
  "body"  => "updated body",
  "state" => "open"
 }

Example

Tentacat.Pulls.update client, "elixir-lang", "elixir", "2974", body

More info at: https://developer.github.com/v3/pulls/#update-a-pull-request