@@ -231,7 +231,7 @@ public Set<String> getCollaboratorNames() throws IOException {
231231 * If this repository belongs to an organization, return a set of teams.
232232 */
233233 public Set <GHTeam > getTeams () throws IOException {
234- return Collections .unmodifiableSet (new HashSet <GHTeam >(Arrays .asList (GHTeam .wrapUp (root .retrieve ().withCredential (). to ("/repos/" + owner .login + "/" + name + "/teams" , GHTeam [].class ), root .getOrganization (owner .login )))));
234+ return Collections .unmodifiableSet (new HashSet <GHTeam >(Arrays .asList (GHTeam .wrapUp (root .retrieve ().to ("/repos/" + owner .login + "/" + name + "/teams" , GHTeam [].class ), root .getOrganization (owner .login )))));
235235 }
236236
237237 public void addCollaborators (GHUser ... users ) throws IOException {
@@ -253,7 +253,7 @@ public void removeCollaborators(Collection<GHUser> users) throws IOException {
253253 private void modifyCollaborators (Collection <GHUser > users , String method ) throws IOException {
254254 verifyMine ();
255255 for (GHUser user : users ) {
256- new Requester (root ).withCredential (). method (method ).to ("/repos/" + owner .login + "/" + name + "/collaborators/" + user .getLogin ());
256+ new Requester (root ).method (method ).to ("/repos/" + owner .login + "/" + name + "/collaborators/" + user .getLogin ());
257257 }
258258 }
259259
@@ -270,7 +270,7 @@ public void setEmailServiceHook(String address) throws IOException {
270270 }
271271
272272 private void edit (String key , String value ) throws IOException {
273- Requester requester = new Requester (root ). withCredential () ;
273+ Requester requester = new Requester (root );
274274 if (!key .equals ("name" ))
275275 requester .with ("name" , name ); // even when we don't change the name, we need to send it in
276276 requester .with (key , value ).method ("PATCH" ).to ("/repos/" + owner .login + "/" + name );
@@ -313,7 +313,7 @@ public void setHomepage(String value) throws IOException {
313313 * Deletes this repository.
314314 */
315315 public void delete () throws IOException {
316- new Requester (root ).withCredential (). method ("DELETE" ).to ("/repos/" + owner .login + "/" + name );
316+ new Requester (root ).method ("DELETE" ).to ("/repos/" + owner .login + "/" + name );
317317 }
318318
319319 /**
@@ -323,7 +323,7 @@ public void delete() throws IOException {
323323 * Newly forked repository that belong to you.
324324 */
325325 public GHRepository fork () throws IOException {
326- return new Requester (root ).withCredential (). method ("POST" ).to ("/repos/" + owner .login + "/" + name + "/forks" , GHRepository .class ).wrap (root );
326+ return new Requester (root ).method ("POST" ).to ("/repos/" + owner .login + "/" + name + "/forks" , GHRepository .class ).wrap (root );
327327 }
328328
329329 /**
@@ -333,7 +333,7 @@ public GHRepository fork() throws IOException {
333333 * Newly forked repository that belong to you.
334334 */
335335 public GHRepository forkTo (GHOrganization org ) throws IOException {
336- new Requester (root ).withCredential (). to (String .format ("/repos/%s/%s/forks?org=%s" ,owner .login ,name ,org .getLogin ()));
336+ new Requester (root ).to (String .format ("/repos/%s/%s/forks?org=%s" ,owner .login ,name ,org .getLogin ()));
337337
338338 // this API is asynchronous. we need to wait for a bit
339339 for (int i =0 ; i <10 ; i ++) {
@@ -352,7 +352,7 @@ public GHRepository forkTo(GHOrganization org) throws IOException {
352352 * Retrieves a specified pull request.
353353 */
354354 public GHPullRequest getPullRequest (int i ) throws IOException {
355- return root .retrieve ().withCredential (). to ("/repos/" + owner .login + '/' + name + "/pulls/" + i , GHPullRequest .class ).wrapUp (this );
355+ return root .retrieve ().to ("/repos/" + owner .login + '/' + name + "/pulls/" + i , GHPullRequest .class ).wrapUp (this );
356356 }
357357
358358 /**
@@ -386,14 +386,14 @@ protected void wrapUp(GHPullRequest[] page) {
386386 */
387387 public List <GHHook > getHooks () throws IOException {
388388 List <GHHook > list = new ArrayList <GHHook >(Arrays .asList (
389- root .retrieve ().withCredential (). to (String .format ("/repos/%s/%s/hooks" , owner .login , name ), GHHook [].class )));
389+ root .retrieve ().to (String .format ("/repos/%s/%s/hooks" , owner .login , name ), GHHook [].class )));
390390 for (GHHook h : list )
391391 h .wrap (this );
392392 return list ;
393393 }
394394
395395 public GHHook getHook (int id ) throws IOException {
396- return root .retrieve ().withCredential (). to (String .format ("/repos/%s/%s/hooks/%d" , owner .login , name , id ), GHHook .class ).wrap (this );
396+ return root .retrieve ().to (String .format ("/repos/%s/%s/hooks/%d" , owner .login , name , id ), GHHook .class ).wrap (this );
397397 }
398398
399399 /**
@@ -476,7 +476,6 @@ public GHCommitStatus getLastCommitStatus(String sha1) throws IOException {
476476 */
477477 public GHCommitStatus createCommitStatus (String sha1 , GHCommitState state , String targetUrl , String description ) throws IOException {
478478 return new Requester (root )
479- .withCredential ()
480479 .with ("state" ,state .name ().toLowerCase (Locale .ENGLISH ))
481480 .with ("target_url" , targetUrl )
482481 .with ("description" , description )
@@ -505,7 +504,6 @@ public GHHook createHook(String name, Map<String,String> config, Collection<GHEv
505504 }
506505
507506 return new Requester (root )
508- .withCredential ()
509507 .with ("name" ,name )
510508 .with ("active" , active )
511509 ._with ("config" , config )
@@ -640,7 +638,7 @@ public GHMilestone getMilestone(int number) throws IOException {
640638 }
641639
642640 public GHMilestone createMilestone (String title , String description ) throws IOException {
643- return new Requester (root ). withCredential ()
641+ return new Requester (root )
644642 .with ("title" , title ).with ("description" , description ).method ("POST" ).to ("/repos/" + owner .login + "/" + name + "/milestones" , GHMilestone .class ).wrap (this );
645643 }
646644
0 commit comments