Package io.github._4drian3d.jdwebhooks
Class WebHookClient.Builder
java.lang.Object
io.github._4drian3d.jdwebhooks.WebHookClient.Builder
- Enclosing class:
WebHookClient
Builder for the creation of a new WebHookClient.
-
Method Summary
Modifier and TypeMethodDescriptionSets the user agent to usebuild()Creates a new WebHookClient based on the configuration of this buildercredentials(@NotNull String id, @NotNull String token) Set credentials for sending webhooksSets the client URI
-
Method Details
-
uri
Sets the client URI- Parameters:
uri- the client uri- Returns:
- this builder
- Throws:
IllegalArgumentException- if the provided URL is invalid
-
credentials
public WebHookClient.Builder credentials(@NotNull @NotNull String id, @NotNull @NotNull String token) Set credentials for sending webhooks- Parameters:
id- the webhook idtoken- the webhook token- Returns:
- this builder
- Throws:
IllegalArgumentException- if the provided id or token are is invalid
-
agent
Sets the user agent to use- Parameters:
agent- the user agent- Returns:
- this builder
-
build
Creates a new WebHookClient based on the configuration of this builder- Returns:
- a new WebHookClient
- Throws:
NullPointerException- in case no credentials/uri or user agent have been configured
-