
software.amazon.awssdk.services.pinpointemail.DefaultPinpointEmailClient Maven / Gradle / Ivy
Show all versions of pinpointemail Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.pinpointemail;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.awscore.retry.AwsRetryStrategy;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.retry.RetryMode;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.retries.api.RetryStrategy;
import software.amazon.awssdk.services.pinpointemail.internal.PinpointEmailServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.pinpointemail.model.AccountSuspendedException;
import software.amazon.awssdk.services.pinpointemail.model.AlreadyExistsException;
import software.amazon.awssdk.services.pinpointemail.model.BadRequestException;
import software.amazon.awssdk.services.pinpointemail.model.ConcurrentModificationException;
import software.amazon.awssdk.services.pinpointemail.model.CreateConfigurationSetEventDestinationRequest;
import software.amazon.awssdk.services.pinpointemail.model.CreateConfigurationSetEventDestinationResponse;
import software.amazon.awssdk.services.pinpointemail.model.CreateConfigurationSetRequest;
import software.amazon.awssdk.services.pinpointemail.model.CreateConfigurationSetResponse;
import software.amazon.awssdk.services.pinpointemail.model.CreateDedicatedIpPoolRequest;
import software.amazon.awssdk.services.pinpointemail.model.CreateDedicatedIpPoolResponse;
import software.amazon.awssdk.services.pinpointemail.model.CreateDeliverabilityTestReportRequest;
import software.amazon.awssdk.services.pinpointemail.model.CreateDeliverabilityTestReportResponse;
import software.amazon.awssdk.services.pinpointemail.model.CreateEmailIdentityRequest;
import software.amazon.awssdk.services.pinpointemail.model.CreateEmailIdentityResponse;
import software.amazon.awssdk.services.pinpointemail.model.DeleteConfigurationSetEventDestinationRequest;
import software.amazon.awssdk.services.pinpointemail.model.DeleteConfigurationSetEventDestinationResponse;
import software.amazon.awssdk.services.pinpointemail.model.DeleteConfigurationSetRequest;
import software.amazon.awssdk.services.pinpointemail.model.DeleteConfigurationSetResponse;
import software.amazon.awssdk.services.pinpointemail.model.DeleteDedicatedIpPoolRequest;
import software.amazon.awssdk.services.pinpointemail.model.DeleteDedicatedIpPoolResponse;
import software.amazon.awssdk.services.pinpointemail.model.DeleteEmailIdentityRequest;
import software.amazon.awssdk.services.pinpointemail.model.DeleteEmailIdentityResponse;
import software.amazon.awssdk.services.pinpointemail.model.GetAccountRequest;
import software.amazon.awssdk.services.pinpointemail.model.GetAccountResponse;
import software.amazon.awssdk.services.pinpointemail.model.GetBlacklistReportsRequest;
import software.amazon.awssdk.services.pinpointemail.model.GetBlacklistReportsResponse;
import software.amazon.awssdk.services.pinpointemail.model.GetConfigurationSetEventDestinationsRequest;
import software.amazon.awssdk.services.pinpointemail.model.GetConfigurationSetEventDestinationsResponse;
import software.amazon.awssdk.services.pinpointemail.model.GetConfigurationSetRequest;
import software.amazon.awssdk.services.pinpointemail.model.GetConfigurationSetResponse;
import software.amazon.awssdk.services.pinpointemail.model.GetDedicatedIpRequest;
import software.amazon.awssdk.services.pinpointemail.model.GetDedicatedIpResponse;
import software.amazon.awssdk.services.pinpointemail.model.GetDedicatedIpsRequest;
import software.amazon.awssdk.services.pinpointemail.model.GetDedicatedIpsResponse;
import software.amazon.awssdk.services.pinpointemail.model.GetDeliverabilityDashboardOptionsRequest;
import software.amazon.awssdk.services.pinpointemail.model.GetDeliverabilityDashboardOptionsResponse;
import software.amazon.awssdk.services.pinpointemail.model.GetDeliverabilityTestReportRequest;
import software.amazon.awssdk.services.pinpointemail.model.GetDeliverabilityTestReportResponse;
import software.amazon.awssdk.services.pinpointemail.model.GetDomainDeliverabilityCampaignRequest;
import software.amazon.awssdk.services.pinpointemail.model.GetDomainDeliverabilityCampaignResponse;
import software.amazon.awssdk.services.pinpointemail.model.GetDomainStatisticsReportRequest;
import software.amazon.awssdk.services.pinpointemail.model.GetDomainStatisticsReportResponse;
import software.amazon.awssdk.services.pinpointemail.model.GetEmailIdentityRequest;
import software.amazon.awssdk.services.pinpointemail.model.GetEmailIdentityResponse;
import software.amazon.awssdk.services.pinpointemail.model.LimitExceededException;
import software.amazon.awssdk.services.pinpointemail.model.ListConfigurationSetsRequest;
import software.amazon.awssdk.services.pinpointemail.model.ListConfigurationSetsResponse;
import software.amazon.awssdk.services.pinpointemail.model.ListDedicatedIpPoolsRequest;
import software.amazon.awssdk.services.pinpointemail.model.ListDedicatedIpPoolsResponse;
import software.amazon.awssdk.services.pinpointemail.model.ListDeliverabilityTestReportsRequest;
import software.amazon.awssdk.services.pinpointemail.model.ListDeliverabilityTestReportsResponse;
import software.amazon.awssdk.services.pinpointemail.model.ListDomainDeliverabilityCampaignsRequest;
import software.amazon.awssdk.services.pinpointemail.model.ListDomainDeliverabilityCampaignsResponse;
import software.amazon.awssdk.services.pinpointemail.model.ListEmailIdentitiesRequest;
import software.amazon.awssdk.services.pinpointemail.model.ListEmailIdentitiesResponse;
import software.amazon.awssdk.services.pinpointemail.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.pinpointemail.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.pinpointemail.model.MailFromDomainNotVerifiedException;
import software.amazon.awssdk.services.pinpointemail.model.MessageRejectedException;
import software.amazon.awssdk.services.pinpointemail.model.NotFoundException;
import software.amazon.awssdk.services.pinpointemail.model.PinpointEmailException;
import software.amazon.awssdk.services.pinpointemail.model.PutAccountDedicatedIpWarmupAttributesRequest;
import software.amazon.awssdk.services.pinpointemail.model.PutAccountDedicatedIpWarmupAttributesResponse;
import software.amazon.awssdk.services.pinpointemail.model.PutAccountSendingAttributesRequest;
import software.amazon.awssdk.services.pinpointemail.model.PutAccountSendingAttributesResponse;
import software.amazon.awssdk.services.pinpointemail.model.PutConfigurationSetDeliveryOptionsRequest;
import software.amazon.awssdk.services.pinpointemail.model.PutConfigurationSetDeliveryOptionsResponse;
import software.amazon.awssdk.services.pinpointemail.model.PutConfigurationSetReputationOptionsRequest;
import software.amazon.awssdk.services.pinpointemail.model.PutConfigurationSetReputationOptionsResponse;
import software.amazon.awssdk.services.pinpointemail.model.PutConfigurationSetSendingOptionsRequest;
import software.amazon.awssdk.services.pinpointemail.model.PutConfigurationSetSendingOptionsResponse;
import software.amazon.awssdk.services.pinpointemail.model.PutConfigurationSetTrackingOptionsRequest;
import software.amazon.awssdk.services.pinpointemail.model.PutConfigurationSetTrackingOptionsResponse;
import software.amazon.awssdk.services.pinpointemail.model.PutDedicatedIpInPoolRequest;
import software.amazon.awssdk.services.pinpointemail.model.PutDedicatedIpInPoolResponse;
import software.amazon.awssdk.services.pinpointemail.model.PutDedicatedIpWarmupAttributesRequest;
import software.amazon.awssdk.services.pinpointemail.model.PutDedicatedIpWarmupAttributesResponse;
import software.amazon.awssdk.services.pinpointemail.model.PutDeliverabilityDashboardOptionRequest;
import software.amazon.awssdk.services.pinpointemail.model.PutDeliverabilityDashboardOptionResponse;
import software.amazon.awssdk.services.pinpointemail.model.PutEmailIdentityDkimAttributesRequest;
import software.amazon.awssdk.services.pinpointemail.model.PutEmailIdentityDkimAttributesResponse;
import software.amazon.awssdk.services.pinpointemail.model.PutEmailIdentityFeedbackAttributesRequest;
import software.amazon.awssdk.services.pinpointemail.model.PutEmailIdentityFeedbackAttributesResponse;
import software.amazon.awssdk.services.pinpointemail.model.PutEmailIdentityMailFromAttributesRequest;
import software.amazon.awssdk.services.pinpointemail.model.PutEmailIdentityMailFromAttributesResponse;
import software.amazon.awssdk.services.pinpointemail.model.SendEmailRequest;
import software.amazon.awssdk.services.pinpointemail.model.SendEmailResponse;
import software.amazon.awssdk.services.pinpointemail.model.SendingPausedException;
import software.amazon.awssdk.services.pinpointemail.model.TagResourceRequest;
import software.amazon.awssdk.services.pinpointemail.model.TagResourceResponse;
import software.amazon.awssdk.services.pinpointemail.model.TooManyRequestsException;
import software.amazon.awssdk.services.pinpointemail.model.UntagResourceRequest;
import software.amazon.awssdk.services.pinpointemail.model.UntagResourceResponse;
import software.amazon.awssdk.services.pinpointemail.model.UpdateConfigurationSetEventDestinationRequest;
import software.amazon.awssdk.services.pinpointemail.model.UpdateConfigurationSetEventDestinationResponse;
import software.amazon.awssdk.services.pinpointemail.transform.CreateConfigurationSetEventDestinationRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.CreateConfigurationSetRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.CreateDedicatedIpPoolRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.CreateDeliverabilityTestReportRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.CreateEmailIdentityRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.DeleteConfigurationSetEventDestinationRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.DeleteConfigurationSetRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.DeleteDedicatedIpPoolRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.DeleteEmailIdentityRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.GetAccountRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.GetBlacklistReportsRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.GetConfigurationSetEventDestinationsRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.GetConfigurationSetRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.GetDedicatedIpRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.GetDedicatedIpsRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.GetDeliverabilityDashboardOptionsRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.GetDeliverabilityTestReportRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.GetDomainDeliverabilityCampaignRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.GetDomainStatisticsReportRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.GetEmailIdentityRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.ListConfigurationSetsRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.ListDedicatedIpPoolsRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.ListDeliverabilityTestReportsRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.ListDomainDeliverabilityCampaignsRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.ListEmailIdentitiesRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.PutAccountDedicatedIpWarmupAttributesRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.PutAccountSendingAttributesRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.PutConfigurationSetDeliveryOptionsRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.PutConfigurationSetReputationOptionsRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.PutConfigurationSetSendingOptionsRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.PutConfigurationSetTrackingOptionsRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.PutDedicatedIpInPoolRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.PutDedicatedIpWarmupAttributesRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.PutDeliverabilityDashboardOptionRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.PutEmailIdentityDkimAttributesRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.PutEmailIdentityFeedbackAttributesRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.PutEmailIdentityMailFromAttributesRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.SendEmailRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.pinpointemail.transform.UpdateConfigurationSetEventDestinationRequestMarshaller;
import software.amazon.awssdk.utils.Logger;
/**
* Internal implementation of {@link PinpointEmailClient}.
*
* @see PinpointEmailClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultPinpointEmailClient implements PinpointEmailClient {
private static final Logger log = Logger.loggerFor(DefaultPinpointEmailClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.REST_JSON).build();
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultPinpointEmailClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Create a configuration set. Configuration sets are groups of rules that you can apply to the emails you
* send using Amazon Pinpoint. You apply a configuration set to an email by including a reference to the
* configuration set in the headers of the email. When you apply a configuration set to an email, all of the rules
* in that configuration set are applied to the email.
*
*
* @param createConfigurationSetRequest
* A request to create a configuration set.
* @return Result of the CreateConfigurationSet operation returned by the service.
* @throws AlreadyExistsException
* The resource specified in your request already exists.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws LimitExceededException
* There are too many instances of the specified resource type.
* @throws BadRequestException
* The input you provided is invalid.
* @throws ConcurrentModificationException
* The resource is being modified by another operation or thread.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.CreateConfigurationSet
* @see AWS API Documentation
*/
@Override
public CreateConfigurationSetResponse createConfigurationSet(CreateConfigurationSetRequest createConfigurationSetRequest)
throws AlreadyExistsException, NotFoundException, TooManyRequestsException, LimitExceededException,
BadRequestException, ConcurrentModificationException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateConfigurationSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createConfigurationSetRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createConfigurationSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateConfigurationSet");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateConfigurationSet").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createConfigurationSetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateConfigurationSetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Create an event destination. In Amazon Pinpoint, events include message sends, deliveries, opens, clicks,
* bounces, and complaints. Event destinations are places that you can send information about these events
* to. For example, you can send event data to Amazon SNS to receive notifications when you receive bounces or
* complaints, or you can use Amazon Kinesis Data Firehose to stream data to Amazon S3 for long-term storage.
*
*
* A single configuration set can include more than one event destination.
*
*
* @param createConfigurationSetEventDestinationRequest
* A request to add an event destination to a configuration set.
* @return Result of the CreateConfigurationSetEventDestination operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws AlreadyExistsException
* The resource specified in your request already exists.
* @throws LimitExceededException
* There are too many instances of the specified resource type.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.CreateConfigurationSetEventDestination
* @see AWS API Documentation
*/
@Override
public CreateConfigurationSetEventDestinationResponse createConfigurationSetEventDestination(
CreateConfigurationSetEventDestinationRequest createConfigurationSetEventDestinationRequest)
throws NotFoundException, AlreadyExistsException, LimitExceededException, TooManyRequestsException,
BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, CreateConfigurationSetEventDestinationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createConfigurationSetEventDestinationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
createConfigurationSetEventDestinationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateConfigurationSetEventDestination");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateConfigurationSetEventDestination").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration)
.withInput(createConfigurationSetEventDestinationRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateConfigurationSetEventDestinationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Create a new pool of dedicated IP addresses. A pool can include one or more dedicated IP addresses that are
* associated with your Amazon Pinpoint account. You can associate a pool with a configuration set. When you send an
* email that uses that configuration set, Amazon Pinpoint sends it using only the IP addresses in the associated
* pool.
*
*
* @param createDedicatedIpPoolRequest
* A request to create a new dedicated IP pool.
* @return Result of the CreateDedicatedIpPool operation returned by the service.
* @throws AlreadyExistsException
* The resource specified in your request already exists.
* @throws LimitExceededException
* There are too many instances of the specified resource type.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws ConcurrentModificationException
* The resource is being modified by another operation or thread.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.CreateDedicatedIpPool
* @see AWS API Documentation
*/
@Override
public CreateDedicatedIpPoolResponse createDedicatedIpPool(CreateDedicatedIpPoolRequest createDedicatedIpPoolRequest)
throws AlreadyExistsException, LimitExceededException, TooManyRequestsException, BadRequestException,
ConcurrentModificationException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateDedicatedIpPoolResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDedicatedIpPoolRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createDedicatedIpPoolRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDedicatedIpPool");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateDedicatedIpPool").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createDedicatedIpPoolRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateDedicatedIpPoolRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Create a new predictive inbox placement test. Predictive inbox placement tests can help you predict how your
* messages will be handled by various email providers around the world. When you perform a predictive inbox
* placement test, you provide a sample message that contains the content that you plan to send to your customers.
* Amazon Pinpoint then sends that message to special email addresses spread across several major email providers.
* After about 24 hours, the test is complete, and you can use the GetDeliverabilityTestReport
* operation to view the results of the test.
*
*
* @param createDeliverabilityTestReportRequest
* A request to perform a predictive inbox placement test. Predictive inbox placement tests can help you
* predict how your messages will be handled by various email providers around the world. When you perform a
* predictive inbox placement test, you provide a sample message that contains the content that you plan to
* send to your customers. Amazon Pinpoint then sends that message to special email addresses spread across
* several major email providers. After about 24 hours, the test is complete, and you can use the
* GetDeliverabilityTestReport
operation to view the results of the test.
* @return Result of the CreateDeliverabilityTestReport operation returned by the service.
* @throws AccountSuspendedException
* The message can't be sent because the account's ability to send email has been permanently restricted.
* @throws SendingPausedException
* The message can't be sent because the account's ability to send email is currently paused.
* @throws MessageRejectedException
* The message can't be sent because it contains invalid content.
* @throws MailFromDomainNotVerifiedException
* The message can't be sent because the sending domain isn't verified.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws LimitExceededException
* There are too many instances of the specified resource type.
* @throws BadRequestException
* The input you provided is invalid.
* @throws ConcurrentModificationException
* The resource is being modified by another operation or thread.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.CreateDeliverabilityTestReport
* @see AWS API Documentation
*/
@Override
public CreateDeliverabilityTestReportResponse createDeliverabilityTestReport(
CreateDeliverabilityTestReportRequest createDeliverabilityTestReportRequest) throws AccountSuspendedException,
SendingPausedException, MessageRejectedException, MailFromDomainNotVerifiedException, NotFoundException,
TooManyRequestsException, LimitExceededException, BadRequestException, ConcurrentModificationException,
AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateDeliverabilityTestReportResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDeliverabilityTestReportRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
createDeliverabilityTestReportRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDeliverabilityTestReport");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateDeliverabilityTestReport").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createDeliverabilityTestReportRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateDeliverabilityTestReportRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Verifies an email identity for use with Amazon Pinpoint. In Amazon Pinpoint, an identity is an email address or
* domain that you use when you send email. Before you can use an identity to send email with Amazon Pinpoint, you
* first have to verify it. By verifying an address, you demonstrate that you're the owner of the address, and that
* you've given Amazon Pinpoint permission to send email from the address.
*
*
* When you verify an email address, Amazon Pinpoint sends an email to the address. Your email address is verified
* as soon as you follow the link in the verification email.
*
*
* When you verify a domain, this operation provides a set of DKIM tokens, which you can convert into CNAME tokens.
* You add these CNAME tokens to the DNS configuration for your domain. Your domain is verified when Amazon Pinpoint
* detects these records in the DNS configuration for your domain. It usually takes around 72 hours to complete the
* domain verification process.
*
*
* @param createEmailIdentityRequest
* A request to begin the verification process for an email identity (an email address or domain).
* @return Result of the CreateEmailIdentity operation returned by the service.
* @throws LimitExceededException
* There are too many instances of the specified resource type.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws ConcurrentModificationException
* The resource is being modified by another operation or thread.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.CreateEmailIdentity
* @see AWS API Documentation
*/
@Override
public CreateEmailIdentityResponse createEmailIdentity(CreateEmailIdentityRequest createEmailIdentityRequest)
throws LimitExceededException, TooManyRequestsException, BadRequestException, ConcurrentModificationException,
AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateEmailIdentityResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createEmailIdentityRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createEmailIdentityRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateEmailIdentity");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateEmailIdentity").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createEmailIdentityRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateEmailIdentityRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Delete an existing configuration set.
*
*
* In Amazon Pinpoint, configuration sets are groups of rules that you can apply to the emails you send. You
* apply a configuration set to an email by including a reference to the configuration set in the headers of the
* email. When you apply a configuration set to an email, all of the rules in that configuration set are applied to
* the email.
*
*
* @param deleteConfigurationSetRequest
* A request to delete a configuration set.
* @return Result of the DeleteConfigurationSet operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws ConcurrentModificationException
* The resource is being modified by another operation or thread.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.DeleteConfigurationSet
* @see AWS API Documentation
*/
@Override
public DeleteConfigurationSetResponse deleteConfigurationSet(DeleteConfigurationSetRequest deleteConfigurationSetRequest)
throws NotFoundException, TooManyRequestsException, BadRequestException, ConcurrentModificationException,
AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteConfigurationSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteConfigurationSetRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteConfigurationSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteConfigurationSet");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteConfigurationSet").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteConfigurationSetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteConfigurationSetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Delete an event destination.
*
*
* In Amazon Pinpoint, events include message sends, deliveries, opens, clicks, bounces, and complaints.
* Event destinations are places that you can send information about these events to. For example, you can
* send event data to Amazon SNS to receive notifications when you receive bounces or complaints, or you can use
* Amazon Kinesis Data Firehose to stream data to Amazon S3 for long-term storage.
*
*
* @param deleteConfigurationSetEventDestinationRequest
* A request to delete an event destination from a configuration set.
* @return Result of the DeleteConfigurationSetEventDestination operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.DeleteConfigurationSetEventDestination
* @see AWS API Documentation
*/
@Override
public DeleteConfigurationSetEventDestinationResponse deleteConfigurationSetEventDestination(
DeleteConfigurationSetEventDestinationRequest deleteConfigurationSetEventDestinationRequest)
throws NotFoundException, TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException,
PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DeleteConfigurationSetEventDestinationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteConfigurationSetEventDestinationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteConfigurationSetEventDestinationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteConfigurationSetEventDestination");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteConfigurationSetEventDestination").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration)
.withInput(deleteConfigurationSetEventDestinationRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteConfigurationSetEventDestinationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Delete a dedicated IP pool.
*
*
* @param deleteDedicatedIpPoolRequest
* A request to delete a dedicated IP pool.
* @return Result of the DeleteDedicatedIpPool operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws ConcurrentModificationException
* The resource is being modified by another operation or thread.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.DeleteDedicatedIpPool
* @see AWS API Documentation
*/
@Override
public DeleteDedicatedIpPoolResponse deleteDedicatedIpPool(DeleteDedicatedIpPoolRequest deleteDedicatedIpPoolRequest)
throws NotFoundException, TooManyRequestsException, BadRequestException, ConcurrentModificationException,
AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteDedicatedIpPoolResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDedicatedIpPoolRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDedicatedIpPoolRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDedicatedIpPool");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteDedicatedIpPool").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteDedicatedIpPoolRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteDedicatedIpPoolRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes an email identity that you previously verified for use with Amazon Pinpoint. An identity can be either an
* email address or a domain name.
*
*
* @param deleteEmailIdentityRequest
* A request to delete an existing email identity. When you delete an identity, you lose the ability to use
* Amazon Pinpoint to send email from that identity. You can restore your ability to send email by completing
* the verification process for the identity again.
* @return Result of the DeleteEmailIdentity operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws ConcurrentModificationException
* The resource is being modified by another operation or thread.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.DeleteEmailIdentity
* @see AWS API Documentation
*/
@Override
public DeleteEmailIdentityResponse deleteEmailIdentity(DeleteEmailIdentityRequest deleteEmailIdentityRequest)
throws NotFoundException, TooManyRequestsException, BadRequestException, ConcurrentModificationException,
AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteEmailIdentityResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteEmailIdentityRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteEmailIdentityRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteEmailIdentity");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteEmailIdentity").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteEmailIdentityRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteEmailIdentityRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Obtain information about the email-sending status and capabilities of your Amazon Pinpoint account in the current
* AWS Region.
*
*
* @param getAccountRequest
* A request to obtain information about the email-sending capabilities of your Amazon Pinpoint account.
* @return Result of the GetAccount operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.GetAccount
* @see AWS API
* Documentation
*/
@Override
public GetAccountResponse getAccount(GetAccountRequest getAccountRequest) throws TooManyRequestsException,
BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetAccountResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getAccountRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getAccountRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAccount");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetAccount").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(getAccountRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetAccountRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieve a list of the blacklists that your dedicated IP addresses appear on.
*
*
* @param getBlacklistReportsRequest
* A request to retrieve a list of the blacklists that your dedicated IP addresses appear on.
* @return Result of the GetBlacklistReports operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.GetBlacklistReports
* @see AWS API Documentation
*/
@Override
public GetBlacklistReportsResponse getBlacklistReports(GetBlacklistReportsRequest getBlacklistReportsRequest)
throws TooManyRequestsException, NotFoundException, BadRequestException, AwsServiceException, SdkClientException,
PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetBlacklistReportsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getBlacklistReportsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getBlacklistReportsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetBlacklistReports");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetBlacklistReports").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getBlacklistReportsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetBlacklistReportsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Get information about an existing configuration set, including the dedicated IP pool that it's associated with,
* whether or not it's enabled for sending email, and more.
*
*
* In Amazon Pinpoint, configuration sets are groups of rules that you can apply to the emails you send. You
* apply a configuration set to an email by including a reference to the configuration set in the headers of the
* email. When you apply a configuration set to an email, all of the rules in that configuration set are applied to
* the email.
*
*
* @param getConfigurationSetRequest
* A request to obtain information about a configuration set.
* @return Result of the GetConfigurationSet operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.GetConfigurationSet
* @see AWS API Documentation
*/
@Override
public GetConfigurationSetResponse getConfigurationSet(GetConfigurationSetRequest getConfigurationSetRequest)
throws NotFoundException, TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException,
PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetConfigurationSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getConfigurationSetRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getConfigurationSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetConfigurationSet");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetConfigurationSet").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getConfigurationSetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetConfigurationSetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieve a list of event destinations that are associated with a configuration set.
*
*
* In Amazon Pinpoint, events include message sends, deliveries, opens, clicks, bounces, and complaints.
* Event destinations are places that you can send information about these events to. For example, you can
* send event data to Amazon SNS to receive notifications when you receive bounces or complaints, or you can use
* Amazon Kinesis Data Firehose to stream data to Amazon S3 for long-term storage.
*
*
* @param getConfigurationSetEventDestinationsRequest
* A request to obtain information about the event destinations for a configuration set.
* @return Result of the GetConfigurationSetEventDestinations operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.GetConfigurationSetEventDestinations
* @see AWS API Documentation
*/
@Override
public GetConfigurationSetEventDestinationsResponse getConfigurationSetEventDestinations(
GetConfigurationSetEventDestinationsRequest getConfigurationSetEventDestinationsRequest) throws NotFoundException,
TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, GetConfigurationSetEventDestinationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getConfigurationSetEventDestinationsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getConfigurationSetEventDestinationsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetConfigurationSetEventDestinations");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetConfigurationSetEventDestinations").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getConfigurationSetEventDestinationsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetConfigurationSetEventDestinationsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Get information about a dedicated IP address, including the name of the dedicated IP pool that it's associated
* with, as well information about the automatic warm-up process for the address.
*
*
* @param getDedicatedIpRequest
* A request to obtain more information about a dedicated IP address.
* @return Result of the GetDedicatedIp operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.GetDedicatedIp
* @see AWS
* API Documentation
*/
@Override
public GetDedicatedIpResponse getDedicatedIp(GetDedicatedIpRequest getDedicatedIpRequest) throws TooManyRequestsException,
NotFoundException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetDedicatedIpResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDedicatedIpRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getDedicatedIpRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDedicatedIp");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetDedicatedIp").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getDedicatedIpRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetDedicatedIpRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* List the dedicated IP addresses that are associated with your Amazon Pinpoint account.
*
*
* @param getDedicatedIpsRequest
* A request to obtain more information about dedicated IP pools.
* @return Result of the GetDedicatedIps operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.GetDedicatedIps
* @see AWS API Documentation
*/
@Override
public GetDedicatedIpsResponse getDedicatedIps(GetDedicatedIpsRequest getDedicatedIpsRequest)
throws TooManyRequestsException, NotFoundException, BadRequestException, AwsServiceException, SdkClientException,
PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetDedicatedIpsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDedicatedIpsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getDedicatedIpsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDedicatedIps");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetDedicatedIps").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getDedicatedIpsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetDedicatedIpsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieve information about the status of the Deliverability dashboard for your Amazon Pinpoint account. When the
* Deliverability dashboard is enabled, you gain access to reputation, deliverability, and other metrics for the
* domains that you use to send email using Amazon Pinpoint. You also gain the ability to perform predictive inbox
* placement tests.
*
*
* When you use the Deliverability dashboard, you pay a monthly subscription charge, in addition to any other fees
* that you accrue by using Amazon Pinpoint. For more information about the features and cost of a Deliverability
* dashboard subscription, see Amazon Pinpoint Pricing.
*
*
* @param getDeliverabilityDashboardOptionsRequest
* Retrieve information about the status of the Deliverability dashboard for your Amazon Pinpoint account.
* When the Deliverability dashboard is enabled, you gain access to reputation, deliverability, and other
* metrics for the domains that you use to send email using Amazon Pinpoint. You also gain the ability to
* perform predictive inbox placement tests.
*
* When you use the Deliverability dashboard, you pay a monthly subscription charge, in addition to any other
* fees that you accrue by using Amazon Pinpoint. For more information about the features and cost of a
* Deliverability dashboard subscription, see Amazon
* Pinpoint Pricing.
* @return Result of the GetDeliverabilityDashboardOptions operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws LimitExceededException
* There are too many instances of the specified resource type.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.GetDeliverabilityDashboardOptions
* @see AWS API Documentation
*/
@Override
public GetDeliverabilityDashboardOptionsResponse getDeliverabilityDashboardOptions(
GetDeliverabilityDashboardOptionsRequest getDeliverabilityDashboardOptionsRequest) throws TooManyRequestsException,
LimitExceededException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetDeliverabilityDashboardOptionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDeliverabilityDashboardOptionsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getDeliverabilityDashboardOptionsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDeliverabilityDashboardOptions");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetDeliverabilityDashboardOptions").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getDeliverabilityDashboardOptionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetDeliverabilityDashboardOptionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieve the results of a predictive inbox placement test.
*
*
* @param getDeliverabilityTestReportRequest
* A request to retrieve the results of a predictive inbox placement test.
* @return Result of the GetDeliverabilityTestReport operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.GetDeliverabilityTestReport
* @see AWS API Documentation
*/
@Override
public GetDeliverabilityTestReportResponse getDeliverabilityTestReport(
GetDeliverabilityTestReportRequest getDeliverabilityTestReportRequest) throws TooManyRequestsException,
NotFoundException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetDeliverabilityTestReportResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDeliverabilityTestReportRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getDeliverabilityTestReportRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDeliverabilityTestReport");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetDeliverabilityTestReport").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getDeliverabilityTestReportRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetDeliverabilityTestReportRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieve all the deliverability data for a specific campaign. This data is available for a campaign only if the
* campaign sent email by using a domain that the Deliverability dashboard is enabled for (
* PutDeliverabilityDashboardOption
operation).
*
*
* @param getDomainDeliverabilityCampaignRequest
* Retrieve all the deliverability data for a specific campaign. This data is available for a campaign only
* if the campaign sent email by using a domain that the Deliverability dashboard is enabled for (
* PutDeliverabilityDashboardOption
operation).
* @return Result of the GetDomainDeliverabilityCampaign operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.GetDomainDeliverabilityCampaign
* @see AWS API Documentation
*/
@Override
public GetDomainDeliverabilityCampaignResponse getDomainDeliverabilityCampaign(
GetDomainDeliverabilityCampaignRequest getDomainDeliverabilityCampaignRequest) throws TooManyRequestsException,
BadRequestException, NotFoundException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetDomainDeliverabilityCampaignResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDomainDeliverabilityCampaignRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getDomainDeliverabilityCampaignRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDomainDeliverabilityCampaign");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetDomainDeliverabilityCampaign").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getDomainDeliverabilityCampaignRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetDomainDeliverabilityCampaignRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieve inbox placement and engagement rates for the domains that you use to send email.
*
*
* @param getDomainStatisticsReportRequest
* A request to obtain deliverability metrics for a domain.
* @return Result of the GetDomainStatisticsReport operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.GetDomainStatisticsReport
* @see AWS API Documentation
*/
@Override
public GetDomainStatisticsReportResponse getDomainStatisticsReport(
GetDomainStatisticsReportRequest getDomainStatisticsReportRequest) throws TooManyRequestsException,
NotFoundException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetDomainStatisticsReportResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDomainStatisticsReportRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getDomainStatisticsReportRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDomainStatisticsReport");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetDomainStatisticsReport").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getDomainStatisticsReportRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetDomainStatisticsReportRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Provides information about a specific identity associated with your Amazon Pinpoint account, including the
* identity's verification status, its DKIM authentication status, and its custom Mail-From settings.
*
*
* @param getEmailIdentityRequest
* A request to return details about an email identity.
* @return Result of the GetEmailIdentity operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.GetEmailIdentity
* @see AWS API Documentation
*/
@Override
public GetEmailIdentityResponse getEmailIdentity(GetEmailIdentityRequest getEmailIdentityRequest) throws NotFoundException,
TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetEmailIdentityResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getEmailIdentityRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getEmailIdentityRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetEmailIdentity");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetEmailIdentity").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getEmailIdentityRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetEmailIdentityRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* List all of the configuration sets associated with your Amazon Pinpoint account in the current region.
*
*
* In Amazon Pinpoint, configuration sets are groups of rules that you can apply to the emails you send. You
* apply a configuration set to an email by including a reference to the configuration set in the headers of the
* email. When you apply a configuration set to an email, all of the rules in that configuration set are applied to
* the email.
*
*
* @param listConfigurationSetsRequest
* A request to obtain a list of configuration sets for your Amazon Pinpoint account in the current AWS
* Region.
* @return Result of the ListConfigurationSets operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.ListConfigurationSets
* @see AWS API Documentation
*/
@Override
public ListConfigurationSetsResponse listConfigurationSets(ListConfigurationSetsRequest listConfigurationSetsRequest)
throws TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListConfigurationSetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listConfigurationSetsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listConfigurationSetsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListConfigurationSets");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListConfigurationSets").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listConfigurationSetsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListConfigurationSetsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* List all of the dedicated IP pools that exist in your Amazon Pinpoint account in the current AWS Region.
*
*
* @param listDedicatedIpPoolsRequest
* A request to obtain a list of dedicated IP pools.
* @return Result of the ListDedicatedIpPools operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.ListDedicatedIpPools
* @see AWS API Documentation
*/
@Override
public ListDedicatedIpPoolsResponse listDedicatedIpPools(ListDedicatedIpPoolsRequest listDedicatedIpPoolsRequest)
throws TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDedicatedIpPoolsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDedicatedIpPoolsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listDedicatedIpPoolsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDedicatedIpPools");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListDedicatedIpPools").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listDedicatedIpPoolsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListDedicatedIpPoolsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Show a list of the predictive inbox placement tests that you've performed, regardless of their statuses. For
* predictive inbox placement tests that are complete, you can use the GetDeliverabilityTestReport
* operation to view the results.
*
*
* @param listDeliverabilityTestReportsRequest
* A request to list all of the predictive inbox placement tests that you've performed.
* @return Result of the ListDeliverabilityTestReports operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.ListDeliverabilityTestReports
* @see AWS API Documentation
*/
@Override
public ListDeliverabilityTestReportsResponse listDeliverabilityTestReports(
ListDeliverabilityTestReportsRequest listDeliverabilityTestReportsRequest) throws TooManyRequestsException,
NotFoundException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDeliverabilityTestReportsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDeliverabilityTestReportsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listDeliverabilityTestReportsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDeliverabilityTestReports");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListDeliverabilityTestReports").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listDeliverabilityTestReportsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListDeliverabilityTestReportsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieve deliverability data for all the campaigns that used a specific domain to send email during a specified
* time range. This data is available for a domain only if you enabled the Deliverability dashboard (
* PutDeliverabilityDashboardOption
operation) for the domain.
*
*
* @param listDomainDeliverabilityCampaignsRequest
* Retrieve deliverability data for all the campaigns that used a specific domain to send email during a
* specified time range. This data is available for a domain only if you enabled the Deliverability dashboard
* (PutDeliverabilityDashboardOption
operation) for the domain.
* @return Result of the ListDomainDeliverabilityCampaigns operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.ListDomainDeliverabilityCampaigns
* @see AWS API Documentation
*/
@Override
public ListDomainDeliverabilityCampaignsResponse listDomainDeliverabilityCampaigns(
ListDomainDeliverabilityCampaignsRequest listDomainDeliverabilityCampaignsRequest) throws TooManyRequestsException,
BadRequestException, NotFoundException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDomainDeliverabilityCampaignsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDomainDeliverabilityCampaignsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listDomainDeliverabilityCampaignsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDomainDeliverabilityCampaigns");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListDomainDeliverabilityCampaigns").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listDomainDeliverabilityCampaignsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListDomainDeliverabilityCampaignsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of all of the email identities that are associated with your Amazon Pinpoint account. An identity
* can be either an email address or a domain. This operation returns identities that are verified as well as those
* that aren't.
*
*
* @param listEmailIdentitiesRequest
* A request to list all of the email identities associated with your Amazon Pinpoint account. This list
* includes identities that you've already verified, identities that are unverified, and identities that were
* verified in the past, but are no longer verified.
* @return Result of the ListEmailIdentities operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.ListEmailIdentities
* @see AWS API Documentation
*/
@Override
public ListEmailIdentitiesResponse listEmailIdentities(ListEmailIdentitiesRequest listEmailIdentitiesRequest)
throws TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListEmailIdentitiesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listEmailIdentitiesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listEmailIdentitiesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListEmailIdentities");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListEmailIdentities").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listEmailIdentitiesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListEmailIdentitiesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieve a list of the tags (keys and values) that are associated with a specified resource. A tag is a
* label that you optionally define and associate with a resource in Amazon Pinpoint. Each tag consists of a
* required tag key and an optional associated tag value. A tag key is a general label that acts as a
* category for more specific tag values. A tag value acts as a descriptor within a tag key.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws BadRequestException
* The input you provided is invalid.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.ListTagsForResource
* @see AWS API Documentation
*/
@Override
public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest)
throws BadRequestException, NotFoundException, TooManyRequestsException, AwsServiceException, SdkClientException,
PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTagsForResourceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listTagsForResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Enable or disable the automatic warm-up feature for dedicated IP addresses.
*
*
* @param putAccountDedicatedIpWarmupAttributesRequest
* A request to enable or disable the automatic IP address warm-up feature.
* @return Result of the PutAccountDedicatedIpWarmupAttributes operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.PutAccountDedicatedIpWarmupAttributes
* @see AWS API Documentation
*/
@Override
public PutAccountDedicatedIpWarmupAttributesResponse putAccountDedicatedIpWarmupAttributes(
PutAccountDedicatedIpWarmupAttributesRequest putAccountDedicatedIpWarmupAttributesRequest)
throws TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, PutAccountDedicatedIpWarmupAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putAccountDedicatedIpWarmupAttributesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
putAccountDedicatedIpWarmupAttributesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutAccountDedicatedIpWarmupAttributes");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutAccountDedicatedIpWarmupAttributes").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration)
.withInput(putAccountDedicatedIpWarmupAttributesRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutAccountDedicatedIpWarmupAttributesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Enable or disable the ability of your account to send email.
*
*
* @param putAccountSendingAttributesRequest
* A request to change the ability of your account to send email.
* @return Result of the PutAccountSendingAttributes operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.PutAccountSendingAttributes
* @see AWS API Documentation
*/
@Override
public PutAccountSendingAttributesResponse putAccountSendingAttributes(
PutAccountSendingAttributesRequest putAccountSendingAttributesRequest) throws TooManyRequestsException,
BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutAccountSendingAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putAccountSendingAttributesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putAccountSendingAttributesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutAccountSendingAttributes");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutAccountSendingAttributes").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(putAccountSendingAttributesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutAccountSendingAttributesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Associate a configuration set with a dedicated IP pool. You can use dedicated IP pools to create groups of
* dedicated IP addresses for sending specific types of email.
*
*
* @param putConfigurationSetDeliveryOptionsRequest
* A request to associate a configuration set with a dedicated IP pool.
* @return Result of the PutConfigurationSetDeliveryOptions operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.PutConfigurationSetDeliveryOptions
* @see AWS API Documentation
*/
@Override
public PutConfigurationSetDeliveryOptionsResponse putConfigurationSetDeliveryOptions(
PutConfigurationSetDeliveryOptionsRequest putConfigurationSetDeliveryOptionsRequest) throws NotFoundException,
TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutConfigurationSetDeliveryOptionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putConfigurationSetDeliveryOptionsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
putConfigurationSetDeliveryOptionsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutConfigurationSetDeliveryOptions");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutConfigurationSetDeliveryOptions").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(putConfigurationSetDeliveryOptionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutConfigurationSetDeliveryOptionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Enable or disable collection of reputation metrics for emails that you send using a particular configuration set
* in a specific AWS Region.
*
*
* @param putConfigurationSetReputationOptionsRequest
* A request to enable or disable tracking of reputation metrics for a configuration set.
* @return Result of the PutConfigurationSetReputationOptions operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.PutConfigurationSetReputationOptions
* @see AWS API Documentation
*/
@Override
public PutConfigurationSetReputationOptionsResponse putConfigurationSetReputationOptions(
PutConfigurationSetReputationOptionsRequest putConfigurationSetReputationOptionsRequest) throws NotFoundException,
TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, PutConfigurationSetReputationOptionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putConfigurationSetReputationOptionsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
putConfigurationSetReputationOptionsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutConfigurationSetReputationOptions");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutConfigurationSetReputationOptions").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(putConfigurationSetReputationOptionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutConfigurationSetReputationOptionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Enable or disable email sending for messages that use a particular configuration set in a specific AWS Region.
*
*
* @param putConfigurationSetSendingOptionsRequest
* A request to enable or disable the ability of Amazon Pinpoint to send emails that use a specific
* configuration set.
* @return Result of the PutConfigurationSetSendingOptions operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.PutConfigurationSetSendingOptions
* @see AWS API Documentation
*/
@Override
public PutConfigurationSetSendingOptionsResponse putConfigurationSetSendingOptions(
PutConfigurationSetSendingOptionsRequest putConfigurationSetSendingOptionsRequest) throws NotFoundException,
TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutConfigurationSetSendingOptionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putConfigurationSetSendingOptionsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
putConfigurationSetSendingOptionsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutConfigurationSetSendingOptions");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutConfigurationSetSendingOptions").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(putConfigurationSetSendingOptionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutConfigurationSetSendingOptionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Specify a custom domain to use for open and click tracking elements in email that you send using Amazon Pinpoint.
*
*
* @param putConfigurationSetTrackingOptionsRequest
* A request to add a custom domain for tracking open and click events to a configuration set.
* @return Result of the PutConfigurationSetTrackingOptions operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.PutConfigurationSetTrackingOptions
* @see AWS API Documentation
*/
@Override
public PutConfigurationSetTrackingOptionsResponse putConfigurationSetTrackingOptions(
PutConfigurationSetTrackingOptionsRequest putConfigurationSetTrackingOptionsRequest) throws NotFoundException,
TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutConfigurationSetTrackingOptionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putConfigurationSetTrackingOptionsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
putConfigurationSetTrackingOptionsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutConfigurationSetTrackingOptions");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutConfigurationSetTrackingOptions").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(putConfigurationSetTrackingOptionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutConfigurationSetTrackingOptionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Move a dedicated IP address to an existing dedicated IP pool.
*
*
*
* The dedicated IP address that you specify must already exist, and must be associated with your Amazon Pinpoint
* account.
*
*
* The dedicated IP pool you specify must already exist. You can create a new pool by using the
* CreateDedicatedIpPool
operation.
*
*
*
* @param putDedicatedIpInPoolRequest
* A request to move a dedicated IP address to a dedicated IP pool.
* @return Result of the PutDedicatedIpInPool operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.PutDedicatedIpInPool
* @see AWS API Documentation
*/
@Override
public PutDedicatedIpInPoolResponse putDedicatedIpInPool(PutDedicatedIpInPoolRequest putDedicatedIpInPoolRequest)
throws NotFoundException, TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException,
PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutDedicatedIpInPoolResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putDedicatedIpInPoolRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putDedicatedIpInPoolRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutDedicatedIpInPool");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("PutDedicatedIpInPool").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(putDedicatedIpInPoolRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutDedicatedIpInPoolRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
*
* @param putDedicatedIpWarmupAttributesRequest
* A request to change the warm-up attributes for a dedicated IP address. This operation is useful when you
* want to resume the warm-up process for an existing IP address.
* @return Result of the PutDedicatedIpWarmupAttributes operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.PutDedicatedIpWarmupAttributes
* @see AWS API Documentation
*/
@Override
public PutDedicatedIpWarmupAttributesResponse putDedicatedIpWarmupAttributes(
PutDedicatedIpWarmupAttributesRequest putDedicatedIpWarmupAttributesRequest) throws NotFoundException,
TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutDedicatedIpWarmupAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putDedicatedIpWarmupAttributesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
putDedicatedIpWarmupAttributesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutDedicatedIpWarmupAttributes");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutDedicatedIpWarmupAttributes").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(putDedicatedIpWarmupAttributesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutDedicatedIpWarmupAttributesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Enable or disable the Deliverability dashboard for your Amazon Pinpoint account. When you enable the
* Deliverability dashboard, you gain access to reputation, deliverability, and other metrics for the domains that
* you use to send email using Amazon Pinpoint. You also gain the ability to perform predictive inbox placement
* tests.
*
*
* When you use the Deliverability dashboard, you pay a monthly subscription charge, in addition to any other fees
* that you accrue by using Amazon Pinpoint. For more information about the features and cost of a Deliverability
* dashboard subscription, see Amazon Pinpoint Pricing.
*
*
* @param putDeliverabilityDashboardOptionRequest
* Enable or disable the Deliverability dashboard for your Amazon Pinpoint account. When you enable the
* Deliverability dashboard, you gain access to reputation, deliverability, and other metrics for the domains
* that you use to send email using Amazon Pinpoint. You also gain the ability to perform predictive inbox
* placement tests.
*
* When you use the Deliverability dashboard, you pay a monthly subscription charge, in addition to any other
* fees that you accrue by using Amazon Pinpoint. For more information about the features and cost of a
* Deliverability dashboard subscription, see Amazon
* Pinpoint Pricing.
* @return Result of the PutDeliverabilityDashboardOption operation returned by the service.
* @throws AlreadyExistsException
* The resource specified in your request already exists.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws LimitExceededException
* There are too many instances of the specified resource type.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.PutDeliverabilityDashboardOption
* @see AWS API Documentation
*/
@Override
public PutDeliverabilityDashboardOptionResponse putDeliverabilityDashboardOption(
PutDeliverabilityDashboardOptionRequest putDeliverabilityDashboardOptionRequest) throws AlreadyExistsException,
NotFoundException, TooManyRequestsException, LimitExceededException, BadRequestException, AwsServiceException,
SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutDeliverabilityDashboardOptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putDeliverabilityDashboardOptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
putDeliverabilityDashboardOptionRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutDeliverabilityDashboardOption");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutDeliverabilityDashboardOption").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(putDeliverabilityDashboardOptionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutDeliverabilityDashboardOptionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Used to enable or disable DKIM authentication for an email identity.
*
*
* @param putEmailIdentityDkimAttributesRequest
* A request to enable or disable DKIM signing of email that you send from an email identity.
* @return Result of the PutEmailIdentityDkimAttributes operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.PutEmailIdentityDkimAttributes
* @see AWS API Documentation
*/
@Override
public PutEmailIdentityDkimAttributesResponse putEmailIdentityDkimAttributes(
PutEmailIdentityDkimAttributesRequest putEmailIdentityDkimAttributesRequest) throws NotFoundException,
TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutEmailIdentityDkimAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putEmailIdentityDkimAttributesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
putEmailIdentityDkimAttributesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutEmailIdentityDkimAttributes");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutEmailIdentityDkimAttributes").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(putEmailIdentityDkimAttributesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutEmailIdentityDkimAttributesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Used to enable or disable feedback forwarding for an identity. This setting determines what happens when an
* identity is used to send an email that results in a bounce or complaint event.
*
*
* When you enable feedback forwarding, Amazon Pinpoint sends you email notifications when bounce or complaint
* events occur. Amazon Pinpoint sends this notification to the address that you specified in the Return-Path header
* of the original email.
*
*
* When you disable feedback forwarding, Amazon Pinpoint sends notifications through other mechanisms, such as by
* notifying an Amazon SNS topic. You're required to have a method of tracking bounces and complaints. If you
* haven't set up another mechanism for receiving bounce or complaint notifications, Amazon Pinpoint sends an email
* notification when these events occur (even if this setting is disabled).
*
*
* @param putEmailIdentityFeedbackAttributesRequest
* A request to set the attributes that control how bounce and complaint events are processed.
* @return Result of the PutEmailIdentityFeedbackAttributes operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.PutEmailIdentityFeedbackAttributes
* @see AWS API Documentation
*/
@Override
public PutEmailIdentityFeedbackAttributesResponse putEmailIdentityFeedbackAttributes(
PutEmailIdentityFeedbackAttributesRequest putEmailIdentityFeedbackAttributesRequest) throws NotFoundException,
TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutEmailIdentityFeedbackAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putEmailIdentityFeedbackAttributesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
putEmailIdentityFeedbackAttributesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutEmailIdentityFeedbackAttributes");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutEmailIdentityFeedbackAttributes").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(putEmailIdentityFeedbackAttributesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutEmailIdentityFeedbackAttributesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Used to enable or disable the custom Mail-From domain configuration for an email identity.
*
*
* @param putEmailIdentityMailFromAttributesRequest
* A request to configure the custom MAIL FROM domain for a verified identity.
* @return Result of the PutEmailIdentityMailFromAttributes operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.PutEmailIdentityMailFromAttributes
* @see AWS API Documentation
*/
@Override
public PutEmailIdentityMailFromAttributesResponse putEmailIdentityMailFromAttributes(
PutEmailIdentityMailFromAttributesRequest putEmailIdentityMailFromAttributesRequest) throws NotFoundException,
TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutEmailIdentityMailFromAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putEmailIdentityMailFromAttributesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
putEmailIdentityMailFromAttributesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutEmailIdentityMailFromAttributes");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutEmailIdentityMailFromAttributes").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(putEmailIdentityMailFromAttributesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutEmailIdentityMailFromAttributesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Sends an email message. You can use the Amazon Pinpoint Email API to send two types of messages:
*
*
* -
*
* Simple – A standard email message. When you create this type of message, you specify the sender, the
* recipient, and the message body, and Amazon Pinpoint assembles the message for you.
*
*
* -
*
* Raw – A raw, MIME-formatted email message. When you send this type of email, you have to specify all of
* the message headers, as well as the message body. You can use this message type to send messages that contain
* attachments. The message that you specify has to be a valid MIME message.
*
*
*
*
* @param sendEmailRequest
* A request to send an email message.
* @return Result of the SendEmail operation returned by the service.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws LimitExceededException
* There are too many instances of the specified resource type.
* @throws AccountSuspendedException
* The message can't be sent because the account's ability to send email has been permanently restricted.
* @throws SendingPausedException
* The message can't be sent because the account's ability to send email is currently paused.
* @throws MessageRejectedException
* The message can't be sent because it contains invalid content.
* @throws MailFromDomainNotVerifiedException
* The message can't be sent because the sending domain isn't verified.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.SendEmail
* @see AWS API
* Documentation
*/
@Override
public SendEmailResponse sendEmail(SendEmailRequest sendEmailRequest) throws TooManyRequestsException,
LimitExceededException, AccountSuspendedException, SendingPausedException, MessageRejectedException,
MailFromDomainNotVerifiedException, NotFoundException, BadRequestException, AwsServiceException, SdkClientException,
PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
SendEmailResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(sendEmailRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, sendEmailRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SendEmail");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("SendEmail").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(sendEmailRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new SendEmailRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Add one or more tags (keys and values) to a specified resource. A tag is a label that you optionally
* define and associate with a resource in Amazon Pinpoint. Tags can help you categorize and manage resources in
* different ways, such as by purpose, owner, environment, or other criteria. A resource can have as many as 50
* tags.
*
*
* Each tag consists of a required tag key and an associated tag value, both of which you define. A
* tag key is a general label that acts as a category for more specific tag values. A tag value acts as a descriptor
* within a tag key.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws BadRequestException
* The input you provided is invalid.
* @throws ConcurrentModificationException
* The resource is being modified by another operation or thread.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.TagResource
* @see AWS
* API Documentation
*/
@Override
public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws BadRequestException,
ConcurrentModificationException, NotFoundException, TooManyRequestsException, AwsServiceException,
SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
TagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(tagResourceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("TagResource").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(tagResourceRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new TagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Remove one or more tags (keys and values) from a specified resource.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws BadRequestException
* The input you provided is invalid.
* @throws ConcurrentModificationException
* The resource is being modified by another operation or thread.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.UntagResource
* @see AWS
* API Documentation
*/
@Override
public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws BadRequestException,
ConcurrentModificationException, NotFoundException, TooManyRequestsException, AwsServiceException,
SdkClientException, PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UntagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(untagResourceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UntagResource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(untagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Update the configuration of an event destination for a configuration set.
*
*
* In Amazon Pinpoint, events include message sends, deliveries, opens, clicks, bounces, and complaints.
* Event destinations are places that you can send information about these events to. For example, you can
* send event data to Amazon SNS to receive notifications when you receive bounces or complaints, or you can use
* Amazon Kinesis Data Firehose to stream data to Amazon S3 for long-term storage.
*
*
* @param updateConfigurationSetEventDestinationRequest
* A request to change the settings for an event destination for a configuration set.
* @return Result of the UpdateConfigurationSetEventDestination operation returned by the service.
* @throws NotFoundException
* The resource you attempted to access doesn't exist.
* @throws TooManyRequestsException
* Too many requests have been made to the operation.
* @throws BadRequestException
* The input you provided is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws PinpointEmailException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample PinpointEmailClient.UpdateConfigurationSetEventDestination
* @see AWS API Documentation
*/
@Override
public UpdateConfigurationSetEventDestinationResponse updateConfigurationSetEventDestination(
UpdateConfigurationSetEventDestinationRequest updateConfigurationSetEventDestinationRequest)
throws NotFoundException, TooManyRequestsException, BadRequestException, AwsServiceException, SdkClientException,
PinpointEmailException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, UpdateConfigurationSetEventDestinationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateConfigurationSetEventDestinationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
updateConfigurationSetEventDestinationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint Email");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateConfigurationSetEventDestination");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateConfigurationSetEventDestination").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration)
.withInput(updateConfigurationSetEventDestinationRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateConfigurationSetEventDestinationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration,
RequestOverrideConfiguration requestOverrideConfiguration) {
List publishers = null;
if (requestOverrideConfiguration != null) {
publishers = requestOverrideConfiguration.metricPublishers();
}
if (publishers == null || publishers.isEmpty()) {
publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS);
}
if (publishers == null) {
publishers = Collections.emptyList();
}
return publishers;
}
private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory,
JsonOperationMetadata operationMetadata) {
return protocolFactory.createErrorResponseHandler(operationMetadata);
}
private void updateRetryStrategyClientConfiguration(SdkClientConfiguration.Builder configuration) {
ClientOverrideConfiguration.Builder builder = configuration.asOverrideConfigurationBuilder();
RetryMode retryMode = builder.retryMode();
if (retryMode != null) {
configuration.option(SdkClientOption.RETRY_STRATEGY, AwsRetryStrategy.forRetryMode(retryMode));
} else {
Consumer> configurator = builder.retryStrategyConfigurator();
if (configurator != null) {
RetryStrategy.Builder, ?> defaultBuilder = AwsRetryStrategy.defaultRetryStrategy().toBuilder();
configurator.accept(defaultBuilder);
configuration.option(SdkClientOption.RETRY_STRATEGY, defaultBuilder.build());
} else {
RetryStrategy retryStrategy = builder.retryStrategy();
if (retryStrategy != null) {
configuration.option(SdkClientOption.RETRY_STRATEGY, retryStrategy);
}
}
}
configuration.option(SdkClientOption.CONFIGURED_RETRY_MODE, null);
configuration.option(SdkClientOption.CONFIGURED_RETRY_STRATEGY, null);
configuration.option(SdkClientOption.CONFIGURED_RETRY_CONFIGURATOR, null);
}
private SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) {
List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder();
if (plugins.isEmpty()) {
return configuration.build();
}
PinpointEmailServiceClientConfigurationBuilder serviceConfigBuilder = new PinpointEmailServiceClientConfigurationBuilder(
configuration);
for (SdkPlugin plugin : plugins) {
plugin.configureClient(serviceConfigBuilder);
}
updateRetryStrategyClientConfiguration(configuration);
return configuration.build();
}
private > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(PinpointEmailException::builder)
.protocol(AwsJsonProtocol.REST_JSON)
.protocolVersion("1.1")
.registerModeledException(
ExceptionMetadata.builder().errorCode("ConcurrentModificationException")
.exceptionBuilderSupplier(ConcurrentModificationException::builder).httpStatusCode(500).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("MessageRejected")
.exceptionBuilderSupplier(MessageRejectedException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("NotFoundException")
.exceptionBuilderSupplier(NotFoundException::builder).httpStatusCode(404).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("SendingPausedException")
.exceptionBuilderSupplier(SendingPausedException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("LimitExceededException")
.exceptionBuilderSupplier(LimitExceededException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AccountSuspendedException")
.exceptionBuilderSupplier(AccountSuspendedException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AlreadyExistsException")
.exceptionBuilderSupplier(AlreadyExistsException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TooManyRequestsException")
.exceptionBuilderSupplier(TooManyRequestsException::builder).httpStatusCode(429).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("MailFromDomainNotVerifiedException")
.exceptionBuilderSupplier(MailFromDomainNotVerifiedException::builder).httpStatusCode(400)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("BadRequestException")
.exceptionBuilderSupplier(BadRequestException::builder).httpStatusCode(400).build());
}
@Override
public final PinpointEmailServiceClientConfiguration serviceClientConfiguration() {
return new PinpointEmailServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build();
}
@Override
public void close() {
clientHandler.close();
}
}