public class SendGrid
extends java.lang.Object
implements java.lang.AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
SendGrid.Email |
static class |
SendGrid.Response |
| Constructor and Description |
|---|
SendGrid(java.lang.String apiKey)
Constructor for using an API key
|
SendGrid(java.lang.String apiKey,
org.apache.http.impl.nio.client.CloseableHttpAsyncClient client)
Constructor for using an API key
|
SendGrid(java.lang.String username,
java.lang.String password)
Constructor for using a username and password
|
SendGrid(java.lang.String username,
java.lang.String password,
org.apache.http.nio.client.HttpAsyncClient client)
Constructor for using a username and password
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.http.HttpEntity |
buildBody(SendGrid.Email email) |
void |
close() |
java.lang.String |
getVersion() |
java.util.concurrent.CompletionStage<SendGrid.Response> |
send(SendGrid.Email email) |
SendGrid |
setEndpoint(java.lang.String endpoint) |
SendGrid |
setUrl(java.lang.String url) |
public SendGrid(java.lang.String username,
java.lang.String password,
org.apache.http.nio.client.HttpAsyncClient client)
username - SendGrid usernamepassword - SendGrid passwordclient - HTTP clientpublic SendGrid(java.lang.String username,
java.lang.String password)
username - SendGrid usernamepassword - SendGrid passwordpublic SendGrid(java.lang.String apiKey,
org.apache.http.impl.nio.client.CloseableHttpAsyncClient client)
apiKey - SendGrid api keyclient - HTTP clientpublic SendGrid(java.lang.String apiKey)
apiKey - SendGrid api keypublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseablejava.io.IOExceptionpublic SendGrid setUrl(java.lang.String url)
public SendGrid setEndpoint(java.lang.String endpoint)
public java.lang.String getVersion()
public org.apache.http.HttpEntity buildBody(SendGrid.Email email)
public java.util.concurrent.CompletionStage<SendGrid.Response> send(SendGrid.Email email)