com.baidubce.services.ses
Class SesClient

java.lang.Object
  extended by com.baidubce.AbstractBceClient
      extended by com.baidubce.services.ses.SesClientSupport
          extended by com.baidubce.services.ses.SesClient

public class SesClient
extends SesClientSupport

The entrance class for all client access to the API of SES(Baidu email Service).

All of the API method of SES is includes in this class.


Field Summary
 
Fields inherited from class com.baidubce.services.ses.SesClientSupport
DEFAULT_EMAIL_PATTERN, logger, SES_HANDLERS
 
Fields inherited from class com.baidubce.AbstractBceClient
config, DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING, DEFAULT_SERVICE_DOMAIN, URL_PREFIX
 
Constructor Summary
SesClient()
          Constructs a new SesClient instance with default settings.
SesClient(SesClientConfiguration config)
          Constructs a new SesClient instance with the specified configuration.
 
Method Summary
 void deleteVerifiedDomain(DeleteVerifiedDomainRequest request)
          Delete the domain
 void deleteVerifiedDomain(String domainName)
           
 void deleteVerifiedEmail(DeleteVerifiedEmailRequest request)
          Delete verified email address
 void deleteVerifiedEmail(String emailAddress)
           
 void disableDKIM(EnableDKIMRequest request)
          Disable the DKIM
 void disableDKIM(String domainName)
           
 void enableDKIM(EnableDKIMRequest request)
          Enable the DKIM
 void enableDKIM(String domainName)
           
 GetFailedReasonResponse getFailedReason()
           
 GetFailedReasonResponse getFailedReason(SesRequest request)
          Query the failed reason
 GetFeedbackResponse getFeedback()
           
 GetFeedbackResponse getFeedback(SesRequest request)
          Get feedback
 GetQuotaResponse getQuota()
           
 GetQuotaResponse getQuota(SesRequest request)
          Get quota
 GetVerifiedDomainResponse getVerifiedDomain(GetVerifiedDomainRequest request)
          Get the detail of specifical verified domain
 GetVerifiedDomainResponse getVerifiedDomain(String domainName)
           
 GetVerifiedEmailResponse getVerifiedEmail(GetVerifiedEmailRequest request)
          Get the detail of verified email address
 GetVerifiedEmailResponse getVerifiedEmail(String emailAddress)
           
 IsInRecipientBlacklistResponse isInRecipientBlacklist(IsInRecipientBlacklistRequest request)
          Query the special receiver is in blacklist or not
 IsInRecipientBlacklistResponse isInRecipientBlacklist(String emailAddress)
           
 ListRecipientBlacklistResponse listRecipientBlacklist()
           
 ListRecipientBlacklistResponse listRecipientBlacklist(SesRequest request)
          Get the list of blacklist
 ListVerifiedDomainResponse listVerifiedDomain()
           
 ListVerifiedDomainResponse listVerifiedDomain(SesRequest request)
          Get the list of verified domain
 ListVerifiedEmailResponse listVerifiedEmail()
           
 ListVerifiedEmailResponse listVerifiedEmail(SesRequest request)
          Get the list of verified email address
 SendEmailResponse sendEmail(SendEmailRequest request)
          Send email
 SendEmailResponse sendEmail(String from, String[] toAddr, String subject, String body, File... attachmentFiles)
          Send email.
 SendEmailResponse sendEmail(String from, String displayName, String[] toAddr, String[] ccAddr, String[] bccAddr, String subject, String body, File... attachmentFiles)
          Send email.
 SendEmailResponse sendEmail(String from, String displayName, String[] toAddr, String subject, String body, File... attachmentFiles)
          Send email.
 SendEmailResponse sendEmail(String from, String displayName, String returnPath, String replyTo, String[] toAddr, String[] ccAddr, String[] bccAddr, String subject, String body, int priority, int charset, File... attachmentFiles)
          Send email.
 void setFeedback(SetFeedbackRequest request)
          Set feedback
 void setQuota(SetQuotaRequest request)
          Set quota
 VerifyDKIMResponse verifyDKIM(String domainName)
           
 VerifyDKIMResponse verifyDKIM(VerifyDKIMRequest request)
          Verify the DKIM
 VerifyDomainResponse verifyDomain(String domainName)
           
 VerifyDomainResponse verifyDomain(VerifyDomainRequest request)
          Verify the domain
 void verifyEmail(String emailAddress)
           
 void verifyEmail(VerifyEmailRequest request)
          Verify email address
 
Methods inherited from class com.baidubce.services.ses.SesClientSupport
assertListNotNullOrEmpty, assertStringArrayNotNullOrEmpty, assertStringNotNullOrEmpty, checkIsEmail, checkIsInteger, createRequest, fillRequestPayload, getBASE64EncoderStrFromInputStream
 
Methods inherited from class com.baidubce.AbstractBceClient
getClient, getEndpoint, getServiceId, invokeHttpClient, isRegionSupported, setClient, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SesClient

public SesClient()
Constructs a new SesClient instance with default settings.


SesClient

public SesClient(SesClientConfiguration config)
Constructs a new SesClient instance with the specified configuration.

Parameters:
config - the specified configuration, default inherit super class com.baidubce.BceClientConfiguration
Method Detail

verifyEmail

public void verifyEmail(String emailAddress)

verifyEmail

public void verifyEmail(VerifyEmailRequest request)
Verify email address

Parameters:
request - The request object includes the URL address to verify, refer to com.baidubce.services.ses.model.VerifyEmailRequest
See Also:
VerifyEmailRequest

listVerifiedEmail

public ListVerifiedEmailResponse listVerifiedEmail()

listVerifiedEmail

public ListVerifiedEmailResponse listVerifiedEmail(SesRequest request)
Get the list of verified email address

Parameters:
request - The request object which it's credentials can be override
Returns:
The response object includes the detail of verified email address, refer to com.baidubce.services.ses.model.ListVerifiedEmailResponse
See Also:
ListVerifiedEmailResponse

getVerifiedEmail

public GetVerifiedEmailResponse getVerifiedEmail(String emailAddress)

getVerifiedEmail

public GetVerifiedEmailResponse getVerifiedEmail(GetVerifiedEmailRequest request)
Get the detail of verified email address

Parameters:
request - The request object includes email address to get
Returns:
The response object includes the detail of verified email address, refer to com.baidubce.services.ses.model.GetVerifiedEmailResponse
See Also:
GetVerifiedEmailRequest, GetVerifiedEmailResponse

deleteVerifiedEmail

public void deleteVerifiedEmail(String emailAddress)

deleteVerifiedEmail

public void deleteVerifiedEmail(DeleteVerifiedEmailRequest request)
Delete verified email address

Parameters:
request - The request object includes the email address to delete, refer to com.baidubce.services.ses.model.DeleteVerifiedEmailRequest
See Also:
DeleteVerifiedEmailRequest

verifyDomain

public VerifyDomainResponse verifyDomain(String domainName)

verifyDomain

public VerifyDomainResponse verifyDomain(VerifyDomainRequest request)
Verify the domain

When this API is called successfully, it will return a token which is used to verify domain. You should put the token into DSN setting as a TXT record, then SES can finish verifying automatically.

Parameters:
request - The request object which includes the domain to verify
See Also:
VerifyDomainRequest

verifyDKIM

public VerifyDKIMResponse verifyDKIM(String domainName)

verifyDKIM

public VerifyDKIMResponse verifyDKIM(VerifyDKIMRequest request)
Verify the DKIM

When this API is called successfully, it will return a group of tokens,you should use this tokens to create DSN CNAME records, then SES can finish verifying automatically.

Parameters:
request - The request object which includes the DKIM to verify
Returns:
The response object includes a group of tokens
See Also:
VerifyDKIMRequest, VerifyDKIMResponse

disableDKIM

public void disableDKIM(String domainName)

disableDKIM

public void disableDKIM(EnableDKIMRequest request)
Disable the DKIM

Disable or enable DKIM the specifical email or domain, if enabled then SES will add DKIM for all the email about the email and domain.

Parameters:
request - The request object which includes domain to disable
See Also:
EnableDKIMRequest

enableDKIM

public void enableDKIM(String domainName)

enableDKIM

public void enableDKIM(EnableDKIMRequest request)
Enable the DKIM

Disable or enable DKIM the specifical email or domain, if enabled then SES will add DKIM for all the email about the email and domain.

Parameters:
request - The request object which includes domain to enable

listVerifiedDomain

public ListVerifiedDomainResponse listVerifiedDomain()

listVerifiedDomain

public ListVerifiedDomainResponse listVerifiedDomain(SesRequest request)
Get the list of verified domain

Parameters:
request - The request object which it's credentials can be override
Returns:
The response object which includes the detail of verified domain
See Also:
ListVerifiedDomainResponse

getVerifiedDomain

public GetVerifiedDomainResponse getVerifiedDomain(String domainName)

getVerifiedDomain

public GetVerifiedDomainResponse getVerifiedDomain(GetVerifiedDomainRequest request)
Get the detail of specifical verified domain

Parameters:
request - The request object which includes the domain to get
Returns:
The response object which includes the detail of verified domain
See Also:
GetVerifiedDomainResponse

deleteVerifiedDomain

public void deleteVerifiedDomain(String domainName)

deleteVerifiedDomain

public void deleteVerifiedDomain(DeleteVerifiedDomainRequest request)
Delete the domain

Parameters:
request - The request object which includes the domain to delete
See Also:
DeleteVerifiedDomainRequest

sendEmail

public SendEmailResponse sendEmail(String from,
                                   String[] toAddr,
                                   String subject,
                                   String body,
                                   File... attachmentFiles)
Send email.

Simple to send email without display name, all optional parameters use system default value.

Parameters:
from - The sender, which is required
toAddr - The receive, which is required
subject - The title of the email, which is required
body - The content of the email, which is required
attachmentFiles - The array of attachment file. If you need send attachment then set it, it's optional parameters
See Also:
sendEmail(com.baidubce.services.ses.model.SendEmailRequest request)

sendEmail

public SendEmailResponse sendEmail(String from,
                                   String displayName,
                                   String[] toAddr,
                                   String subject,
                                   String body,
                                   File... attachmentFiles)
Send email.

Simple to send email, all optional parameters use system default value.

Parameters:
from - The sender, which is required
displayName - The display name of sender, which can be custom by the users themselves
toAddr - The receive, which is required
subject - The title of the email, which is required
body - The content of the email, which is required
attachmentFiles - The array of attachment file. If you need send attachment then set it, it's optional parameters
See Also:
sendEmail(com.baidubce.services.ses.model.SendEmailRequest request)

sendEmail

public SendEmailResponse sendEmail(String from,
                                   String displayName,
                                   String[] toAddr,
                                   String[] ccAddr,
                                   String[] bccAddr,
                                   String subject,
                                   String body,
                                   File... attachmentFiles)
Send email.

Simple to send email, partly optional parameters use system default value.

Parameters:
from - The sender, which is required
displayName - The display name of sender, which can be custom by the users themselves
toAddr - The receive, which is required
ccAddr - The CC, which is optional
bccAddr - The BCC which is optional
subject - The title of the email, which is required
body - The content of the email, which is required
attachmentFiles - The array of attachment file. If you need send attachment then set it, it's optional parameters
See Also:
sendEmail(com.baidubce.services.ses.model.SendEmailRequest request)

sendEmail

public SendEmailResponse sendEmail(String from,
                                   String displayName,
                                   String returnPath,
                                   String replyTo,
                                   String[] toAddr,
                                   String[] ccAddr,
                                   String[] bccAddr,
                                   String subject,
                                   String body,
                                   int priority,
                                   int charset,
                                   File... attachmentFiles)
Send email.

Full to send email, all optional parameters need you set.

Parameters:
from - The sender, which is required
displayName - The display name of sender, which can be custom by the users themselves
returnPath - Optional parameters
replyTo - Optional parameters
toAddr - The receive, which is required
ccAddr - The CC, which is optional
bccAddr - The BCC which is optional
subject - The title of the email, which is required
body - The content of the email, which is required
priority - The priority of the email, which is Optional
charset - The charset of the email, which is Optional
attachmentFiles - The array of attachment file. If you need send attachment then set it, it's optional parameters
See Also:
sendEmail(com.baidubce.services.ses.model.SendEmailRequest request)

sendEmail

public SendEmailResponse sendEmail(SendEmailRequest request)
Send email

This method allow you to construct request object by yourself.

Parameters:
request - The request object which includes the parameters of sending mail, you can see detail from class com.baidubce.services.ses.model.SendEmailRequest
See Also:
SendEmailRequest

setFeedback

public void setFeedback(SetFeedbackRequest request)
Set feedback

Parameters:
request - The request object which includes the feedback information to set
See Also:
SetFeedbackRequest

getFeedback

public GetFeedbackResponse getFeedback()

getFeedback

public GetFeedbackResponse getFeedback(SesRequest request)
Get feedback

Parameters:
request - The request object which it's credentials can be override
Returns:
The response object which includes the feedback information
See Also:
GetFeedbackResponse

getQuota

public GetQuotaResponse getQuota()

getQuota

public GetQuotaResponse getQuota(SesRequest request)
Get quota

Parameters:
request - The request object which it's credentials can be override
Returns:
The response object which includes the detail of quota
See Also:
GetQuotaResponse

setQuota

public void setQuota(SetQuotaRequest request)
Set quota

Parameters:
request - The request object which includes the information of quota to set
See Also:
SetQuotaRequest

listRecipientBlacklist

public ListRecipientBlacklistResponse listRecipientBlacklist()

listRecipientBlacklist

public ListRecipientBlacklistResponse listRecipientBlacklist(SesRequest request)
Get the list of blacklist

Parameters:
request - The request object which it's credentials can be override
Returns:
The response which includes the detail of blacklist
See Also:
ListRecipientBlacklistResponse

isInRecipientBlacklist

public IsInRecipientBlacklistResponse isInRecipientBlacklist(String emailAddress)

isInRecipientBlacklist

public IsInRecipientBlacklistResponse isInRecipientBlacklist(IsInRecipientBlacklistRequest request)
Query the special receiver is in blacklist or not

Parameters:
request - The request object which includes the special receiver
Returns:
The response result which includes the result of receiver in blacklist or not
See Also:
IsInRecipientBlacklistResponse

getFailedReason

public GetFailedReasonResponse getFailedReason()

getFailedReason

public GetFailedReasonResponse getFailedReason(SesRequest request)
Query the failed reason

Parameters:
request - The request object which it's credentials can be override
Returns:
The response which includes the detail of failed reason
See Also:
GetFailedReasonResponse


Copyright © 2018. All rights reserved.