summaryrefslogtreecommitdiff
path: root/lib/bitbucket
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-22 16:15:15 -0300
committerStan Hu <stanhu@gmail.com>2016-11-21 16:47:27 -0800
commit64722a15e39436820a0636804179cf8c8957197e (patch)
treecabc9741ab482739838c00f937f9f519f0ae2298 /lib/bitbucket
parent317b020932736d2cd629542e3a8b3aef2219e033 (diff)
downloadgitlab-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.rb6
-rw-r--r--lib/bitbucket/representation/pull_request.rb6
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