File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Filter options
src/main/java/org/kohsuke/github Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Original file line number Diff line number Diff line change 3
3
import com .fasterxml .jackson .annotation .JsonProperty ;
4
4
5
5
import java .io .IOException ;
6
+ import java .net .MalformedURLException ;
6
7
import java .net .URL ;
7
8
import java .util .List ;
8
9
import java .util .Map ;
9
10
10
11
import static org .kohsuke .github .Previews .GAMBIT ;
12
+ import static org .kohsuke .github .Previews .MACHINE_MAN ;
11
13
12
14
/**
13
15
* A Github App Installation.
@@ -117,6 +119,36 @@ public String getRepositoriesUrl() {
117
119
return repositoriesUrl ;
118
120
}
119
121
122
+ /**
123
+ * List repositories that this app installation can access.
124
+ *
125
+ * @return the paged iterable
126
+ */
127
+ @ Preview
128
+ @ Deprecated
129
+ public PagedSearchIterable <GHRepository > listRepositories () {
130
+ GitHubRequest request ;
131
+
132
+ try {
133
+ request = root .createRequest ().withPreview (MACHINE_MAN ).withUrlPath ("/installation/repositories" ).build ();
134
+ } catch (MalformedURLException e ) {
135
+ throw new GHException ("" , e );
136
+ }
137
+
138
+ return new PagedSearchIterable <>(root , request , GHAppInstallationRepositoryResult .class );
139
+ }
140
+
141
+ private static class GHAppInstallationRepositoryResult extends SearchResult <GHRepository > {
142
+ private GHRepository [] repositories ;
143
+
144
+ @ Override
145
+ GHRepository [] getItems (GitHub root ) {
146
+ for (GHRepository item : repositories )
147
+ item .wrap (root );
148
+ return repositories ;
149
+ }
150
+ }
151
+
120
152
/**
121
153
* Sets repositories url.
122
154
*
You can’t perform that action at this time.
0 commit comments