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