user.fetch("https://api.github.com/user/emails", res2 -> { if (res2.failed()) {
/** * Fetches a JSON resource using this Access Token. * @param resource - the resource to fetch. * @param callback - The callback function returning the results. * @return */ public io.vertx.rxjava.ext.auth.oauth2.AccessToken fetch(String resource, Handler<AsyncResult<io.vertx.rxjava.ext.auth.oauth2.OAuth2Response>> callback) { delegate.fetch(resource, new Handler<AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Response>>() { public void handle(AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Response> ar) { if (ar.succeeded()) { callback.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.ext.auth.oauth2.OAuth2Response.newInstance(ar.result()))); } else { callback.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); return this; }
/** * Fetches a JSON resource using this Access Token. * @param resource - the resource to fetch. * @param callback - The callback function returning the results. * @return */ public io.vertx.rxjava.ext.auth.oauth2.AccessToken fetch(String resource, Handler<AsyncResult<io.vertx.rxjava.ext.auth.oauth2.OAuth2Response>> callback) { delegate.fetch(resource, new Handler<AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Response>>() { public void handle(AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Response> ar) { if (ar.succeeded()) { callback.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.ext.auth.oauth2.OAuth2Response.newInstance(ar.result()))); } else { callback.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); return this; }
/** * Fetches a JSON resource using this Access Token. * * @param resource - the resource to fetch. * @param callback - The callback function returning the results. */ @Fluent default AccessToken fetch(String resource, Handler<AsyncResult<OAuth2Response>> callback) { return fetch(HttpMethod.GET, resource, null, null, callback); }
/** * Fetches a JSON resource using this Access Token. * @param method - the HTTP method to user. * @param resource - the resource to fetch. * @param headers - extra headers to pass to the request. * @param payload - payload to send to the server. * @param callback - The callback function returning the results. * @return */ public io.vertx.rxjava.ext.auth.oauth2.AccessToken fetch(HttpMethod method, String resource, JsonObject headers, io.vertx.rxjava.core.buffer.Buffer payload, Handler<AsyncResult<io.vertx.rxjava.ext.auth.oauth2.OAuth2Response>> callback) { delegate.fetch(method, resource, headers, payload.getDelegate(), new Handler<AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Response>>() { public void handle(AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Response> ar) { if (ar.succeeded()) { callback.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.ext.auth.oauth2.OAuth2Response.newInstance(ar.result()))); } else { callback.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); return this; }
/** * Fetches a JSON resource using this Access Token. * @param method - the HTTP method to user. * @param resource - the resource to fetch. * @param headers - extra headers to pass to the request. * @param payload - payload to send to the server. * @param callback - The callback function returning the results. * @return */ public io.vertx.rxjava.ext.auth.oauth2.AccessToken fetch(HttpMethod method, String resource, JsonObject headers, io.vertx.rxjava.core.buffer.Buffer payload, Handler<AsyncResult<io.vertx.rxjava.ext.auth.oauth2.OAuth2Response>> callback) { delegate.fetch(method, resource, headers, payload.getDelegate(), new Handler<AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Response>>() { public void handle(AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Response> ar) { if (ar.succeeded()) { callback.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.ext.auth.oauth2.OAuth2Response.newInstance(ar.result()))); } else { callback.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); return this; }
public static io.vertx.ext.auth.oauth2.AccessToken fetch(io.vertx.ext.auth.oauth2.AccessToken j_receiver, io.vertx.core.http.HttpMethod method, java.lang.String resource, java.util.Map<String, Object> headers, io.vertx.core.buffer.Buffer payload, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Response>> callback) { io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.fetch(method, resource, headers != null ? io.vertx.core.impl.ConversionHelper.toJsonObject(headers) : null, payload, callback != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Response>>() { public void handle(io.vertx.core.AsyncResult<io.vertx.ext.auth.oauth2.OAuth2Response> ar) { callback.handle(ar.map(event -> io.vertx.core.impl.ConversionHelper.fromObject(event))); } } : null)); return j_receiver; } }