@@ -183,11 +183,6 @@ public void setPermissions(Map<String, String> permissions) {
183183 throw new RuntimeException ("Do not use this method." );
184184 }
185185
186- GHApp wrapUp (GitHub root ) {
187- this .root = root ;
188- return this ;
189- }
190-
191186 /**
192187 * Obtains all the installations associated with this app.
193188 * <p>
@@ -198,10 +193,10 @@ GHApp wrapUp(GitHub root) {
198193 */
199194 @ Preview (MACHINE_MAN )
200195 public PagedIterable <GHAppInstallation > listInstallations () {
201- return root .createRequest ()
196+ return root () .createRequest ()
202197 .withPreview (MACHINE_MAN )
203198 .withUrlPath ("/app/installations" )
204- .toIterable (GHAppInstallation [].class , item -> item . wrapUp ( root ) );
199+ .toIterable (GHAppInstallation [].class , null );
205200 }
206201
207202 /**
@@ -218,11 +213,10 @@ public PagedIterable<GHAppInstallation> listInstallations() {
218213 */
219214 @ Preview (MACHINE_MAN )
220215 public GHAppInstallation getInstallationById (long id ) throws IOException {
221- return root .createRequest ()
216+ return root () .createRequest ()
222217 .withPreview (MACHINE_MAN )
223218 .withUrlPath (String .format ("/app/installations/%d" , id ))
224- .fetch (GHAppInstallation .class )
225- .wrapUp (root );
219+ .fetch (GHAppInstallation .class );
226220 }
227221
228222 /**
@@ -240,11 +234,10 @@ public GHAppInstallation getInstallationById(long id) throws IOException {
240234 */
241235 @ Preview (MACHINE_MAN )
242236 public GHAppInstallation getInstallationByOrganization (String name ) throws IOException {
243- return root .createRequest ()
237+ return root () .createRequest ()
244238 .withPreview (MACHINE_MAN )
245239 .withUrlPath (String .format ("/orgs/%s/installation" , name ))
246- .fetch (GHAppInstallation .class )
247- .wrapUp (root );
240+ .fetch (GHAppInstallation .class );
248241 }
249242
250243 /**
@@ -264,11 +257,10 @@ public GHAppInstallation getInstallationByOrganization(String name) throws IOExc
264257 */
265258 @ Preview (MACHINE_MAN )
266259 public GHAppInstallation getInstallationByRepository (String ownerName , String repositoryName ) throws IOException {
267- return root .createRequest ()
260+ return root () .createRequest ()
268261 .withPreview (MACHINE_MAN )
269262 .withUrlPath (String .format ("/repos/%s/%s/installation" , ownerName , repositoryName ))
270- .fetch (GHAppInstallation .class )
271- .wrapUp (root );
263+ .fetch (GHAppInstallation .class );
272264 }
273265
274266 /**
@@ -285,11 +277,10 @@ public GHAppInstallation getInstallationByRepository(String ownerName, String re
285277 */
286278 @ Preview (MACHINE_MAN )
287279 public GHAppInstallation getInstallationByUser (String name ) throws IOException {
288- return root .createRequest ()
280+ return root () .createRequest ()
289281 .withPreview (MACHINE_MAN )
290282 .withUrlPath (String .format ("/users/%s/installation" , name ))
291- .fetch (GHAppInstallation .class )
292- .wrapUp (root );
283+ .fetch (GHAppInstallation .class );
293284 }
294285
295286}
0 commit comments