
software.amazon.awssdk.services.mailmanager.DefaultMailManagerClient Maven / Gradle / Ivy
/*
* 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.mailmanager;
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.mailmanager.internal.MailManagerServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.mailmanager.model.AccessDeniedException;
import software.amazon.awssdk.services.mailmanager.model.ConflictException;
import software.amazon.awssdk.services.mailmanager.model.CreateAddonInstanceRequest;
import software.amazon.awssdk.services.mailmanager.model.CreateAddonInstanceResponse;
import software.amazon.awssdk.services.mailmanager.model.CreateAddonSubscriptionRequest;
import software.amazon.awssdk.services.mailmanager.model.CreateAddonSubscriptionResponse;
import software.amazon.awssdk.services.mailmanager.model.CreateArchiveRequest;
import software.amazon.awssdk.services.mailmanager.model.CreateArchiveResponse;
import software.amazon.awssdk.services.mailmanager.model.CreateIngressPointRequest;
import software.amazon.awssdk.services.mailmanager.model.CreateIngressPointResponse;
import software.amazon.awssdk.services.mailmanager.model.CreateRelayRequest;
import software.amazon.awssdk.services.mailmanager.model.CreateRelayResponse;
import software.amazon.awssdk.services.mailmanager.model.CreateRuleSetRequest;
import software.amazon.awssdk.services.mailmanager.model.CreateRuleSetResponse;
import software.amazon.awssdk.services.mailmanager.model.CreateTrafficPolicyRequest;
import software.amazon.awssdk.services.mailmanager.model.CreateTrafficPolicyResponse;
import software.amazon.awssdk.services.mailmanager.model.DeleteAddonInstanceRequest;
import software.amazon.awssdk.services.mailmanager.model.DeleteAddonInstanceResponse;
import software.amazon.awssdk.services.mailmanager.model.DeleteAddonSubscriptionRequest;
import software.amazon.awssdk.services.mailmanager.model.DeleteAddonSubscriptionResponse;
import software.amazon.awssdk.services.mailmanager.model.DeleteArchiveRequest;
import software.amazon.awssdk.services.mailmanager.model.DeleteArchiveResponse;
import software.amazon.awssdk.services.mailmanager.model.DeleteIngressPointRequest;
import software.amazon.awssdk.services.mailmanager.model.DeleteIngressPointResponse;
import software.amazon.awssdk.services.mailmanager.model.DeleteRelayRequest;
import software.amazon.awssdk.services.mailmanager.model.DeleteRelayResponse;
import software.amazon.awssdk.services.mailmanager.model.DeleteRuleSetRequest;
import software.amazon.awssdk.services.mailmanager.model.DeleteRuleSetResponse;
import software.amazon.awssdk.services.mailmanager.model.DeleteTrafficPolicyRequest;
import software.amazon.awssdk.services.mailmanager.model.DeleteTrafficPolicyResponse;
import software.amazon.awssdk.services.mailmanager.model.GetAddonInstanceRequest;
import software.amazon.awssdk.services.mailmanager.model.GetAddonInstanceResponse;
import software.amazon.awssdk.services.mailmanager.model.GetAddonSubscriptionRequest;
import software.amazon.awssdk.services.mailmanager.model.GetAddonSubscriptionResponse;
import software.amazon.awssdk.services.mailmanager.model.GetArchiveExportRequest;
import software.amazon.awssdk.services.mailmanager.model.GetArchiveExportResponse;
import software.amazon.awssdk.services.mailmanager.model.GetArchiveMessageContentRequest;
import software.amazon.awssdk.services.mailmanager.model.GetArchiveMessageContentResponse;
import software.amazon.awssdk.services.mailmanager.model.GetArchiveMessageRequest;
import software.amazon.awssdk.services.mailmanager.model.GetArchiveMessageResponse;
import software.amazon.awssdk.services.mailmanager.model.GetArchiveRequest;
import software.amazon.awssdk.services.mailmanager.model.GetArchiveResponse;
import software.amazon.awssdk.services.mailmanager.model.GetArchiveSearchRequest;
import software.amazon.awssdk.services.mailmanager.model.GetArchiveSearchResponse;
import software.amazon.awssdk.services.mailmanager.model.GetArchiveSearchResultsRequest;
import software.amazon.awssdk.services.mailmanager.model.GetArchiveSearchResultsResponse;
import software.amazon.awssdk.services.mailmanager.model.GetIngressPointRequest;
import software.amazon.awssdk.services.mailmanager.model.GetIngressPointResponse;
import software.amazon.awssdk.services.mailmanager.model.GetRelayRequest;
import software.amazon.awssdk.services.mailmanager.model.GetRelayResponse;
import software.amazon.awssdk.services.mailmanager.model.GetRuleSetRequest;
import software.amazon.awssdk.services.mailmanager.model.GetRuleSetResponse;
import software.amazon.awssdk.services.mailmanager.model.GetTrafficPolicyRequest;
import software.amazon.awssdk.services.mailmanager.model.GetTrafficPolicyResponse;
import software.amazon.awssdk.services.mailmanager.model.ListAddonInstancesRequest;
import software.amazon.awssdk.services.mailmanager.model.ListAddonInstancesResponse;
import software.amazon.awssdk.services.mailmanager.model.ListAddonSubscriptionsRequest;
import software.amazon.awssdk.services.mailmanager.model.ListAddonSubscriptionsResponse;
import software.amazon.awssdk.services.mailmanager.model.ListArchiveExportsRequest;
import software.amazon.awssdk.services.mailmanager.model.ListArchiveExportsResponse;
import software.amazon.awssdk.services.mailmanager.model.ListArchiveSearchesRequest;
import software.amazon.awssdk.services.mailmanager.model.ListArchiveSearchesResponse;
import software.amazon.awssdk.services.mailmanager.model.ListArchivesRequest;
import software.amazon.awssdk.services.mailmanager.model.ListArchivesResponse;
import software.amazon.awssdk.services.mailmanager.model.ListIngressPointsRequest;
import software.amazon.awssdk.services.mailmanager.model.ListIngressPointsResponse;
import software.amazon.awssdk.services.mailmanager.model.ListRelaysRequest;
import software.amazon.awssdk.services.mailmanager.model.ListRelaysResponse;
import software.amazon.awssdk.services.mailmanager.model.ListRuleSetsRequest;
import software.amazon.awssdk.services.mailmanager.model.ListRuleSetsResponse;
import software.amazon.awssdk.services.mailmanager.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.mailmanager.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.mailmanager.model.ListTrafficPoliciesRequest;
import software.amazon.awssdk.services.mailmanager.model.ListTrafficPoliciesResponse;
import software.amazon.awssdk.services.mailmanager.model.MailManagerException;
import software.amazon.awssdk.services.mailmanager.model.ResourceNotFoundException;
import software.amazon.awssdk.services.mailmanager.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.mailmanager.model.StartArchiveExportRequest;
import software.amazon.awssdk.services.mailmanager.model.StartArchiveExportResponse;
import software.amazon.awssdk.services.mailmanager.model.StartArchiveSearchRequest;
import software.amazon.awssdk.services.mailmanager.model.StartArchiveSearchResponse;
import software.amazon.awssdk.services.mailmanager.model.StopArchiveExportRequest;
import software.amazon.awssdk.services.mailmanager.model.StopArchiveExportResponse;
import software.amazon.awssdk.services.mailmanager.model.StopArchiveSearchRequest;
import software.amazon.awssdk.services.mailmanager.model.StopArchiveSearchResponse;
import software.amazon.awssdk.services.mailmanager.model.TagResourceRequest;
import software.amazon.awssdk.services.mailmanager.model.TagResourceResponse;
import software.amazon.awssdk.services.mailmanager.model.ThrottlingException;
import software.amazon.awssdk.services.mailmanager.model.UntagResourceRequest;
import software.amazon.awssdk.services.mailmanager.model.UntagResourceResponse;
import software.amazon.awssdk.services.mailmanager.model.UpdateArchiveRequest;
import software.amazon.awssdk.services.mailmanager.model.UpdateArchiveResponse;
import software.amazon.awssdk.services.mailmanager.model.UpdateIngressPointRequest;
import software.amazon.awssdk.services.mailmanager.model.UpdateIngressPointResponse;
import software.amazon.awssdk.services.mailmanager.model.UpdateRelayRequest;
import software.amazon.awssdk.services.mailmanager.model.UpdateRelayResponse;
import software.amazon.awssdk.services.mailmanager.model.UpdateRuleSetRequest;
import software.amazon.awssdk.services.mailmanager.model.UpdateRuleSetResponse;
import software.amazon.awssdk.services.mailmanager.model.UpdateTrafficPolicyRequest;
import software.amazon.awssdk.services.mailmanager.model.UpdateTrafficPolicyResponse;
import software.amazon.awssdk.services.mailmanager.model.ValidationException;
import software.amazon.awssdk.services.mailmanager.transform.CreateAddonInstanceRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.CreateAddonSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.CreateArchiveRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.CreateIngressPointRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.CreateRelayRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.CreateRuleSetRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.CreateTrafficPolicyRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.DeleteAddonInstanceRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.DeleteAddonSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.DeleteArchiveRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.DeleteIngressPointRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.DeleteRelayRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.DeleteRuleSetRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.DeleteTrafficPolicyRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.GetAddonInstanceRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.GetAddonSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.GetArchiveExportRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.GetArchiveMessageContentRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.GetArchiveMessageRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.GetArchiveRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.GetArchiveSearchRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.GetArchiveSearchResultsRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.GetIngressPointRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.GetRelayRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.GetRuleSetRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.GetTrafficPolicyRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.ListAddonInstancesRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.ListAddonSubscriptionsRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.ListArchiveExportsRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.ListArchiveSearchesRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.ListArchivesRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.ListIngressPointsRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.ListRelaysRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.ListRuleSetsRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.ListTrafficPoliciesRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.StartArchiveExportRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.StartArchiveSearchRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.StopArchiveExportRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.StopArchiveSearchRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.UpdateArchiveRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.UpdateIngressPointRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.UpdateRelayRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.UpdateRuleSetRequestMarshaller;
import software.amazon.awssdk.services.mailmanager.transform.UpdateTrafficPolicyRequestMarshaller;
import software.amazon.awssdk.utils.Logger;
/**
* Internal implementation of {@link MailManagerClient}.
*
* @see MailManagerClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultMailManagerClient implements MailManagerClient {
private static final Logger log = Logger.loggerFor(DefaultMailManagerClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.AWS_JSON).build();
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultMailManagerClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Creates an Add On instance for the subscription indicated in the request. The resulting Amazon Resource Name
* (ARN) can be used in a conditional statement for a rule set or traffic policy.
*
*
* @param createAddonInstanceRequest
* @return Result of the CreateAddonInstance operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ServiceQuotaExceededException
* Occurs when an operation exceeds a predefined service quota or limit.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.CreateAddonInstance
* @see AWS API Documentation
*/
@Override
public CreateAddonInstanceResponse createAddonInstance(CreateAddonInstanceRequest createAddonInstanceRequest)
throws ValidationException, ServiceQuotaExceededException, ConflictException, ResourceNotFoundException,
AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateAddonInstanceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAddonInstanceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createAddonInstanceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAddonInstance");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateAddonInstance").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createAddonInstanceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateAddonInstanceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a subscription for an Add On representing the acceptance of its terms of use and additional pricing. The
* subscription can then be used to create an instance for use in rule sets or traffic policies.
*
*
* @param createAddonSubscriptionRequest
* @return Result of the CreateAddonSubscription operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ServiceQuotaExceededException
* Occurs when an operation exceeds a predefined service quota or limit.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.CreateAddonSubscription
* @see AWS API Documentation
*/
@Override
public CreateAddonSubscriptionResponse createAddonSubscription(CreateAddonSubscriptionRequest createAddonSubscriptionRequest)
throws ValidationException, ServiceQuotaExceededException, ConflictException, AwsServiceException,
SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateAddonSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAddonSubscriptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createAddonSubscriptionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAddonSubscription");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateAddonSubscription").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createAddonSubscriptionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateAddonSubscriptionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a new email archive resource for storing and retaining emails.
*
*
* @param createArchiveRequest
* The request to create a new email archive.
* @return Result of the CreateArchive operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ServiceQuotaExceededException
* Occurs when an operation exceeds a predefined service quota or limit.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.CreateArchive
* @see AWS API
* Documentation
*/
@Override
public CreateArchiveResponse createArchive(CreateArchiveRequest createArchiveRequest) throws ValidationException,
AccessDeniedException, ServiceQuotaExceededException, ConflictException, ThrottlingException, AwsServiceException,
SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateArchiveResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createArchiveRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createArchiveRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateArchive");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateArchive").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createArchiveRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateArchiveRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Provision a new ingress endpoint resource.
*
*
* @param createIngressPointRequest
* @return Result of the CreateIngressPoint operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ServiceQuotaExceededException
* Occurs when an operation exceeds a predefined service quota or limit.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.CreateIngressPoint
* @see AWS API Documentation
*/
@Override
public CreateIngressPointResponse createIngressPoint(CreateIngressPointRequest createIngressPointRequest)
throws ValidationException, ServiceQuotaExceededException, ConflictException, AwsServiceException,
SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateIngressPointResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createIngressPointRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createIngressPointRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateIngressPoint");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateIngressPoint").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createIngressPointRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateIngressPointRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a relay resource which can be used in rules to relay incoming emails to defined relay destinations.
*
*
* @param createRelayRequest
* @return Result of the CreateRelay operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ServiceQuotaExceededException
* Occurs when an operation exceeds a predefined service quota or limit.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.CreateRelay
* @see AWS API
* Documentation
*/
@Override
public CreateRelayResponse createRelay(CreateRelayRequest createRelayRequest) throws ValidationException,
ServiceQuotaExceededException, ConflictException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateRelayResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createRelayRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createRelayRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateRelay");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateRelay").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(createRelayRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateRelayRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Provision a new rule set.
*
*
* @param createRuleSetRequest
* @return Result of the CreateRuleSet operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ServiceQuotaExceededException
* Occurs when an operation exceeds a predefined service quota or limit.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.CreateRuleSet
* @see AWS API
* Documentation
*/
@Override
public CreateRuleSetResponse createRuleSet(CreateRuleSetRequest createRuleSetRequest) throws ValidationException,
ServiceQuotaExceededException, ConflictException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateRuleSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createRuleSetRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createRuleSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateRuleSet");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateRuleSet").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createRuleSetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateRuleSetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Provision a new traffic policy resource.
*
*
* @param createTrafficPolicyRequest
* @return Result of the CreateTrafficPolicy operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ServiceQuotaExceededException
* Occurs when an operation exceeds a predefined service quota or limit.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.CreateTrafficPolicy
* @see AWS API Documentation
*/
@Override
public CreateTrafficPolicyResponse createTrafficPolicy(CreateTrafficPolicyRequest createTrafficPolicyRequest)
throws ValidationException, ServiceQuotaExceededException, ConflictException, AwsServiceException,
SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateTrafficPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createTrafficPolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createTrafficPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateTrafficPolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateTrafficPolicy").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createTrafficPolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateTrafficPolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes an Add On instance.
*
*
* @param deleteAddonInstanceRequest
* @return Result of the DeleteAddonInstance operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.DeleteAddonInstance
* @see AWS API Documentation
*/
@Override
public DeleteAddonInstanceResponse deleteAddonInstance(DeleteAddonInstanceRequest deleteAddonInstanceRequest)
throws ValidationException, ConflictException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteAddonInstanceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAddonInstanceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAddonInstanceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAddonInstance");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteAddonInstance").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteAddonInstanceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteAddonInstanceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes an Add On subscription.
*
*
* @param deleteAddonSubscriptionRequest
* @return Result of the DeleteAddonSubscription operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.DeleteAddonSubscription
* @see AWS API Documentation
*/
@Override
public DeleteAddonSubscriptionResponse deleteAddonSubscription(DeleteAddonSubscriptionRequest deleteAddonSubscriptionRequest)
throws ValidationException, ConflictException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteAddonSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAddonSubscriptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAddonSubscriptionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAddonSubscription");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteAddonSubscription").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteAddonSubscriptionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteAddonSubscriptionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Initiates deletion of an email archive. This changes the archive state to pending deletion. In this state, no new
* emails can be added, and existing archived emails become inaccessible (search, export, download). The archive and
* all of its contents will be permanently deleted 30 days after entering the pending deletion state, regardless of
* the configured retention period.
*
*
* @param deleteArchiveRequest
* The request to initiate deletion of an email archive.
* @return Result of the DeleteArchive operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.DeleteArchive
* @see AWS API
* Documentation
*/
@Override
public DeleteArchiveResponse deleteArchive(DeleteArchiveRequest deleteArchiveRequest) throws ValidationException,
AccessDeniedException, ConflictException, ThrottlingException, AwsServiceException, SdkClientException,
MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteArchiveResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteArchiveRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteArchiveRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteArchive");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteArchive").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteArchiveRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteArchiveRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Delete an ingress endpoint resource.
*
*
* @param deleteIngressPointRequest
* @return Result of the DeleteIngressPoint operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.DeleteIngressPoint
* @see AWS API Documentation
*/
@Override
public DeleteIngressPointResponse deleteIngressPoint(DeleteIngressPointRequest deleteIngressPointRequest)
throws ValidationException, ConflictException, ResourceNotFoundException, AwsServiceException, SdkClientException,
MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteIngressPointResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteIngressPointRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteIngressPointRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteIngressPoint");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteIngressPoint").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteIngressPointRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteIngressPointRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes an existing relay resource.
*
*
* @param deleteRelayRequest
* @return Result of the DeleteRelay operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.DeleteRelay
* @see AWS API
* Documentation
*/
@Override
public DeleteRelayResponse deleteRelay(DeleteRelayRequest deleteRelayRequest) throws ValidationException, ConflictException,
ResourceNotFoundException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteRelayResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteRelayRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteRelayRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteRelay");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteRelay").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(deleteRelayRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteRelayRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Delete a rule set.
*
*
* @param deleteRuleSetRequest
* @return Result of the DeleteRuleSet operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.DeleteRuleSet
* @see AWS API
* Documentation
*/
@Override
public DeleteRuleSetResponse deleteRuleSet(DeleteRuleSetRequest deleteRuleSetRequest) throws ValidationException,
ConflictException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteRuleSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteRuleSetRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteRuleSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteRuleSet");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteRuleSet").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteRuleSetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteRuleSetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Delete a traffic policy resource.
*
*
* @param deleteTrafficPolicyRequest
* @return Result of the DeleteTrafficPolicy operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.DeleteTrafficPolicy
* @see AWS API Documentation
*/
@Override
public DeleteTrafficPolicyResponse deleteTrafficPolicy(DeleteTrafficPolicyRequest deleteTrafficPolicyRequest)
throws ValidationException, ConflictException, ResourceNotFoundException, AwsServiceException, SdkClientException,
MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteTrafficPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteTrafficPolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteTrafficPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteTrafficPolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteTrafficPolicy").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteTrafficPolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteTrafficPolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets detailed information about an Add On instance.
*
*
* @param getAddonInstanceRequest
* @return Result of the GetAddonInstance operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.GetAddonInstance
* @see AWS
* API Documentation
*/
@Override
public GetAddonInstanceResponse getAddonInstance(GetAddonInstanceRequest getAddonInstanceRequest) throws ValidationException,
ResourceNotFoundException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetAddonInstanceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getAddonInstanceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getAddonInstanceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAddonInstance");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetAddonInstance").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getAddonInstanceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetAddonInstanceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets detailed information about an Add On subscription.
*
*
* @param getAddonSubscriptionRequest
* @return Result of the GetAddonSubscription operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.GetAddonSubscription
* @see AWS API Documentation
*/
@Override
public GetAddonSubscriptionResponse getAddonSubscription(GetAddonSubscriptionRequest getAddonSubscriptionRequest)
throws ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetAddonSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getAddonSubscriptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getAddonSubscriptionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAddonSubscription");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetAddonSubscription").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getAddonSubscriptionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetAddonSubscriptionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the full details and current state of a specified email archive.
*
*
* @param getArchiveRequest
* The request to retrieve details of an email archive.
* @return Result of the GetArchive operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.GetArchive
* @see AWS API
* Documentation
*/
@Override
public GetArchiveResponse getArchive(GetArchiveRequest getArchiveRequest) throws ValidationException, AccessDeniedException,
ResourceNotFoundException, ThrottlingException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetArchiveResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getArchiveRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getArchiveRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetArchive");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetArchive").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(getArchiveRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetArchiveRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the details and current status of a specific email archive export job.
*
*
* @param getArchiveExportRequest
* The request to retrieve details of a specific archive export job.
* @return Result of the GetArchiveExport operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.GetArchiveExport
* @see AWS
* API Documentation
*/
@Override
public GetArchiveExportResponse getArchiveExport(GetArchiveExportRequest getArchiveExportRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetArchiveExportResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getArchiveExportRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getArchiveExportRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetArchiveExport");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetArchiveExport").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getArchiveExportRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetArchiveExportRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a pre-signed URL that provides temporary download access to the specific email message stored in the
* archive.
*
*
* @param getArchiveMessageRequest
* The request to get details of a specific email message stored in an archive.
* @return Result of the GetArchiveMessage operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.GetArchiveMessage
* @see AWS
* API Documentation
*/
@Override
public GetArchiveMessageResponse getArchiveMessage(GetArchiveMessageRequest getArchiveMessageRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException,
MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetArchiveMessageResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getArchiveMessageRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getArchiveMessageRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetArchiveMessage");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetArchiveMessage").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getArchiveMessageRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetArchiveMessageRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns the textual content of a specific email message stored in the archive. Attachments are not included.
*
*
* @param getArchiveMessageContentRequest
* The request to get the textual content of a specific email message stored in an archive.
* @return Result of the GetArchiveMessageContent operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.GetArchiveMessageContent
* @see AWS API Documentation
*/
@Override
public GetArchiveMessageContentResponse getArchiveMessageContent(
GetArchiveMessageContentRequest getArchiveMessageContentRequest) throws ValidationException, AccessDeniedException,
ThrottlingException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetArchiveMessageContentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getArchiveMessageContentRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getArchiveMessageContentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetArchiveMessageContent");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetArchiveMessageContent").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getArchiveMessageContentRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetArchiveMessageContentRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the details and current status of a specific email archive search job.
*
*
* @param getArchiveSearchRequest
* The request to retrieve details of a specific archive search job.
* @return Result of the GetArchiveSearch operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.GetArchiveSearch
* @see AWS
* API Documentation
*/
@Override
public GetArchiveSearchResponse getArchiveSearch(GetArchiveSearchRequest getArchiveSearchRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetArchiveSearchResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getArchiveSearchRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getArchiveSearchRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetArchiveSearch");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetArchiveSearch").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getArchiveSearchRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetArchiveSearchRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns the results of a completed email archive search job.
*
*
* @param getArchiveSearchResultsRequest
* The request to retrieve results from a completed archive search job.
* @return Result of the GetArchiveSearchResults operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.GetArchiveSearchResults
* @see AWS API Documentation
*/
@Override
public GetArchiveSearchResultsResponse getArchiveSearchResults(GetArchiveSearchResultsRequest getArchiveSearchResultsRequest)
throws ValidationException, AccessDeniedException, ConflictException, ThrottlingException, AwsServiceException,
SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetArchiveSearchResultsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getArchiveSearchResultsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getArchiveSearchResultsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetArchiveSearchResults");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetArchiveSearchResults").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getArchiveSearchResultsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetArchiveSearchResultsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Fetch ingress endpoint resource attributes.
*
*
* @param getIngressPointRequest
* @return Result of the GetIngressPoint operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.GetIngressPoint
* @see AWS
* API Documentation
*/
@Override
public GetIngressPointResponse getIngressPoint(GetIngressPointRequest getIngressPointRequest) throws ValidationException,
ResourceNotFoundException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetIngressPointResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getIngressPointRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getIngressPointRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetIngressPoint");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetIngressPoint").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getIngressPointRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetIngressPointRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Fetch the relay resource and it's attributes.
*
*
* @param getRelayRequest
* @return Result of the GetRelay operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.GetRelay
* @see AWS API
* Documentation
*/
@Override
public GetRelayResponse getRelay(GetRelayRequest getRelayRequest) throws ValidationException, ResourceNotFoundException,
AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetRelayResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getRelayRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getRelayRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRelay");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetRelay").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(getRelayRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetRelayRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Fetch attributes of a rule set.
*
*
* @param getRuleSetRequest
* @return Result of the GetRuleSet operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.GetRuleSet
* @see AWS API
* Documentation
*/
@Override
public GetRuleSetResponse getRuleSet(GetRuleSetRequest getRuleSetRequest) throws ValidationException,
ResourceNotFoundException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetRuleSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getRuleSetRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getRuleSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRuleSet");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetRuleSet").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(getRuleSetRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetRuleSetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Fetch attributes of a traffic policy resource.
*
*
* @param getTrafficPolicyRequest
* @return Result of the GetTrafficPolicy operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.GetTrafficPolicy
* @see AWS
* API Documentation
*/
@Override
public GetTrafficPolicyResponse getTrafficPolicy(GetTrafficPolicyRequest getTrafficPolicyRequest) throws ValidationException,
ResourceNotFoundException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetTrafficPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getTrafficPolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getTrafficPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetTrafficPolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetTrafficPolicy").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getTrafficPolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetTrafficPolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all Add On instances in your account.
*
*
* @param listAddonInstancesRequest
* @return Result of the ListAddonInstances operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.ListAddonInstances
* @see AWS API Documentation
*/
@Override
public ListAddonInstancesResponse listAddonInstances(ListAddonInstancesRequest listAddonInstancesRequest)
throws ValidationException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListAddonInstancesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAddonInstancesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listAddonInstancesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAddonInstances");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListAddonInstances").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listAddonInstancesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListAddonInstancesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all Add On subscriptions in your account.
*
*
* @param listAddonSubscriptionsRequest
* @return Result of the ListAddonSubscriptions operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.ListAddonSubscriptions
* @see AWS API Documentation
*/
@Override
public ListAddonSubscriptionsResponse listAddonSubscriptions(ListAddonSubscriptionsRequest listAddonSubscriptionsRequest)
throws ValidationException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListAddonSubscriptionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAddonSubscriptionsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listAddonSubscriptionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAddonSubscriptions");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListAddonSubscriptions").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listAddonSubscriptionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListAddonSubscriptionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of email archive export jobs.
*
*
* @param listArchiveExportsRequest
* The request to list archive export jobs in your account.
* @return Result of the ListArchiveExports operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.ListArchiveExports
* @see AWS API Documentation
*/
@Override
public ListArchiveExportsResponse listArchiveExports(ListArchiveExportsRequest listArchiveExportsRequest)
throws ValidationException, AccessDeniedException, ResourceNotFoundException, ThrottlingException,
AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListArchiveExportsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listArchiveExportsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listArchiveExportsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListArchiveExports");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListArchiveExports").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listArchiveExportsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListArchiveExportsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of email archive search jobs.
*
*
* @param listArchiveSearchesRequest
* The request to list archive search jobs in your account.
* @return Result of the ListArchiveSearches operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.ListArchiveSearches
* @see AWS API Documentation
*/
@Override
public ListArchiveSearchesResponse listArchiveSearches(ListArchiveSearchesRequest listArchiveSearchesRequest)
throws ValidationException, AccessDeniedException, ResourceNotFoundException, ThrottlingException,
AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListArchiveSearchesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listArchiveSearchesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listArchiveSearchesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListArchiveSearches");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListArchiveSearches").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listArchiveSearchesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListArchiveSearchesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of all email archives in your account.
*
*
* @param listArchivesRequest
* The request to list email archives in your account.
* @return Result of the ListArchives operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.ListArchives
* @see AWS API
* Documentation
*/
@Override
public ListArchivesResponse listArchives(ListArchivesRequest listArchivesRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListArchivesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listArchivesRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listArchivesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListArchives");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListArchives").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listArchivesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListArchivesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* List all ingress endpoint resources.
*
*
* @param listIngressPointsRequest
* @return Result of the ListIngressPoints operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.ListIngressPoints
* @see AWS
* API Documentation
*/
@Override
public ListIngressPointsResponse listIngressPoints(ListIngressPointsRequest listIngressPointsRequest)
throws ValidationException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListIngressPointsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listIngressPointsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listIngressPointsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListIngressPoints");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListIngressPoints").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listIngressPointsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListIngressPointsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all the existing relay resources.
*
*
* @param listRelaysRequest
* @return Result of the ListRelays operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.ListRelays
* @see AWS API
* Documentation
*/
@Override
public ListRelaysResponse listRelays(ListRelaysRequest listRelaysRequest) throws ValidationException, AwsServiceException,
SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListRelaysResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listRelaysRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listRelaysRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListRelays");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListRelays").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(listRelaysRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListRelaysRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* List rule sets for this account.
*
*
* @param listRuleSetsRequest
* @return Result of the ListRuleSets operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.ListRuleSets
* @see AWS API
* Documentation
*/
@Override
public ListRuleSetsResponse listRuleSets(ListRuleSetsRequest listRuleSetsRequest) throws ValidationException,
AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListRuleSetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listRuleSetsRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listRuleSetsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListRuleSets");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListRuleSets").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listRuleSetsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListRuleSetsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the list of tags (keys and values) assigned to the resource.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.ListTagsForResource
* @see AWS API Documentation
*/
@Override
public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest)
throws ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, MailManagerException {
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, "MailManager");
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()));
}
}
/**
*
* List traffic policy resources.
*
*
* @param listTrafficPoliciesRequest
* @return Result of the ListTrafficPolicies operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.ListTrafficPolicies
* @see AWS API Documentation
*/
@Override
public ListTrafficPoliciesResponse listTrafficPolicies(ListTrafficPoliciesRequest listTrafficPoliciesRequest)
throws ValidationException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTrafficPoliciesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTrafficPoliciesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTrafficPoliciesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTrafficPolicies");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTrafficPolicies").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listTrafficPoliciesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListTrafficPoliciesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Initiates an export of emails from the specified archive.
*
*
* @param startArchiveExportRequest
* The request to initiate an export of emails from an archive.
* @return Result of the StartArchiveExport operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ServiceQuotaExceededException
* Occurs when an operation exceeds a predefined service quota or limit.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.StartArchiveExport
* @see AWS API Documentation
*/
@Override
public StartArchiveExportResponse startArchiveExport(StartArchiveExportRequest startArchiveExportRequest)
throws ValidationException, AccessDeniedException, ServiceQuotaExceededException, ResourceNotFoundException,
ThrottlingException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, StartArchiveExportResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startArchiveExportRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, startArchiveExportRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartArchiveExport");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StartArchiveExport").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(startArchiveExportRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StartArchiveExportRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Initiates a search across emails in the specified archive.
*
*
* @param startArchiveSearchRequest
* The request to initiate a search across emails in an archive.
* @return Result of the StartArchiveSearch operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ServiceQuotaExceededException
* Occurs when an operation exceeds a predefined service quota or limit.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.StartArchiveSearch
* @see AWS API Documentation
*/
@Override
public StartArchiveSearchResponse startArchiveSearch(StartArchiveSearchRequest startArchiveSearchRequest)
throws ValidationException, AccessDeniedException, ServiceQuotaExceededException, ConflictException,
ResourceNotFoundException, ThrottlingException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, StartArchiveSearchResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startArchiveSearchRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, startArchiveSearchRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartArchiveSearch");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StartArchiveSearch").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(startArchiveSearchRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StartArchiveSearchRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Stops an in-progress export of emails from an archive.
*
*
* @param stopArchiveExportRequest
* The request to stop an in-progress archive export job.
* @return Result of the StopArchiveExport operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.StopArchiveExport
* @see AWS
* API Documentation
*/
@Override
public StopArchiveExportResponse stopArchiveExport(StopArchiveExportRequest stopArchiveExportRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException,
MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StopArchiveExportResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopArchiveExportRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, stopArchiveExportRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopArchiveExport");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StopArchiveExport").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(stopArchiveExportRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StopArchiveExportRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Stops an in-progress archive search job.
*
*
* @param stopArchiveSearchRequest
* The request to stop an in-progress archive search job.
* @return Result of the StopArchiveSearch operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.StopArchiveSearch
* @see AWS
* API Documentation
*/
@Override
public StopArchiveSearchResponse stopArchiveSearch(StopArchiveSearchRequest stopArchiveSearchRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException,
MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StopArchiveSearchResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopArchiveSearchRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, stopArchiveSearchRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopArchiveSearch");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StopArchiveSearch").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(stopArchiveSearchRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StopArchiveSearchRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds one or more tags (keys and values) to a specified resource.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ServiceQuotaExceededException
* Occurs when an operation exceeds a predefined service quota or limit.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.TagResource
* @see AWS API
* Documentation
*/
@Override
public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws ValidationException,
ServiceQuotaExceededException, ConflictException, ResourceNotFoundException, AwsServiceException, SdkClientException,
MailManagerException {
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, "MailManager");
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 ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.UntagResource
* @see AWS API
* Documentation
*/
@Override
public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ValidationException,
ConflictException, ResourceNotFoundException, AwsServiceException, SdkClientException, MailManagerException {
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, "MailManager");
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()));
}
}
/**
*
* Updates the attributes of an existing email archive.
*
*
* @param updateArchiveRequest
* The request to update properties of an existing email archive.
* @return Result of the UpdateArchive operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws AccessDeniedException
* Occurs when a user is denied access to a specific resource or action.
* @throws ServiceQuotaExceededException
* Occurs when an operation exceeds a predefined service quota or limit.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @throws ThrottlingException
* Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.UpdateArchive
* @see AWS API
* Documentation
*/
@Override
public UpdateArchiveResponse updateArchive(UpdateArchiveRequest updateArchiveRequest) throws ValidationException,
AccessDeniedException, ServiceQuotaExceededException, ConflictException, ResourceNotFoundException,
ThrottlingException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateArchiveResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateArchiveRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateArchiveRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateArchive");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateArchive").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateArchiveRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateArchiveRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Update attributes of a provisioned ingress endpoint resource.
*
*
* @param updateIngressPointRequest
* @return Result of the UpdateIngressPoint operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.UpdateIngressPoint
* @see AWS API Documentation
*/
@Override
public UpdateIngressPointResponse updateIngressPoint(UpdateIngressPointRequest updateIngressPointRequest)
throws ValidationException, ConflictException, ResourceNotFoundException, AwsServiceException, SdkClientException,
MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateIngressPointResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateIngressPointRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateIngressPointRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateIngressPoint");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateIngressPoint").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateIngressPointRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateIngressPointRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the attributes of an existing relay resource.
*
*
* @param updateRelayRequest
* @return Result of the UpdateRelay operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.UpdateRelay
* @see AWS API
* Documentation
*/
@Override
public UpdateRelayResponse updateRelay(UpdateRelayRequest updateRelayRequest) throws ValidationException, ConflictException,
ResourceNotFoundException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateRelayResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateRelayRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateRelayRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateRelay");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateRelay").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(updateRelayRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateRelayRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Update attributes of an already provisioned rule set.
*
*
* @param updateRuleSetRequest
* @return Result of the UpdateRuleSet operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.UpdateRuleSet
* @see AWS API
* Documentation
*/
@Override
public UpdateRuleSetResponse updateRuleSet(UpdateRuleSetRequest updateRuleSetRequest) throws ValidationException,
ConflictException, ResourceNotFoundException, AwsServiceException, SdkClientException, MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateRuleSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateRuleSetRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateRuleSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateRuleSet");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateRuleSet").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateRuleSetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateRuleSetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Update attributes of an already provisioned traffic policy resource.
*
*
* @param updateTrafficPolicyRequest
* @return Result of the UpdateTrafficPolicy operation returned by the service.
* @throws ValidationException
* The request validation has failed. For details, see the accompanying error message.
* @throws ConflictException
* The request configuration has conflicts. For details, see the accompanying error message.
* @throws ResourceNotFoundException
* Occurs when a requested resource is not found.
* @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 MailManagerException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MailManagerClient.UpdateTrafficPolicy
* @see AWS API Documentation
*/
@Override
public UpdateTrafficPolicyResponse updateTrafficPolicy(UpdateTrafficPolicyRequest updateTrafficPolicyRequest)
throws ValidationException, ConflictException, ResourceNotFoundException, AwsServiceException, SdkClientException,
MailManagerException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateTrafficPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateTrafficPolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateTrafficPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MailManager");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateTrafficPolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateTrafficPolicy").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateTrafficPolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateTrafficPolicyRequestMarshaller(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();
}
MailManagerServiceClientConfigurationBuilder serviceConfigBuilder = new MailManagerServiceClientConfigurationBuilder(
configuration);
for (SdkPlugin plugin : plugins) {
plugin.configureClient(serviceConfigBuilder);
}
updateRetryStrategyClientConfiguration(configuration);
return configuration.build();
}
private > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(MailManagerException::builder)
.protocol(AwsJsonProtocol.AWS_JSON)
.protocolVersion("1.0")
.registerModeledException(
ExceptionMetadata.builder().errorCode("ServiceQuotaExceededException")
.exceptionBuilderSupplier(ServiceQuotaExceededException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceNotFoundException")
.exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ValidationException")
.exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ThrottlingException")
.exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AccessDeniedException")
.exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ConflictException")
.exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(400).build());
}
@Override
public final MailManagerServiceClientConfiguration serviceClientConfiguration() {
return new MailManagerServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build();
}
@Override
public void close() {
clientHandler.close();
}
}