diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-22 16:15:15 -0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-11-21 16:47:27 -0800 |
commit | 64722a15e39436820a0636804179cf8c8957197e (patch) | |
tree | cabc9741ab482739838c00f937f9f519f0ae2298 /lib/bitbucket | |
parent | 317b020932736d2cd629542e3a8b3aef2219e033 (diff) | |
download | gitlab-ce-64722a15e39436820a0636804179cf8c8957197e.tar.gz |
Add an endpoint to get a list of pull requests for a repo
Diffstat (limited to 'lib/bitbucket')
-rw-r--r-- | lib/bitbucket/client.rb | 6 | ||||
-rw-r--r-- | lib/bitbucket/representation/pull_request.rb | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/bitbucket/client.rb b/lib/bitbucket/client.rb index 3d22347603d..0368f388ea4 100644 --- a/lib/bitbucket/client.rb +++ b/lib/bitbucket/client.rb @@ -21,6 +21,12 @@ module Bitbucket end end + def pull_requests(repo) + relative_path = "/repositories/#{repo}/pullrequests" + paginator = Paginator.new(connection, relative_path, :pull_request) + + Collection.new(paginator) + end def repo(name) parsed_response = connection.get("/repositories/#{name}") diff --git a/lib/bitbucket/representation/pull_request.rb b/lib/bitbucket/representation/pull_request.rb new file mode 100644 index 00000000000..7cbad91e9c8 --- /dev/null +++ b/lib/bitbucket/representation/pull_request.rb @@ -0,0 +1,6 @@ +module Bitbucket + module Representation + class PullRequest < Representation::Base + end + end +end |