public interface SendGridAPI
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
addRequestHeader(String key,
String value)
Adds a request headers.
|
com.sendgrid.Response |
api(com.sendgrid.Request request)
Class api sets up the request to the Twilio SendGrid API, this is main interface.
|
String |
getHost()
Gets the host.
|
String |
getLibraryVersion()
Returns the library version
|
Map<String,String> |
getRequestHeaders()
Gets the request headers.
|
String |
getVersion()
Gets the version.
|
void |
initializeSendGrid(String apiKey)
Initializes Twilio SendGrid
|
com.sendgrid.Response |
makeCall(com.sendgrid.Request request)
Class makeCall makes the call to the Twilio SendGrid API, override this method for
testing.
|
Map<String,String> |
removeRequestHeader(String key)
Removes a request headers.
|
void |
setHost(String host)
Sets the host.
|
void |
setVersion(String version)
Sets the version.
|
void initializeSendGrid(String apiKey)
apiKey - is your Twilio SendGrid API Key: https://app.sendgrid.com/settings/api_keysString getLibraryVersion()
String getVersion()
void setVersion(String version)
version - the Twilio SendGrid version.Map<String,String> getRequestHeaders()
Map<String,String> addRequestHeader(String key, String value)
key - the keyvalue - the valueMap<String,String> removeRequestHeader(String key)
key - the keyString getHost()
void setHost(String host)
host - the host to setcom.sendgrid.Response makeCall(com.sendgrid.Request request)
throws IOException
request - the requestIOException - in case of network or marshal error.com.sendgrid.Response api(com.sendgrid.Request request)
throws IOException
request - the requestIOException - in case of network or marshal error.Copyright © 2020. All rights reserved.