File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/main/scala/com/codacy/client/bitbucket/v2/service Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -118,4 +118,22 @@ class RepositoryServices(client: BitbucketClient) {
118
118
val encodedRepo = URLEncoder .encode(repo, " UTF-8" )
119
119
s " ${client.repositoriesBaseUrl}/ $encodedOwner/ $encodedRepo"
120
120
}
121
+
122
+ def getProjectRepositories (workspaceId : String ,
123
+ projectKey : String ,
124
+ pageRequest : Option [PageRequest ],
125
+ pageLength : Option [Int ]) : RequestResponse [Seq [Repository ]] = {
126
+ val encodedProjectKey = URLEncoder .encode(projectKey, " UTF-8" )
127
+
128
+ val url = s " ${client.repositoriesBaseUrl}/ $workspaceId?q=project.key=%22 $encodedProjectKey%22 "
129
+ pageRequest match {
130
+ case Some (request) =>
131
+ client.executeWithCursor[Repository ](url, request, pageLength)
132
+ case None =>
133
+ val length = pageLength.fold(" " )(pagelen => s " pagelen= $pagelen" )
134
+ val urlWithPageLength = joinQueryParameters(url, length)
135
+ client.executePaginated[Repository ](urlWithPageLength)
136
+ }
137
+ }
138
+
121
139
}
You can’t perform that action at this time.
0 commit comments