@Override public void merge( final String msg) throws IOException { final JsonStructure json = Json.createObjectBuilder() .add("commit_message", msg) .build(); this.merge(json).assertStatus(HttpURLConnection.HTTP_OK); }
@Override public void remove() throws IOException { this.request.method(Request.DELETE).fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); }
@Override public void remove() throws IOException { this.request.method(Request.DELETE).fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); }
@Override public void remove() throws IOException { this.request.method(Request.DELETE).fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); }
@Override public void star() throws IOException { this.request .method(Request.PUT) .fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); }
@Override public void delete() throws IOException { this.request.method(Request.DELETE).fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); }
@Override public void remove(final int number) throws IOException { this.request.method(Request.DELETE) .uri().path(Integer.toString(number)).back() .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); }
@Override public void remove(final int number) throws IOException { this.request.uri().path(String.valueOf(number)).back() .method(Request.DELETE) .fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); } }
@Override public void remove(final int number) throws IOException { this.request.method(Request.DELETE) .uri().path(Integer.toString(number)).back() .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); }
@Override public void remove(final int number) throws IOException { this.request.method(Request.DELETE) .uri().path(Integer.toString(number)).back() .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); }
@Override public void react(final Reaction reaction) throws IOException { final JsonStructure json = Json.createObjectBuilder() .add(RtComment.CONTENT, reaction.type()) .build(); this.request.method(Request.POST) .body().set(json).back() .fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK); }
@Override public void react(final Reaction reaction) throws IOException { final JsonStructure json = Json.createObjectBuilder() .add(RtIssue.CONTENT, reaction.type()) .build(); this.request.method(Request.POST) .body().set(json).back() .fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK); }
/** * Fetch JSON object. * @return JSON object * @throws IOException If fails */ public JsonObject fetch() throws IOException { return this.request.fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(JsonResponse.class) .json().readObject(); }
@Override public void delete(final String name) throws IOException { this.request.method(Request.DELETE) .uri().path(name).back() .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); }
@Override public void unstar() throws IOException { this.request.uri().path("star").back() .method(Request.DELETE) .fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); }
@Override public void remove( final String identifier ) throws IOException { this.request.method(Request.DELETE) .uri().path(identifier).back() .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); } }
@Override public void remove( final Coordinates coords) throws IOException { this.entry.uri().path("/repos") .back().method(Request.DELETE) .uri().path(coords.toString()).back() .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); }
@Override public void conceal( final User user ) throws IOException { this.request .uri().path(user.login()).back() .method(Request.DELETE) .fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_NO_CONTENT); }
@Override public boolean starred() throws IOException { return this.request.uri().path("star").back() .method("GET").fetch() .as(RestResponse.class).assertStatus( Matchers.isOneOf( HttpURLConnection.HTTP_NO_CONTENT, HttpURLConnection.HTTP_NOT_FOUND ) ).status() == HttpURLConnection.HTTP_NO_CONTENT; }
@Override public Gist fork() throws IOException { return new RtGist( this.ghub, this.entry, this.request.uri().path("/forks").back() .method(Request.POST) .fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_CREATED) .as(JsonResponse.class) .json().readObject().getString("id") ); }