com.twilio.base.bearertoken.Creator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twilio Show documentation
Show all versions of twilio Show documentation
Twilio Java Helper Library
The newest version!
package com.twilio.base.bearertoken;
import com.twilio.TwilioOrgsTokenAuth;
import com.twilio.http.bearertoken.BearerTokenTwilioRestClient;
import java.util.concurrent.CompletableFuture;
/**
* Executor for creation of a resource.
*
* @param type of the resource
*/
public abstract class Creator {
/**
* Execute an async request using default client.
*
* @return future that resolves to requested object
*/
public CompletableFuture createAsync() {
return createAsync(TwilioOrgsTokenAuth.getRestClient());
}
/**
* Execute an async request using specified client.
*
* @param client client used to make request
* @return future that resolves to requested object
*/
public CompletableFuture createAsync(final BearerTokenTwilioRestClient client) {
return CompletableFuture.supplyAsync(() -> create(client), TwilioOrgsTokenAuth.getExecutorService());
}
/**
* Execute a request using default client.
*
* @return Requested object
*/
public T create() {
return create(TwilioOrgsTokenAuth.getRestClient());
}
/**
* Execute a request using specified client.
*
* @param client client used to make request
* @return Requested object
*/
public abstract T create(final BearerTokenTwilioRestClient client);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy