Package dev.jacrispys.JavaBot.api.libs
Class AgentApiBuilder
java.lang.Object
dev.jacrispys.JavaBot.api.libs.AgentApiBuilder
Builds a 
AgentApi instance to interact with the API.- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected @Nullable Stringprotected @Nullable AgentOptionsprotected @Nullable Stringprotected long
- 
Method SummaryModifier and TypeMethodDescriptionbuild()Builds all previous configurations into one instance of the APIstatic AgentApiBuildercreateClient(@Nullable String authToken) setDeveloperKey(String developerKey) setOptions(AgentOptions options) setUserId(long userId) 
- 
Field Details- 
authToken
- 
userIdprotected long userId
- 
developerKey
- 
clientOptions
 
- 
- 
Method Details- 
createClient- Parameters:
- authToken- token to authenticate to the server with
- Returns:
- new instance of the class to allow setting other variables.
 
- 
setUserId- Parameters:
- userId- Discord user ID to link the User to the API
- Returns:
- current instance of the class to allow setting of other variables.
 
- 
setDeveloperKey- Parameters:
- developerKey- alternate token that verifies credentials for developer access
- Returns:
- current instance of the class to allow setting of other variables.
 
- 
setOptions- Parameters:
- options- advanced configuration options for the API (WIP)
- Returns:
- current instance of the class to allow setting of other variables.
 
- 
buildpublic AgentApi build() throws AuthorizationException, LoginException, SQLException, InterruptedException, ExecutionExceptionBuilds all previous configurations into one instance of the API- Returns:
- instance of the API
- Throws:
- AuthorizationException- if the user's token is not valid
- LoginException- if logging into DiscordAPI fails
- SQLException- if a database error occurs
- InterruptedException- if logging into the database fails
- ExecutionException- if obtaining a SqlInstanceManager fails.
 
 
-