Package com.vonage.client
Class VonageClient.Builder
java.lang.Object
com.vonage.client.VonageClient.Builder
- Enclosing class:
- VonageClient
public static class VonageClient.Builder extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description Builder() -
Method Summary
Modifier and Type Method Description VonageClient.BuilderapiKey(java.lang.String apiKey)When setting an apiKey, it is also expected thatapiSecret(String)and/orsignatureSecret(String)will also be set.VonageClient.BuilderapiSecret(java.lang.String apiSecret)When setting an apiSecret, it is also expected thatapiKey(String)will also be set.VonageClient.BuilderapplicationId(java.lang.String applicationId)When setting an applicationId, it is also expected that theprivateKeyContentswill also be set.VonageClientbuild()VonageClient.BuilderhttpClient(org.apache.http.client.HttpClient httpClient)VonageClient.BuilderhttpConfig(HttpConfig httpConfig)VonageClient.BuilderprivateKeyContents(byte[] privateKeyContents)When setting the contents of your private key, it is also expected thatapplicationId(String)will also be set.VonageClient.BuilderprivateKeyContents(java.lang.String privateKeyContents)When setting the contents of your private key, it is also expected thatapplicationId(String)will also be set.VonageClient.BuilderprivateKeyPath(java.lang.String privateKeyPath)When setting the path of your private key, it is also expected thatapplicationId(String)will also be set.VonageClient.BuilderprivateKeyPath(java.nio.file.Path privateKeyPath)When setting the path of your private key, it is also expected thatapplicationId(String)will also be set.VonageClient.BuildersignatureSecret(java.lang.String signatureSecret)When setting a signatureSecret, it is also expected thatapiKey(String)will also be set.
-
Constructor Details
-
Method Details
-
httpConfig
- Parameters:
httpConfig- Configuration options for theHttpWrapper- Returns:
- The
VonageClient.Builderto keep building.
-
httpClient
- Parameters:
httpClient- Custom implementation ofHttpClient.- Returns:
- The
VonageClient.Builderto keep building.
-
applicationId
When setting an applicationId, it is also expected that theprivateKeyContentswill also be set.- Parameters:
applicationId- Used to identify each application.- Returns:
- The
VonageClient.Builderto keep building.
-
apiKey
When setting an apiKey, it is also expected thatapiSecret(String)and/orsignatureSecret(String)will also be set.- Parameters:
apiKey- The API Key found in the dashboard for your account.- Returns:
- The
VonageClient.Builderto keep building.
-
apiSecret
When setting an apiSecret, it is also expected thatapiKey(String)will also be set.- Parameters:
apiSecret- The API Secret found in the dashboard for your account.- Returns:
- The
VonageClient.Builderto keep building.
-
signatureSecret
When setting a signatureSecret, it is also expected thatapiKey(String)will also be set.- Parameters:
signatureSecret- The Signature Secret found in the dashboard for your account.- Returns:
- The
VonageClient.Builderto keep building.
-
privateKeyContents
When setting the contents of your private key, it is also expected thatapplicationId(String)will also be set.- Parameters:
privateKeyContents- The contents of your private key used for JWT generation.- Returns:
- The
VonageClient.Builderto keep building.
-
privateKeyContents
When setting the contents of your private key, it is also expected thatapplicationId(String)will also be set.- Parameters:
privateKeyContents- The contents of your private key used for JWT generation.- Returns:
- The
VonageClient.Builderto keep building.
-
privateKeyPath
public VonageClient.Builder privateKeyPath(java.nio.file.Path privateKeyPath) throws VonageUnableToReadPrivateKeyExceptionWhen setting the path of your private key, it is also expected thatapplicationId(String)will also be set.- Parameters:
privateKeyPath- The path to your private key used for JWT generation.- Returns:
- The
VonageClient.Builderto keep building. - Throws:
VonageUnableToReadPrivateKeyException- if the private key could not be read from the file system.
-
privateKeyPath
public VonageClient.Builder privateKeyPath(java.lang.String privateKeyPath) throws VonageUnableToReadPrivateKeyExceptionWhen setting the path of your private key, it is also expected thatapplicationId(String)will also be set.- Parameters:
privateKeyPath- The path to your private key used for JWT generation.- Returns:
- The
VonageClient.Builderto keep building. - Throws:
VonageUnableToReadPrivateKeyException- if the private key could not be read from the file system.
-
build
- Returns:
- a new
VonageClientfrom the stored builder options. - Throws:
VonageClientCreationException- if credentials aren't provided in a valid pairing or there were issues generating anJWTAuthMethodwith the provided credentials.
-