All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.pinpoint.DefaultPinpointAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Pinpoint module holds the client classes that are used for communicating with Amazon Pinpoint Service

There is a newer version: 2.29.39
Show newest version
/*
 * 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.pinpoint;

import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
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.services.pinpoint.model.BadRequestException;
import software.amazon.awssdk.services.pinpoint.model.ConflictException;
import software.amazon.awssdk.services.pinpoint.model.CreateAppRequest;
import software.amazon.awssdk.services.pinpoint.model.CreateAppResponse;
import software.amazon.awssdk.services.pinpoint.model.CreateCampaignRequest;
import software.amazon.awssdk.services.pinpoint.model.CreateCampaignResponse;
import software.amazon.awssdk.services.pinpoint.model.CreateEmailTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.CreateEmailTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.CreateExportJobRequest;
import software.amazon.awssdk.services.pinpoint.model.CreateExportJobResponse;
import software.amazon.awssdk.services.pinpoint.model.CreateImportJobRequest;
import software.amazon.awssdk.services.pinpoint.model.CreateImportJobResponse;
import software.amazon.awssdk.services.pinpoint.model.CreateInAppTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.CreateInAppTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.CreateJourneyRequest;
import software.amazon.awssdk.services.pinpoint.model.CreateJourneyResponse;
import software.amazon.awssdk.services.pinpoint.model.CreatePushTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.CreatePushTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.CreateRecommenderConfigurationRequest;
import software.amazon.awssdk.services.pinpoint.model.CreateRecommenderConfigurationResponse;
import software.amazon.awssdk.services.pinpoint.model.CreateSegmentRequest;
import software.amazon.awssdk.services.pinpoint.model.CreateSegmentResponse;
import software.amazon.awssdk.services.pinpoint.model.CreateSmsTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.CreateSmsTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.CreateVoiceTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.CreateVoiceTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteAdmChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteAdmChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteApnsChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteApnsChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteApnsSandboxChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteApnsSandboxChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteApnsVoipChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteApnsVoipChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteApnsVoipSandboxChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteApnsVoipSandboxChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteAppRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteAppResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteBaiduChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteBaiduChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteCampaignRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteCampaignResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteEmailChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteEmailChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteEmailTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteEmailTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteEndpointRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteEndpointResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteEventStreamRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteEventStreamResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteGcmChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteGcmChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteInAppTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteInAppTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteJourneyRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteJourneyResponse;
import software.amazon.awssdk.services.pinpoint.model.DeletePushTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.DeletePushTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteRecommenderConfigurationRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteRecommenderConfigurationResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteSegmentRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteSegmentResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteSmsChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteSmsChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteSmsTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteSmsTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteUserEndpointsRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteUserEndpointsResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteVoiceChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteVoiceChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.DeleteVoiceTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.DeleteVoiceTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.ForbiddenException;
import software.amazon.awssdk.services.pinpoint.model.GetAdmChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.GetAdmChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.GetApnsChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.GetApnsChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.GetApnsSandboxChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.GetApnsSandboxChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.GetApnsVoipChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.GetApnsVoipChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.GetApnsVoipSandboxChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.GetApnsVoipSandboxChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.GetAppRequest;
import software.amazon.awssdk.services.pinpoint.model.GetAppResponse;
import software.amazon.awssdk.services.pinpoint.model.GetApplicationDateRangeKpiRequest;
import software.amazon.awssdk.services.pinpoint.model.GetApplicationDateRangeKpiResponse;
import software.amazon.awssdk.services.pinpoint.model.GetApplicationSettingsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetApplicationSettingsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetAppsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetAppsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetBaiduChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.GetBaiduChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.GetCampaignActivitiesRequest;
import software.amazon.awssdk.services.pinpoint.model.GetCampaignActivitiesResponse;
import software.amazon.awssdk.services.pinpoint.model.GetCampaignDateRangeKpiRequest;
import software.amazon.awssdk.services.pinpoint.model.GetCampaignDateRangeKpiResponse;
import software.amazon.awssdk.services.pinpoint.model.GetCampaignRequest;
import software.amazon.awssdk.services.pinpoint.model.GetCampaignResponse;
import software.amazon.awssdk.services.pinpoint.model.GetCampaignVersionRequest;
import software.amazon.awssdk.services.pinpoint.model.GetCampaignVersionResponse;
import software.amazon.awssdk.services.pinpoint.model.GetCampaignVersionsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetCampaignVersionsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetCampaignsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetCampaignsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetChannelsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetChannelsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetEmailChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.GetEmailChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.GetEmailTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.GetEmailTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.GetEndpointRequest;
import software.amazon.awssdk.services.pinpoint.model.GetEndpointResponse;
import software.amazon.awssdk.services.pinpoint.model.GetEventStreamRequest;
import software.amazon.awssdk.services.pinpoint.model.GetEventStreamResponse;
import software.amazon.awssdk.services.pinpoint.model.GetExportJobRequest;
import software.amazon.awssdk.services.pinpoint.model.GetExportJobResponse;
import software.amazon.awssdk.services.pinpoint.model.GetExportJobsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetExportJobsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetGcmChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.GetGcmChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.GetImportJobRequest;
import software.amazon.awssdk.services.pinpoint.model.GetImportJobResponse;
import software.amazon.awssdk.services.pinpoint.model.GetImportJobsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetImportJobsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetInAppMessagesRequest;
import software.amazon.awssdk.services.pinpoint.model.GetInAppMessagesResponse;
import software.amazon.awssdk.services.pinpoint.model.GetInAppTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.GetInAppTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.GetJourneyDateRangeKpiRequest;
import software.amazon.awssdk.services.pinpoint.model.GetJourneyDateRangeKpiResponse;
import software.amazon.awssdk.services.pinpoint.model.GetJourneyExecutionActivityMetricsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetJourneyExecutionActivityMetricsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetJourneyExecutionMetricsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetJourneyExecutionMetricsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetJourneyRequest;
import software.amazon.awssdk.services.pinpoint.model.GetJourneyResponse;
import software.amazon.awssdk.services.pinpoint.model.GetPushTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.GetPushTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.GetRecommenderConfigurationRequest;
import software.amazon.awssdk.services.pinpoint.model.GetRecommenderConfigurationResponse;
import software.amazon.awssdk.services.pinpoint.model.GetRecommenderConfigurationsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetRecommenderConfigurationsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetSegmentExportJobsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetSegmentExportJobsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetSegmentImportJobsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetSegmentImportJobsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetSegmentRequest;
import software.amazon.awssdk.services.pinpoint.model.GetSegmentResponse;
import software.amazon.awssdk.services.pinpoint.model.GetSegmentVersionRequest;
import software.amazon.awssdk.services.pinpoint.model.GetSegmentVersionResponse;
import software.amazon.awssdk.services.pinpoint.model.GetSegmentVersionsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetSegmentVersionsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetSegmentsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetSegmentsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetSmsChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.GetSmsChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.GetSmsTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.GetSmsTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.GetUserEndpointsRequest;
import software.amazon.awssdk.services.pinpoint.model.GetUserEndpointsResponse;
import software.amazon.awssdk.services.pinpoint.model.GetVoiceChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.GetVoiceChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.GetVoiceTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.GetVoiceTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.InternalServerErrorException;
import software.amazon.awssdk.services.pinpoint.model.ListJourneysRequest;
import software.amazon.awssdk.services.pinpoint.model.ListJourneysResponse;
import software.amazon.awssdk.services.pinpoint.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.pinpoint.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.pinpoint.model.ListTemplateVersionsRequest;
import software.amazon.awssdk.services.pinpoint.model.ListTemplateVersionsResponse;
import software.amazon.awssdk.services.pinpoint.model.ListTemplatesRequest;
import software.amazon.awssdk.services.pinpoint.model.ListTemplatesResponse;
import software.amazon.awssdk.services.pinpoint.model.MethodNotAllowedException;
import software.amazon.awssdk.services.pinpoint.model.NotFoundException;
import software.amazon.awssdk.services.pinpoint.model.PayloadTooLargeException;
import software.amazon.awssdk.services.pinpoint.model.PhoneNumberValidateRequest;
import software.amazon.awssdk.services.pinpoint.model.PhoneNumberValidateResponse;
import software.amazon.awssdk.services.pinpoint.model.PinpointException;
import software.amazon.awssdk.services.pinpoint.model.PutEventStreamRequest;
import software.amazon.awssdk.services.pinpoint.model.PutEventStreamResponse;
import software.amazon.awssdk.services.pinpoint.model.PutEventsRequest;
import software.amazon.awssdk.services.pinpoint.model.PutEventsResponse;
import software.amazon.awssdk.services.pinpoint.model.RemoveAttributesRequest;
import software.amazon.awssdk.services.pinpoint.model.RemoveAttributesResponse;
import software.amazon.awssdk.services.pinpoint.model.SendMessagesRequest;
import software.amazon.awssdk.services.pinpoint.model.SendMessagesResponse;
import software.amazon.awssdk.services.pinpoint.model.SendUsersMessagesRequest;
import software.amazon.awssdk.services.pinpoint.model.SendUsersMessagesResponse;
import software.amazon.awssdk.services.pinpoint.model.TagResourceRequest;
import software.amazon.awssdk.services.pinpoint.model.TagResourceResponse;
import software.amazon.awssdk.services.pinpoint.model.TooManyRequestsException;
import software.amazon.awssdk.services.pinpoint.model.UntagResourceRequest;
import software.amazon.awssdk.services.pinpoint.model.UntagResourceResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateAdmChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateAdmChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateApnsChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateApnsChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateApnsSandboxChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateApnsSandboxChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateApnsVoipChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateApnsVoipChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateApnsVoipSandboxChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateApnsVoipSandboxChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateApplicationSettingsRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateApplicationSettingsResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateBaiduChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateBaiduChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateCampaignRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateCampaignResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateEmailChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateEmailChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateEmailTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateEmailTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateEndpointRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateEndpointResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateEndpointsBatchRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateEndpointsBatchResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateGcmChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateGcmChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateInAppTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateInAppTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateJourneyRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateJourneyResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateJourneyStateRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateJourneyStateResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdatePushTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdatePushTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateRecommenderConfigurationRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateRecommenderConfigurationResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateSegmentRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateSegmentResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateSmsChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateSmsChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateSmsTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateSmsTemplateResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateTemplateActiveVersionRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateTemplateActiveVersionResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateVoiceChannelRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateVoiceChannelResponse;
import software.amazon.awssdk.services.pinpoint.model.UpdateVoiceTemplateRequest;
import software.amazon.awssdk.services.pinpoint.model.UpdateVoiceTemplateResponse;
import software.amazon.awssdk.services.pinpoint.transform.CreateAppRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.CreateCampaignRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.CreateEmailTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.CreateExportJobRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.CreateImportJobRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.CreateInAppTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.CreateJourneyRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.CreatePushTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.CreateRecommenderConfigurationRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.CreateSegmentRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.CreateSmsTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.CreateVoiceTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteAdmChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteApnsChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteApnsSandboxChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteApnsVoipChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteApnsVoipSandboxChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteAppRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteBaiduChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteCampaignRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteEmailChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteEmailTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteEndpointRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteEventStreamRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteGcmChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteInAppTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteJourneyRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeletePushTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteRecommenderConfigurationRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteSegmentRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteSmsChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteSmsTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteUserEndpointsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteVoiceChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.DeleteVoiceTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetAdmChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetApnsChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetApnsSandboxChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetApnsVoipChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetApnsVoipSandboxChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetAppRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetApplicationDateRangeKpiRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetApplicationSettingsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetAppsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetBaiduChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetCampaignActivitiesRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetCampaignDateRangeKpiRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetCampaignRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetCampaignVersionRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetCampaignVersionsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetCampaignsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetChannelsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetEmailChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetEmailTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetEndpointRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetEventStreamRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetExportJobRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetExportJobsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetGcmChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetImportJobRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetImportJobsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetInAppMessagesRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetInAppTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetJourneyDateRangeKpiRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetJourneyExecutionActivityMetricsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetJourneyExecutionMetricsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetJourneyRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetPushTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetRecommenderConfigurationRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetRecommenderConfigurationsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetSegmentExportJobsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetSegmentImportJobsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetSegmentRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetSegmentVersionRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetSegmentVersionsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetSegmentsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetSmsChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetSmsTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetUserEndpointsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetVoiceChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.GetVoiceTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.ListJourneysRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.ListTemplateVersionsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.ListTemplatesRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.PhoneNumberValidateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.PutEventStreamRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.PutEventsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.RemoveAttributesRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.SendMessagesRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.SendUsersMessagesRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateAdmChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateApnsChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateApnsSandboxChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateApnsVoipChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateApnsVoipSandboxChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateApplicationSettingsRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateBaiduChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateCampaignRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateEmailChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateEmailTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateEndpointRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateEndpointsBatchRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateGcmChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateInAppTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateJourneyRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateJourneyStateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdatePushTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateRecommenderConfigurationRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateSegmentRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateSmsChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateSmsTemplateRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateTemplateActiveVersionRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateVoiceChannelRequestMarshaller;
import software.amazon.awssdk.services.pinpoint.transform.UpdateVoiceTemplateRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;

/**
 * Internal implementation of {@link PinpointAsyncClient}.
 *
 * @see PinpointAsyncClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultPinpointAsyncClient implements PinpointAsyncClient {
    private static final Logger log = LoggerFactory.getLogger(DefaultPinpointAsyncClient.class);

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    protected DefaultPinpointAsyncClient(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration;
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    @Override
    public final String serviceName() {
        return SERVICE_NAME;
    }

    /**
     * 

* Creates an application. *

* * @param createAppRequest * @return A Java Future containing the result of the CreateApp operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.CreateApp * @see AWS API * Documentation */ @Override public CompletableFuture createApp(CreateAppRequest createAppRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createAppRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateApp"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateAppResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("CreateApp") .withMarshaller(new CreateAppRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(createAppRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createAppRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new campaign for an application or updates the settings of an existing campaign for an application. *

* * @param createCampaignRequest * @return A Java Future containing the result of the CreateCampaign operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.CreateCampaign * @see AWS API * Documentation */ @Override public CompletableFuture createCampaign(CreateCampaignRequest createCampaignRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCampaign"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateCampaign") .withMarshaller(new CreateCampaignRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createCampaignRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createCampaignRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a message template for messages that are sent through the email channel. *

* * @param createEmailTemplateRequest * @return A Java Future containing the result of the CreateEmailTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.CreateEmailTemplate * @see AWS * API Documentation */ @Override public CompletableFuture createEmailTemplate( CreateEmailTemplateRequest createEmailTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createEmailTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateEmailTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateEmailTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateEmailTemplate") .withMarshaller(new CreateEmailTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createEmailTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createEmailTemplateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an export job for an application. *

* * @param createExportJobRequest * @return A Java Future containing the result of the CreateExportJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.CreateExportJob * @see AWS API * Documentation */ @Override public CompletableFuture createExportJob(CreateExportJobRequest createExportJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createExportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateExportJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateExportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateExportJob") .withMarshaller(new CreateExportJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createExportJobRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createExportJobRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an import job for an application. *

* * @param createImportJobRequest * @return A Java Future containing the result of the CreateImportJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.CreateImportJob * @see AWS API * Documentation */ @Override public CompletableFuture createImportJob(CreateImportJobRequest createImportJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createImportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateImportJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateImportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateImportJob") .withMarshaller(new CreateImportJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createImportJobRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createImportJobRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new message template for messages using the in-app message channel. *

* * @param createInAppTemplateRequest * @return A Java Future containing the result of the CreateInAppTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.CreateInAppTemplate * @see AWS * API Documentation */ @Override public CompletableFuture createInAppTemplate( CreateInAppTemplateRequest createInAppTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createInAppTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateInAppTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateInAppTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateInAppTemplate") .withMarshaller(new CreateInAppTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createInAppTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createInAppTemplateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a journey for an application. *

* * @param createJourneyRequest * @return A Java Future containing the result of the CreateJourney operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.CreateJourney * @see AWS API * Documentation */ @Override public CompletableFuture createJourney(CreateJourneyRequest createJourneyRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createJourneyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateJourney"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateJourneyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateJourney") .withMarshaller(new CreateJourneyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createJourneyRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createJourneyRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a message template for messages that are sent through a push notification channel. *

* * @param createPushTemplateRequest * @return A Java Future containing the result of the CreatePushTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.CreatePushTemplate * @see AWS * API Documentation */ @Override public CompletableFuture createPushTemplate(CreatePushTemplateRequest createPushTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createPushTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreatePushTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreatePushTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreatePushTemplate") .withMarshaller(new CreatePushTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createPushTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createPushTemplateRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an Amazon Pinpoint configuration for a recommender model. *

* * @param createRecommenderConfigurationRequest * @return A Java Future containing the result of the CreateRecommenderConfiguration operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.CreateRecommenderConfiguration * @see AWS API Documentation */ @Override public CompletableFuture createRecommenderConfiguration( CreateRecommenderConfigurationRequest createRecommenderConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createRecommenderConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateRecommenderConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateRecommenderConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateRecommenderConfiguration") .withMarshaller(new CreateRecommenderConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createRecommenderConfigurationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createRecommenderConfigurationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new segment for an application or updates the configuration, dimension, and other settings for an * existing segment that's associated with an application. *

* * @param createSegmentRequest * @return A Java Future containing the result of the CreateSegment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.CreateSegment * @see AWS API * Documentation */ @Override public CompletableFuture createSegment(CreateSegmentRequest createSegmentRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createSegmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSegment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateSegmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateSegment") .withMarshaller(new CreateSegmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createSegmentRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createSegmentRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a message template for messages that are sent through the SMS channel. *

* * @param createSmsTemplateRequest * @return A Java Future containing the result of the CreateSmsTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.CreateSmsTemplate * @see AWS * API Documentation */ @Override public CompletableFuture createSmsTemplate(CreateSmsTemplateRequest createSmsTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createSmsTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSmsTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateSmsTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateSmsTemplate") .withMarshaller(new CreateSmsTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createSmsTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createSmsTemplateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a message template for messages that are sent through the voice channel. *

* * @param createVoiceTemplateRequest * @return A Java Future containing the result of the CreateVoiceTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.CreateVoiceTemplate * @see AWS * API Documentation */ @Override public CompletableFuture createVoiceTemplate( CreateVoiceTemplateRequest createVoiceTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, createVoiceTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateVoiceTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateVoiceTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateVoiceTemplate") .withMarshaller(new CreateVoiceTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(createVoiceTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = createVoiceTemplateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disables the ADM channel for an application and deletes any existing settings for the channel. *

* * @param deleteAdmChannelRequest * @return A Java Future containing the result of the DeleteAdmChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteAdmChannel * @see AWS API * Documentation */ @Override public CompletableFuture deleteAdmChannel(DeleteAdmChannelRequest deleteAdmChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAdmChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAdmChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteAdmChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteAdmChannel") .withMarshaller(new DeleteAdmChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteAdmChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteAdmChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disables the APNs channel for an application and deletes any existing settings for the channel. *

* * @param deleteApnsChannelRequest * @return A Java Future containing the result of the DeleteApnsChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteApnsChannel * @see AWS * API Documentation */ @Override public CompletableFuture deleteApnsChannel(DeleteApnsChannelRequest deleteApnsChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteApnsChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteApnsChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteApnsChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteApnsChannel") .withMarshaller(new DeleteApnsChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteApnsChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteApnsChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disables the APNs sandbox channel for an application and deletes any existing settings for the channel. *

* * @param deleteApnsSandboxChannelRequest * @return A Java Future containing the result of the DeleteApnsSandboxChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteApnsSandboxChannel * @see AWS API Documentation */ @Override public CompletableFuture deleteApnsSandboxChannel( DeleteApnsSandboxChannelRequest deleteApnsSandboxChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteApnsSandboxChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteApnsSandboxChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteApnsSandboxChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteApnsSandboxChannel") .withMarshaller(new DeleteApnsSandboxChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteApnsSandboxChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteApnsSandboxChannelRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disables the APNs VoIP channel for an application and deletes any existing settings for the channel. *

* * @param deleteApnsVoipChannelRequest * @return A Java Future containing the result of the DeleteApnsVoipChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteApnsVoipChannel * @see AWS API Documentation */ @Override public CompletableFuture deleteApnsVoipChannel( DeleteApnsVoipChannelRequest deleteApnsVoipChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteApnsVoipChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteApnsVoipChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteApnsVoipChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteApnsVoipChannel") .withMarshaller(new DeleteApnsVoipChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteApnsVoipChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteApnsVoipChannelRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disables the APNs VoIP sandbox channel for an application and deletes any existing settings for the channel. *

* * @param deleteApnsVoipSandboxChannelRequest * @return A Java Future containing the result of the DeleteApnsVoipSandboxChannel operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteApnsVoipSandboxChannel * @see AWS API Documentation */ @Override public CompletableFuture deleteApnsVoipSandboxChannel( DeleteApnsVoipSandboxChannelRequest deleteApnsVoipSandboxChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteApnsVoipSandboxChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteApnsVoipSandboxChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteApnsVoipSandboxChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteApnsVoipSandboxChannel") .withMarshaller(new DeleteApnsVoipSandboxChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteApnsVoipSandboxChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteApnsVoipSandboxChannelRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an application. *

* * @param deleteAppRequest * @return A Java Future containing the result of the DeleteApp operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteApp * @see AWS API * Documentation */ @Override public CompletableFuture deleteApp(DeleteAppRequest deleteAppRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAppRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteApp"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteAppResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("DeleteApp") .withMarshaller(new DeleteAppRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(deleteAppRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteAppRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disables the Baidu channel for an application and deletes any existing settings for the channel. *

* * @param deleteBaiduChannelRequest * @return A Java Future containing the result of the DeleteBaiduChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteBaiduChannel * @see AWS * API Documentation */ @Override public CompletableFuture deleteBaiduChannel(DeleteBaiduChannelRequest deleteBaiduChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteBaiduChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteBaiduChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteBaiduChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteBaiduChannel") .withMarshaller(new DeleteBaiduChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteBaiduChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteBaiduChannelRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a campaign from an application. *

* * @param deleteCampaignRequest * @return A Java Future containing the result of the DeleteCampaign operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteCampaign * @see AWS API * Documentation */ @Override public CompletableFuture deleteCampaign(DeleteCampaignRequest deleteCampaignRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCampaign"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCampaign") .withMarshaller(new DeleteCampaignRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteCampaignRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteCampaignRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disables the email channel for an application and deletes any existing settings for the channel. *

* * @param deleteEmailChannelRequest * @return A Java Future containing the result of the DeleteEmailChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteEmailChannel * @see AWS * API Documentation */ @Override public CompletableFuture deleteEmailChannel(DeleteEmailChannelRequest deleteEmailChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteEmailChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteEmailChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteEmailChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteEmailChannel") .withMarshaller(new DeleteEmailChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteEmailChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteEmailChannelRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a message template for messages that were sent through the email channel. *

* * @param deleteEmailTemplateRequest * @return A Java Future containing the result of the DeleteEmailTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteEmailTemplate * @see AWS * API Documentation */ @Override public CompletableFuture deleteEmailTemplate( DeleteEmailTemplateRequest deleteEmailTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteEmailTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteEmailTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteEmailTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteEmailTemplate") .withMarshaller(new DeleteEmailTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteEmailTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteEmailTemplateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an endpoint from an application. *

* * @param deleteEndpointRequest * @return A Java Future containing the result of the DeleteEndpoint operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteEndpoint * @see AWS API * Documentation */ @Override public CompletableFuture deleteEndpoint(DeleteEndpointRequest deleteEndpointRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteEndpointRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteEndpoint"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteEndpointResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteEndpoint") .withMarshaller(new DeleteEndpointRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteEndpointRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteEndpointRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the event stream for an application. *

* * @param deleteEventStreamRequest * @return A Java Future containing the result of the DeleteEventStream operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteEventStream * @see AWS * API Documentation */ @Override public CompletableFuture deleteEventStream(DeleteEventStreamRequest deleteEventStreamRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteEventStreamRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteEventStream"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteEventStreamResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteEventStream") .withMarshaller(new DeleteEventStreamRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteEventStreamRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteEventStreamRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disables the GCM channel for an application and deletes any existing settings for the channel. *

* * @param deleteGcmChannelRequest * @return A Java Future containing the result of the DeleteGcmChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteGcmChannel * @see AWS API * Documentation */ @Override public CompletableFuture deleteGcmChannel(DeleteGcmChannelRequest deleteGcmChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteGcmChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteGcmChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteGcmChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteGcmChannel") .withMarshaller(new DeleteGcmChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteGcmChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteGcmChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a message template for messages sent using the in-app message channel. *

* * @param deleteInAppTemplateRequest * @return A Java Future containing the result of the DeleteInAppTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteInAppTemplate * @see AWS * API Documentation */ @Override public CompletableFuture deleteInAppTemplate( DeleteInAppTemplateRequest deleteInAppTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteInAppTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteInAppTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteInAppTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteInAppTemplate") .withMarshaller(new DeleteInAppTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteInAppTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteInAppTemplateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a journey from an application. *

* * @param deleteJourneyRequest * @return A Java Future containing the result of the DeleteJourney operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteJourney * @see AWS API * Documentation */ @Override public CompletableFuture deleteJourney(DeleteJourneyRequest deleteJourneyRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteJourneyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteJourney"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteJourneyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteJourney") .withMarshaller(new DeleteJourneyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteJourneyRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteJourneyRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a message template for messages that were sent through a push notification channel. *

* * @param deletePushTemplateRequest * @return A Java Future containing the result of the DeletePushTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeletePushTemplate * @see AWS * API Documentation */ @Override public CompletableFuture deletePushTemplate(DeletePushTemplateRequest deletePushTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deletePushTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeletePushTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeletePushTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeletePushTemplate") .withMarshaller(new DeletePushTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deletePushTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deletePushTemplateRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an Amazon Pinpoint configuration for a recommender model. *

* * @param deleteRecommenderConfigurationRequest * @return A Java Future containing the result of the DeleteRecommenderConfiguration operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteRecommenderConfiguration * @see AWS API Documentation */ @Override public CompletableFuture deleteRecommenderConfiguration( DeleteRecommenderConfigurationRequest deleteRecommenderConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteRecommenderConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteRecommenderConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteRecommenderConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteRecommenderConfiguration") .withMarshaller(new DeleteRecommenderConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteRecommenderConfigurationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteRecommenderConfigurationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a segment from an application. *

* * @param deleteSegmentRequest * @return A Java Future containing the result of the DeleteSegment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteSegment * @see AWS API * Documentation */ @Override public CompletableFuture deleteSegment(DeleteSegmentRequest deleteSegmentRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSegmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSegment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteSegmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteSegment") .withMarshaller(new DeleteSegmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteSegmentRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteSegmentRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disables the SMS channel for an application and deletes any existing settings for the channel. *

* * @param deleteSmsChannelRequest * @return A Java Future containing the result of the DeleteSmsChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteSmsChannel * @see AWS API * Documentation */ @Override public CompletableFuture deleteSmsChannel(DeleteSmsChannelRequest deleteSmsChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSmsChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSmsChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteSmsChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteSmsChannel") .withMarshaller(new DeleteSmsChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteSmsChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteSmsChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a message template for messages that were sent through the SMS channel. *

* * @param deleteSmsTemplateRequest * @return A Java Future containing the result of the DeleteSmsTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteSmsTemplate * @see AWS * API Documentation */ @Override public CompletableFuture deleteSmsTemplate(DeleteSmsTemplateRequest deleteSmsTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSmsTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSmsTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteSmsTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteSmsTemplate") .withMarshaller(new DeleteSmsTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteSmsTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteSmsTemplateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes all the endpoints that are associated with a specific user ID. *

* * @param deleteUserEndpointsRequest * @return A Java Future containing the result of the DeleteUserEndpoints operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteUserEndpoints * @see AWS * API Documentation */ @Override public CompletableFuture deleteUserEndpoints( DeleteUserEndpointsRequest deleteUserEndpointsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteUserEndpointsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteUserEndpoints"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteUserEndpointsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteUserEndpoints") .withMarshaller(new DeleteUserEndpointsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteUserEndpointsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteUserEndpointsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disables the voice channel for an application and deletes any existing settings for the channel. *

* * @param deleteVoiceChannelRequest * @return A Java Future containing the result of the DeleteVoiceChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteVoiceChannel * @see AWS * API Documentation */ @Override public CompletableFuture deleteVoiceChannel(DeleteVoiceChannelRequest deleteVoiceChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteVoiceChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteVoiceChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteVoiceChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteVoiceChannel") .withMarshaller(new DeleteVoiceChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteVoiceChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteVoiceChannelRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a message template for messages that were sent through the voice channel. *

* * @param deleteVoiceTemplateRequest * @return A Java Future containing the result of the DeleteVoiceTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.DeleteVoiceTemplate * @see AWS * API Documentation */ @Override public CompletableFuture deleteVoiceTemplate( DeleteVoiceTemplateRequest deleteVoiceTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteVoiceTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteVoiceTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteVoiceTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteVoiceTemplate") .withMarshaller(new DeleteVoiceTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(deleteVoiceTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = deleteVoiceTemplateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of the ADM channel for an application. *

* * @param getAdmChannelRequest * @return A Java Future containing the result of the GetAdmChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetAdmChannel * @see AWS API * Documentation */ @Override public CompletableFuture getAdmChannel(GetAdmChannelRequest getAdmChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getAdmChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAdmChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetAdmChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetAdmChannel") .withMarshaller(new GetAdmChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getAdmChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getAdmChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of the APNs channel for an application. *

* * @param getApnsChannelRequest * @return A Java Future containing the result of the GetApnsChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetApnsChannel * @see AWS API * Documentation */ @Override public CompletableFuture getApnsChannel(GetApnsChannelRequest getApnsChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getApnsChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetApnsChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetApnsChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetApnsChannel") .withMarshaller(new GetApnsChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getApnsChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getApnsChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of the APNs sandbox channel for an application. *

* * @param getApnsSandboxChannelRequest * @return A Java Future containing the result of the GetApnsSandboxChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetApnsSandboxChannel * @see AWS API Documentation */ @Override public CompletableFuture getApnsSandboxChannel( GetApnsSandboxChannelRequest getApnsSandboxChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getApnsSandboxChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetApnsSandboxChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetApnsSandboxChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetApnsSandboxChannel") .withMarshaller(new GetApnsSandboxChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getApnsSandboxChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getApnsSandboxChannelRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of the APNs VoIP channel for an application. *

* * @param getApnsVoipChannelRequest * @return A Java Future containing the result of the GetApnsVoipChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetApnsVoipChannel * @see AWS * API Documentation */ @Override public CompletableFuture getApnsVoipChannel(GetApnsVoipChannelRequest getApnsVoipChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getApnsVoipChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetApnsVoipChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetApnsVoipChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetApnsVoipChannel") .withMarshaller(new GetApnsVoipChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getApnsVoipChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getApnsVoipChannelRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of the APNs VoIP sandbox channel for an application. *

* * @param getApnsVoipSandboxChannelRequest * @return A Java Future containing the result of the GetApnsVoipSandboxChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetApnsVoipSandboxChannel * @see AWS API Documentation */ @Override public CompletableFuture getApnsVoipSandboxChannel( GetApnsVoipSandboxChannelRequest getApnsVoipSandboxChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getApnsVoipSandboxChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetApnsVoipSandboxChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetApnsVoipSandboxChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetApnsVoipSandboxChannel") .withMarshaller(new GetApnsVoipSandboxChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getApnsVoipSandboxChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getApnsVoipSandboxChannelRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about an application. *

* * @param getAppRequest * @return A Java Future containing the result of the GetApp operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetApp * @see AWS API * Documentation */ @Override public CompletableFuture getApp(GetAppRequest getAppRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getAppRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetApp"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetAppResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetApp") .withMarshaller(new GetAppRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(getAppRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getAppRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves (queries) pre-aggregated data for a standard metric that applies to an application. *

* * @param getApplicationDateRangeKpiRequest * @return A Java Future containing the result of the GetApplicationDateRangeKpi operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetApplicationDateRangeKpi * @see AWS API Documentation */ @Override public CompletableFuture getApplicationDateRangeKpi( GetApplicationDateRangeKpiRequest getApplicationDateRangeKpiRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getApplicationDateRangeKpiRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetApplicationDateRangeKpi"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetApplicationDateRangeKpiResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetApplicationDateRangeKpi") .withMarshaller(new GetApplicationDateRangeKpiRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getApplicationDateRangeKpiRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getApplicationDateRangeKpiRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the settings for an application. *

* * @param getApplicationSettingsRequest * @return A Java Future containing the result of the GetApplicationSettings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetApplicationSettings * @see AWS API Documentation */ @Override public CompletableFuture getApplicationSettings( GetApplicationSettingsRequest getApplicationSettingsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getApplicationSettingsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetApplicationSettings"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetApplicationSettingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetApplicationSettings") .withMarshaller(new GetApplicationSettingsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getApplicationSettingsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getApplicationSettingsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about all the applications that are associated with your Amazon Pinpoint account. *

* * @param getAppsRequest * @return A Java Future containing the result of the GetApps operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetApps * @see AWS API * Documentation */ @Override public CompletableFuture getApps(GetAppsRequest getAppsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getAppsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetApps"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetAppsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetApps") .withMarshaller(new GetAppsRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(getAppsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getAppsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of the Baidu channel for an application. *

* * @param getBaiduChannelRequest * @return A Java Future containing the result of the GetBaiduChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetBaiduChannel * @see AWS API * Documentation */ @Override public CompletableFuture getBaiduChannel(GetBaiduChannelRequest getBaiduChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getBaiduChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetBaiduChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetBaiduChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetBaiduChannel") .withMarshaller(new GetBaiduChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getBaiduChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getBaiduChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status, configuration, and other settings for a campaign. *

* * @param getCampaignRequest * @return A Java Future containing the result of the GetCampaign operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetCampaign * @see AWS API * Documentation */ @Override public CompletableFuture getCampaign(GetCampaignRequest getCampaignRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCampaign"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCampaign").withMarshaller(new GetCampaignRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getCampaignRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getCampaignRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about all the activities for a campaign. *

* * @param getCampaignActivitiesRequest * @return A Java Future containing the result of the GetCampaignActivities operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetCampaignActivities * @see AWS API Documentation */ @Override public CompletableFuture getCampaignActivities( GetCampaignActivitiesRequest getCampaignActivitiesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getCampaignActivitiesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCampaignActivities"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCampaignActivitiesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCampaignActivities") .withMarshaller(new GetCampaignActivitiesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getCampaignActivitiesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getCampaignActivitiesRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves (queries) pre-aggregated data for a standard metric that applies to a campaign. *

* * @param getCampaignDateRangeKpiRequest * @return A Java Future containing the result of the GetCampaignDateRangeKpi operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetCampaignDateRangeKpi * @see AWS API Documentation */ @Override public CompletableFuture getCampaignDateRangeKpi( GetCampaignDateRangeKpiRequest getCampaignDateRangeKpiRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getCampaignDateRangeKpiRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCampaignDateRangeKpi"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCampaignDateRangeKpiResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCampaignDateRangeKpi") .withMarshaller(new GetCampaignDateRangeKpiRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getCampaignDateRangeKpiRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getCampaignDateRangeKpiRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status, configuration, and other settings for a specific version of a campaign. *

* * @param getCampaignVersionRequest * @return A Java Future containing the result of the GetCampaignVersion operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetCampaignVersion * @see AWS * API Documentation */ @Override public CompletableFuture getCampaignVersion(GetCampaignVersionRequest getCampaignVersionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getCampaignVersionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCampaignVersion"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCampaignVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCampaignVersion") .withMarshaller(new GetCampaignVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getCampaignVersionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getCampaignVersionRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status, configuration, and other settings for all versions of a campaign. *

* * @param getCampaignVersionsRequest * @return A Java Future containing the result of the GetCampaignVersions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetCampaignVersions * @see AWS * API Documentation */ @Override public CompletableFuture getCampaignVersions( GetCampaignVersionsRequest getCampaignVersionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getCampaignVersionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCampaignVersions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCampaignVersionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCampaignVersions") .withMarshaller(new GetCampaignVersionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getCampaignVersionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getCampaignVersionsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status, configuration, and other settings for all the campaigns that are * associated with an application. *

* * @param getCampaignsRequest * @return A Java Future containing the result of the GetCampaigns operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetCampaigns * @see AWS API * Documentation */ @Override public CompletableFuture getCampaigns(GetCampaignsRequest getCampaignsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getCampaignsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCampaigns"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetCampaignsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCampaigns").withMarshaller(new GetCampaignsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getCampaignsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getCampaignsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the history and status of each channel for an application. *

* * @param getChannelsRequest * @return A Java Future containing the result of the GetChannels operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetChannels * @see AWS API * Documentation */ @Override public CompletableFuture getChannels(GetChannelsRequest getChannelsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getChannelsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetChannels"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetChannelsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetChannels").withMarshaller(new GetChannelsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getChannelsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getChannelsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of the email channel for an application. *

* * @param getEmailChannelRequest * @return A Java Future containing the result of the GetEmailChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetEmailChannel * @see AWS API * Documentation */ @Override public CompletableFuture getEmailChannel(GetEmailChannelRequest getEmailChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getEmailChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetEmailChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetEmailChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetEmailChannel") .withMarshaller(new GetEmailChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getEmailChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getEmailChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the content and settings of a message template for messages that are sent through the email channel. *

* * @param getEmailTemplateRequest * @return A Java Future containing the result of the GetEmailTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetEmailTemplate * @see AWS API * Documentation */ @Override public CompletableFuture getEmailTemplate(GetEmailTemplateRequest getEmailTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getEmailTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetEmailTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetEmailTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetEmailTemplate") .withMarshaller(new GetEmailTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getEmailTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getEmailTemplateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the settings and attributes of a specific endpoint for an application. *

* * @param getEndpointRequest * @return A Java Future containing the result of the GetEndpoint operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetEndpoint * @see AWS API * Documentation */ @Override public CompletableFuture getEndpoint(GetEndpointRequest getEndpointRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getEndpointRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetEndpoint"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetEndpointResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetEndpoint").withMarshaller(new GetEndpointRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getEndpointRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getEndpointRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the event stream settings for an application. *

* * @param getEventStreamRequest * @return A Java Future containing the result of the GetEventStream operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetEventStream * @see AWS API * Documentation */ @Override public CompletableFuture getEventStream(GetEventStreamRequest getEventStreamRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getEventStreamRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetEventStream"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetEventStreamResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetEventStream") .withMarshaller(new GetEventStreamRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getEventStreamRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getEventStreamRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of a specific export job for an application. *

* * @param getExportJobRequest * @return A Java Future containing the result of the GetExportJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetExportJob * @see AWS API * Documentation */ @Override public CompletableFuture getExportJob(GetExportJobRequest getExportJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getExportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetExportJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetExportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetExportJob").withMarshaller(new GetExportJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getExportJobRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getExportJobRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of all the export jobs for an application. *

* * @param getExportJobsRequest * @return A Java Future containing the result of the GetExportJobs operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetExportJobs * @see AWS API * Documentation */ @Override public CompletableFuture getExportJobs(GetExportJobsRequest getExportJobsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getExportJobsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetExportJobs"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetExportJobsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetExportJobs") .withMarshaller(new GetExportJobsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getExportJobsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getExportJobsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of the GCM channel for an application. *

* * @param getGcmChannelRequest * @return A Java Future containing the result of the GetGcmChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetGcmChannel * @see AWS API * Documentation */ @Override public CompletableFuture getGcmChannel(GetGcmChannelRequest getGcmChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getGcmChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetGcmChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetGcmChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetGcmChannel") .withMarshaller(new GetGcmChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getGcmChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getGcmChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of a specific import job for an application. *

* * @param getImportJobRequest * @return A Java Future containing the result of the GetImportJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetImportJob * @see AWS API * Documentation */ @Override public CompletableFuture getImportJob(GetImportJobRequest getImportJobRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getImportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetImportJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetImportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetImportJob").withMarshaller(new GetImportJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getImportJobRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getImportJobRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of all the import jobs for an application. *

* * @param getImportJobsRequest * @return A Java Future containing the result of the GetImportJobs operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetImportJobs * @see AWS API * Documentation */ @Override public CompletableFuture getImportJobs(GetImportJobsRequest getImportJobsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getImportJobsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetImportJobs"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetImportJobsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetImportJobs") .withMarshaller(new GetImportJobsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getImportJobsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getImportJobsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the in-app messages targeted for the provided endpoint ID. *

* * @param getInAppMessagesRequest * @return A Java Future containing the result of the GetInAppMessages operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetInAppMessages * @see AWS API * Documentation */ @Override public CompletableFuture getInAppMessages(GetInAppMessagesRequest getInAppMessagesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getInAppMessagesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetInAppMessages"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetInAppMessagesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetInAppMessages") .withMarshaller(new GetInAppMessagesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getInAppMessagesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getInAppMessagesRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the content and settings of a message template for messages sent through the in-app channel. *

* * @param getInAppTemplateRequest * @return A Java Future containing the result of the GetInAppTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetInAppTemplate * @see AWS API * Documentation */ @Override public CompletableFuture getInAppTemplate(GetInAppTemplateRequest getInAppTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getInAppTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetInAppTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetInAppTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetInAppTemplate") .withMarshaller(new GetInAppTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getInAppTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getInAppTemplateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status, configuration, and other settings for a journey. *

* * @param getJourneyRequest * @return A Java Future containing the result of the GetJourney operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetJourney * @see AWS API * Documentation */ @Override public CompletableFuture getJourney(GetJourneyRequest getJourneyRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getJourneyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetJourney"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetJourneyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetJourney") .withMarshaller(new GetJourneyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getJourneyRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getJourneyRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves (queries) pre-aggregated data for a standard engagement metric that applies to a journey. *

* * @param getJourneyDateRangeKpiRequest * @return A Java Future containing the result of the GetJourneyDateRangeKpi operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetJourneyDateRangeKpi * @see AWS API Documentation */ @Override public CompletableFuture getJourneyDateRangeKpi( GetJourneyDateRangeKpiRequest getJourneyDateRangeKpiRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getJourneyDateRangeKpiRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetJourneyDateRangeKpi"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetJourneyDateRangeKpiResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetJourneyDateRangeKpi") .withMarshaller(new GetJourneyDateRangeKpiRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getJourneyDateRangeKpiRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getJourneyDateRangeKpiRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves (queries) pre-aggregated data for a standard execution metric that applies to a journey activity. *

* * @param getJourneyExecutionActivityMetricsRequest * @return A Java Future containing the result of the GetJourneyExecutionActivityMetrics operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetJourneyExecutionActivityMetrics * @see AWS API Documentation */ @Override public CompletableFuture getJourneyExecutionActivityMetrics( GetJourneyExecutionActivityMetricsRequest getJourneyExecutionActivityMetricsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getJourneyExecutionActivityMetricsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetJourneyExecutionActivityMetrics"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, GetJourneyExecutionActivityMetricsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetJourneyExecutionActivityMetrics") .withMarshaller(new GetJourneyExecutionActivityMetricsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getJourneyExecutionActivityMetricsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getJourneyExecutionActivityMetricsRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves (queries) pre-aggregated data for a standard execution metric that applies to a journey. *

* * @param getJourneyExecutionMetricsRequest * @return A Java Future containing the result of the GetJourneyExecutionMetrics operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetJourneyExecutionMetrics * @see AWS API Documentation */ @Override public CompletableFuture getJourneyExecutionMetrics( GetJourneyExecutionMetricsRequest getJourneyExecutionMetricsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getJourneyExecutionMetricsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetJourneyExecutionMetrics"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetJourneyExecutionMetricsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetJourneyExecutionMetrics") .withMarshaller(new GetJourneyExecutionMetricsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getJourneyExecutionMetricsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getJourneyExecutionMetricsRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the content and settings of a message template for messages that are sent through a push notification * channel. *

* * @param getPushTemplateRequest * @return A Java Future containing the result of the GetPushTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetPushTemplate * @see AWS API * Documentation */ @Override public CompletableFuture getPushTemplate(GetPushTemplateRequest getPushTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getPushTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetPushTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetPushTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetPushTemplate") .withMarshaller(new GetPushTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getPushTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getPushTemplateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about an Amazon Pinpoint configuration for a recommender model. *

* * @param getRecommenderConfigurationRequest * @return A Java Future containing the result of the GetRecommenderConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetRecommenderConfiguration * @see AWS API Documentation */ @Override public CompletableFuture getRecommenderConfiguration( GetRecommenderConfigurationRequest getRecommenderConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getRecommenderConfigurationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRecommenderConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetRecommenderConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetRecommenderConfiguration") .withMarshaller(new GetRecommenderConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getRecommenderConfigurationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getRecommenderConfigurationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about all the recommender model configurations that are associated with your Amazon * Pinpoint account. *

* * @param getRecommenderConfigurationsRequest * @return A Java Future containing the result of the GetRecommenderConfigurations operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetRecommenderConfigurations * @see AWS API Documentation */ @Override public CompletableFuture getRecommenderConfigurations( GetRecommenderConfigurationsRequest getRecommenderConfigurationsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getRecommenderConfigurationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRecommenderConfigurations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetRecommenderConfigurationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetRecommenderConfigurations") .withMarshaller(new GetRecommenderConfigurationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getRecommenderConfigurationsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getRecommenderConfigurationsRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the configuration, dimension, and other settings for a specific segment that's * associated with an application. *

* * @param getSegmentRequest * @return A Java Future containing the result of the GetSegment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetSegment * @see AWS API * Documentation */ @Override public CompletableFuture getSegment(GetSegmentRequest getSegmentRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getSegmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSegment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetSegmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetSegment") .withMarshaller(new GetSegmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getSegmentRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getSegmentRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of the export jobs for a segment. *

* * @param getSegmentExportJobsRequest * @return A Java Future containing the result of the GetSegmentExportJobs operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetSegmentExportJobs * @see AWS * API Documentation */ @Override public CompletableFuture getSegmentExportJobs( GetSegmentExportJobsRequest getSegmentExportJobsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getSegmentExportJobsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSegmentExportJobs"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSegmentExportJobsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSegmentExportJobs") .withMarshaller(new GetSegmentExportJobsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getSegmentExportJobsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getSegmentExportJobsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of the import jobs for a segment. *

* * @param getSegmentImportJobsRequest * @return A Java Future containing the result of the GetSegmentImportJobs operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetSegmentImportJobs * @see AWS * API Documentation */ @Override public CompletableFuture getSegmentImportJobs( GetSegmentImportJobsRequest getSegmentImportJobsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getSegmentImportJobsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSegmentImportJobs"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSegmentImportJobsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSegmentImportJobs") .withMarshaller(new GetSegmentImportJobsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getSegmentImportJobsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getSegmentImportJobsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the configuration, dimension, and other settings for a specific version of a segment * that's associated with an application. *

* * @param getSegmentVersionRequest * @return A Java Future containing the result of the GetSegmentVersion operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetSegmentVersion * @see AWS * API Documentation */ @Override public CompletableFuture getSegmentVersion(GetSegmentVersionRequest getSegmentVersionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getSegmentVersionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSegmentVersion"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSegmentVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSegmentVersion") .withMarshaller(new GetSegmentVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getSegmentVersionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getSegmentVersionRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the configuration, dimension, and other settings for all the versions of a specific * segment that's associated with an application. *

* * @param getSegmentVersionsRequest * @return A Java Future containing the result of the GetSegmentVersions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetSegmentVersions * @see AWS * API Documentation */ @Override public CompletableFuture getSegmentVersions(GetSegmentVersionsRequest getSegmentVersionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getSegmentVersionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSegmentVersions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSegmentVersionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSegmentVersions") .withMarshaller(new GetSegmentVersionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getSegmentVersionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getSegmentVersionsRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the configuration, dimension, and other settings for all the segments that are * associated with an application. *

* * @param getSegmentsRequest * @return A Java Future containing the result of the GetSegments operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetSegments * @see AWS API * Documentation */ @Override public CompletableFuture getSegments(GetSegmentsRequest getSegmentsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getSegmentsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSegments"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetSegmentsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSegments").withMarshaller(new GetSegmentsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getSegmentsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getSegmentsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of the SMS channel for an application. *

* * @param getSmsChannelRequest * @return A Java Future containing the result of the GetSmsChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetSmsChannel * @see AWS API * Documentation */ @Override public CompletableFuture getSmsChannel(GetSmsChannelRequest getSmsChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getSmsChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSmsChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetSmsChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSmsChannel") .withMarshaller(new GetSmsChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getSmsChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getSmsChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the content and settings of a message template for messages that are sent through the SMS channel. *

* * @param getSmsTemplateRequest * @return A Java Future containing the result of the GetSmsTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetSmsTemplate * @see AWS API * Documentation */ @Override public CompletableFuture getSmsTemplate(GetSmsTemplateRequest getSmsTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getSmsTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSmsTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSmsTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSmsTemplate") .withMarshaller(new GetSmsTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getSmsTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getSmsTemplateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about all the endpoints that are associated with a specific user ID. *

* * @param getUserEndpointsRequest * @return A Java Future containing the result of the GetUserEndpoints operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetUserEndpoints * @see AWS API * Documentation */ @Override public CompletableFuture getUserEndpoints(GetUserEndpointsRequest getUserEndpointsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getUserEndpointsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetUserEndpoints"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetUserEndpointsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetUserEndpoints") .withMarshaller(new GetUserEndpointsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getUserEndpointsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getUserEndpointsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status and settings of the voice channel for an application. *

* * @param getVoiceChannelRequest * @return A Java Future containing the result of the GetVoiceChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetVoiceChannel * @see AWS API * Documentation */ @Override public CompletableFuture getVoiceChannel(GetVoiceChannelRequest getVoiceChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getVoiceChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetVoiceChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetVoiceChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetVoiceChannel") .withMarshaller(new GetVoiceChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getVoiceChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getVoiceChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the content and settings of a message template for messages that are sent through the voice channel. *

* * @param getVoiceTemplateRequest * @return A Java Future containing the result of the GetVoiceTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.GetVoiceTemplate * @see AWS API * Documentation */ @Override public CompletableFuture getVoiceTemplate(GetVoiceTemplateRequest getVoiceTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, getVoiceTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetVoiceTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetVoiceTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetVoiceTemplate") .withMarshaller(new GetVoiceTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(getVoiceTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = getVoiceTemplateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about the status, configuration, and other settings for all the journeys that are * associated with an application. *

* * @param listJourneysRequest * @return A Java Future containing the result of the ListJourneys operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.ListJourneys * @see AWS API * Documentation */ @Override public CompletableFuture listJourneys(ListJourneysRequest listJourneysRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listJourneysRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListJourneys"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListJourneysResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListJourneys").withMarshaller(new ListJourneysRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listJourneysRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listJourneysRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves all the tags (keys and values) that are associated with an application, campaign, message template, or * segment. *

* * @param listTagsForResourceRequest * @return A Java Future containing the result of the ListTagsForResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.ListTagsForResource * @see AWS * API Documentation */ @Override public CompletableFuture listTagsForResource( ListTagsForResourceRequest listTagsForResourceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTagsForResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTagsForResource") .withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listTagsForResourceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listTagsForResourceRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about all the versions of a specific message template. *

* * @param listTemplateVersionsRequest * @return A Java Future containing the result of the ListTemplateVersions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.ListTemplateVersions * @see AWS * API Documentation */ @Override public CompletableFuture listTemplateVersions( ListTemplateVersionsRequest listTemplateVersionsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listTemplateVersionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTemplateVersions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTemplateVersionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTemplateVersions") .withMarshaller(new ListTemplateVersionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listTemplateVersionsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listTemplateVersionsRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about all the message templates that are associated with your Amazon Pinpoint account. *

* * @param listTemplatesRequest * @return A Java Future containing the result of the ListTemplates operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.ListTemplates * @see AWS API * Documentation */ @Override public CompletableFuture listTemplates(ListTemplatesRequest listTemplatesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, listTemplatesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTemplates"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListTemplatesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTemplates") .withMarshaller(new ListTemplatesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(listTemplatesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = listTemplatesRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves information about a phone number. *

* * @param phoneNumberValidateRequest * @return A Java Future containing the result of the PhoneNumberValidate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.PhoneNumberValidate * @see AWS * API Documentation */ @Override public CompletableFuture phoneNumberValidate( PhoneNumberValidateRequest phoneNumberValidateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, phoneNumberValidateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PhoneNumberValidate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, PhoneNumberValidateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("PhoneNumberValidate") .withMarshaller(new PhoneNumberValidateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(phoneNumberValidateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = phoneNumberValidateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new event stream for an application or updates the settings of an existing event stream for an * application. *

* * @param putEventStreamRequest * @return A Java Future containing the result of the PutEventStream operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.PutEventStream * @see AWS API * Documentation */ @Override public CompletableFuture putEventStream(PutEventStreamRequest putEventStreamRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, putEventStreamRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutEventStream"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, PutEventStreamResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("PutEventStream") .withMarshaller(new PutEventStreamRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(putEventStreamRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = putEventStreamRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new event to record for endpoints, or creates or updates endpoint data that existing events are * associated with. *

* * @param putEventsRequest * @return A Java Future containing the result of the PutEvents operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.PutEvents * @see AWS API * Documentation */ @Override public CompletableFuture putEvents(PutEventsRequest putEventsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, putEventsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutEvents"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, PutEventsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("PutEvents") .withMarshaller(new PutEventsRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) .withInput(putEventsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = putEventsRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Removes one or more attributes, of the same attribute type, from all the endpoints that are associated with an * application. *

* * @param removeAttributesRequest * @return A Java Future containing the result of the RemoveAttributes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.RemoveAttributes * @see AWS API * Documentation */ @Override public CompletableFuture removeAttributes(RemoveAttributesRequest removeAttributesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, removeAttributesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RemoveAttributes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RemoveAttributesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RemoveAttributes") .withMarshaller(new RemoveAttributesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(removeAttributesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = removeAttributesRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates and sends a direct message. *

* * @param sendMessagesRequest * @return A Java Future containing the result of the SendMessages operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.SendMessages * @see AWS API * Documentation */ @Override public CompletableFuture sendMessages(SendMessagesRequest sendMessagesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, sendMessagesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SendMessages"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, SendMessagesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SendMessages").withMarshaller(new SendMessagesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(sendMessagesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = sendMessagesRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates and sends a message to a list of users. *

* * @param sendUsersMessagesRequest * @return A Java Future containing the result of the SendUsersMessages operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.SendUsersMessages * @see AWS * API Documentation */ @Override public CompletableFuture sendUsersMessages(SendUsersMessagesRequest sendUsersMessagesRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, sendUsersMessagesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SendUsersMessages"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, SendUsersMessagesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SendUsersMessages") .withMarshaller(new SendUsersMessagesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(sendUsersMessagesRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = sendUsersMessagesRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Adds one or more tags (keys and values) to an application, campaign, message template, or segment. *

* * @param tagResourceRequest * @return A Java Future containing the result of the TagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.TagResource * @see AWS API * Documentation */ @Override public CompletableFuture tagResource(TagResourceRequest tagResourceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, TagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("TagResource").withMarshaller(new TagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(tagResourceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = tagResourceRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Removes one or more tags (keys and values) from an application, campaign, message template, or segment. *

* * @param untagResourceRequest * @return A Java Future containing the result of the UntagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UntagResource * @see AWS API * Documentation */ @Override public CompletableFuture untagResource(UntagResourceRequest untagResourceRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UntagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UntagResource") .withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(untagResourceRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = untagResourceRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Enables the ADM channel for an application or updates the status and settings of the ADM channel for an * application. *

* * @param updateAdmChannelRequest * @return A Java Future containing the result of the UpdateAdmChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateAdmChannel * @see AWS API * Documentation */ @Override public CompletableFuture updateAdmChannel(UpdateAdmChannelRequest updateAdmChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAdmChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAdmChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateAdmChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateAdmChannel") .withMarshaller(new UpdateAdmChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateAdmChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateAdmChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Enables the APNs channel for an application or updates the status and settings of the APNs channel for an * application. *

* * @param updateApnsChannelRequest * @return A Java Future containing the result of the UpdateApnsChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateApnsChannel * @see AWS * API Documentation */ @Override public CompletableFuture updateApnsChannel(UpdateApnsChannelRequest updateApnsChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateApnsChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateApnsChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateApnsChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateApnsChannel") .withMarshaller(new UpdateApnsChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateApnsChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateApnsChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Enables the APNs sandbox channel for an application or updates the status and settings of the APNs sandbox * channel for an application. *

* * @param updateApnsSandboxChannelRequest * @return A Java Future containing the result of the UpdateApnsSandboxChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateApnsSandboxChannel * @see AWS API Documentation */ @Override public CompletableFuture updateApnsSandboxChannel( UpdateApnsSandboxChannelRequest updateApnsSandboxChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateApnsSandboxChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateApnsSandboxChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateApnsSandboxChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateApnsSandboxChannel") .withMarshaller(new UpdateApnsSandboxChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateApnsSandboxChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateApnsSandboxChannelRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Enables the APNs VoIP channel for an application or updates the status and settings of the APNs VoIP channel for * an application. *

* * @param updateApnsVoipChannelRequest * @return A Java Future containing the result of the UpdateApnsVoipChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateApnsVoipChannel * @see AWS API Documentation */ @Override public CompletableFuture updateApnsVoipChannel( UpdateApnsVoipChannelRequest updateApnsVoipChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateApnsVoipChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateApnsVoipChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateApnsVoipChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateApnsVoipChannel") .withMarshaller(new UpdateApnsVoipChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateApnsVoipChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateApnsVoipChannelRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Enables the APNs VoIP sandbox channel for an application or updates the status and settings of the APNs VoIP * sandbox channel for an application. *

* * @param updateApnsVoipSandboxChannelRequest * @return A Java Future containing the result of the UpdateApnsVoipSandboxChannel operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateApnsVoipSandboxChannel * @see AWS API Documentation */ @Override public CompletableFuture updateApnsVoipSandboxChannel( UpdateApnsVoipSandboxChannelRequest updateApnsVoipSandboxChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateApnsVoipSandboxChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateApnsVoipSandboxChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateApnsVoipSandboxChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateApnsVoipSandboxChannel") .withMarshaller(new UpdateApnsVoipSandboxChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateApnsVoipSandboxChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateApnsVoipSandboxChannelRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the settings for an application. *

* * @param updateApplicationSettingsRequest * @return A Java Future containing the result of the UpdateApplicationSettings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateApplicationSettings * @see AWS API Documentation */ @Override public CompletableFuture updateApplicationSettings( UpdateApplicationSettingsRequest updateApplicationSettingsRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateApplicationSettingsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateApplicationSettings"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateApplicationSettingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateApplicationSettings") .withMarshaller(new UpdateApplicationSettingsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateApplicationSettingsRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateApplicationSettingsRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Enables the Baidu channel for an application or updates the status and settings of the Baidu channel for an * application. *

* * @param updateBaiduChannelRequest * @return A Java Future containing the result of the UpdateBaiduChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateBaiduChannel * @see AWS * API Documentation */ @Override public CompletableFuture updateBaiduChannel(UpdateBaiduChannelRequest updateBaiduChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateBaiduChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateBaiduChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateBaiduChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateBaiduChannel") .withMarshaller(new UpdateBaiduChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateBaiduChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateBaiduChannelRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the configuration and other settings for a campaign. *

* * @param updateCampaignRequest * @return A Java Future containing the result of the UpdateCampaign operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateCampaign * @see AWS API * Documentation */ @Override public CompletableFuture updateCampaign(UpdateCampaignRequest updateCampaignRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCampaign"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCampaign") .withMarshaller(new UpdateCampaignRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateCampaignRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateCampaignRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Enables the email channel for an application or updates the status and settings of the email channel for an * application. *

* * @param updateEmailChannelRequest * @return A Java Future containing the result of the UpdateEmailChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateEmailChannel * @see AWS * API Documentation */ @Override public CompletableFuture updateEmailChannel(UpdateEmailChannelRequest updateEmailChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateEmailChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateEmailChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateEmailChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateEmailChannel") .withMarshaller(new UpdateEmailChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateEmailChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateEmailChannelRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates an existing message template for messages that are sent through the email channel. *

* * @param updateEmailTemplateRequest * @return A Java Future containing the result of the UpdateEmailTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateEmailTemplate * @see AWS * API Documentation */ @Override public CompletableFuture updateEmailTemplate( UpdateEmailTemplateRequest updateEmailTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateEmailTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateEmailTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateEmailTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateEmailTemplate") .withMarshaller(new UpdateEmailTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateEmailTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateEmailTemplateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new endpoint for an application or updates the settings and attributes of an existing endpoint for an * application. You can also use this operation to define custom attributes for an endpoint. If an update includes * one or more values for a custom attribute, Amazon Pinpoint replaces (overwrites) any existing values with the new * values. *

* * @param updateEndpointRequest * @return A Java Future containing the result of the UpdateEndpoint operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateEndpoint * @see AWS API * Documentation */ @Override public CompletableFuture updateEndpoint(UpdateEndpointRequest updateEndpointRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateEndpointRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateEndpoint"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateEndpointResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateEndpoint") .withMarshaller(new UpdateEndpointRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateEndpointRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateEndpointRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new batch of endpoints for an application or updates the settings and attributes of a batch of existing * endpoints for an application. You can also use this operation to define custom attributes for a batch of * endpoints. If an update includes one or more values for a custom attribute, Amazon Pinpoint replaces (overwrites) * any existing values with the new values. *

* * @param updateEndpointsBatchRequest * @return A Java Future containing the result of the UpdateEndpointsBatch operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateEndpointsBatch * @see AWS * API Documentation */ @Override public CompletableFuture updateEndpointsBatch( UpdateEndpointsBatchRequest updateEndpointsBatchRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateEndpointsBatchRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateEndpointsBatch"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateEndpointsBatchResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateEndpointsBatch") .withMarshaller(new UpdateEndpointsBatchRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateEndpointsBatchRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateEndpointsBatchRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Enables the GCM channel for an application or updates the status and settings of the GCM channel for an * application. *

* * @param updateGcmChannelRequest * @return A Java Future containing the result of the UpdateGcmChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateGcmChannel * @see AWS API * Documentation */ @Override public CompletableFuture updateGcmChannel(UpdateGcmChannelRequest updateGcmChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateGcmChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateGcmChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateGcmChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateGcmChannel") .withMarshaller(new UpdateGcmChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateGcmChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateGcmChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates an existing message template for messages sent through the in-app message channel. *

* * @param updateInAppTemplateRequest * @return A Java Future containing the result of the UpdateInAppTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateInAppTemplate * @see AWS * API Documentation */ @Override public CompletableFuture updateInAppTemplate( UpdateInAppTemplateRequest updateInAppTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateInAppTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateInAppTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateInAppTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateInAppTemplate") .withMarshaller(new UpdateInAppTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateInAppTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateInAppTemplateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the configuration and other settings for a journey. *

* * @param updateJourneyRequest * @return A Java Future containing the result of the UpdateJourney operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • ConflictException The request failed due to a conflict with the current state of the specified * resource (ConflictException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateJourney * @see AWS API * Documentation */ @Override public CompletableFuture updateJourney(UpdateJourneyRequest updateJourneyRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateJourneyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateJourney"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateJourneyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateJourney") .withMarshaller(new UpdateJourneyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateJourneyRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateJourneyRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Cancels (stops) an active journey. *

* * @param updateJourneyStateRequest * @return A Java Future containing the result of the UpdateJourneyState operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateJourneyState * @see AWS * API Documentation */ @Override public CompletableFuture updateJourneyState(UpdateJourneyStateRequest updateJourneyStateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateJourneyStateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateJourneyState"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateJourneyStateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateJourneyState") .withMarshaller(new UpdateJourneyStateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateJourneyStateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateJourneyStateRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates an existing message template for messages that are sent through a push notification channel. *

* * @param updatePushTemplateRequest * @return A Java Future containing the result of the UpdatePushTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdatePushTemplate * @see AWS * API Documentation */ @Override public CompletableFuture updatePushTemplate(UpdatePushTemplateRequest updatePushTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updatePushTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdatePushTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdatePushTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdatePushTemplate") .withMarshaller(new UpdatePushTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updatePushTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updatePushTemplateRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates an Amazon Pinpoint configuration for a recommender model. *

* * @param updateRecommenderConfigurationRequest * @return A Java Future containing the result of the UpdateRecommenderConfiguration operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateRecommenderConfiguration * @see AWS API Documentation */ @Override public CompletableFuture updateRecommenderConfiguration( UpdateRecommenderConfigurationRequest updateRecommenderConfigurationRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateRecommenderConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateRecommenderConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateRecommenderConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateRecommenderConfiguration") .withMarshaller(new UpdateRecommenderConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateRecommenderConfigurationRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateRecommenderConfigurationRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new segment for an application or updates the configuration, dimension, and other settings for an * existing segment that's associated with an application. *

* * @param updateSegmentRequest * @return A Java Future containing the result of the UpdateSegment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateSegment * @see AWS API * Documentation */ @Override public CompletableFuture updateSegment(UpdateSegmentRequest updateSegmentRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSegmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSegment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateSegmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateSegment") .withMarshaller(new UpdateSegmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateSegmentRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateSegmentRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Enables the SMS channel for an application or updates the status and settings of the SMS channel for an * application. *

* * @param updateSmsChannelRequest * @return A Java Future containing the result of the UpdateSmsChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateSmsChannel * @see AWS API * Documentation */ @Override public CompletableFuture updateSmsChannel(UpdateSmsChannelRequest updateSmsChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSmsChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSmsChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateSmsChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateSmsChannel") .withMarshaller(new UpdateSmsChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateSmsChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateSmsChannelRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates an existing message template for messages that are sent through the SMS channel. *

* * @param updateSmsTemplateRequest * @return A Java Future containing the result of the UpdateSmsTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateSmsTemplate * @see AWS * API Documentation */ @Override public CompletableFuture updateSmsTemplate(UpdateSmsTemplateRequest updateSmsTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSmsTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSmsTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateSmsTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateSmsTemplate") .withMarshaller(new UpdateSmsTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateSmsTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateSmsTemplateRequest.overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Changes the status of a specific version of a message template to active. *

* * @param updateTemplateActiveVersionRequest * @return A Java Future containing the result of the UpdateTemplateActiveVersion operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateTemplateActiveVersion * @see AWS API Documentation */ @Override public CompletableFuture updateTemplateActiveVersion( UpdateTemplateActiveVersionRequest updateTemplateActiveVersionRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateTemplateActiveVersionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateTemplateActiveVersion"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateTemplateActiveVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateTemplateActiveVersion") .withMarshaller(new UpdateTemplateActiveVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateTemplateActiveVersionRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateTemplateActiveVersionRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Enables the voice channel for an application or updates the status and settings of the voice channel for an * application. *

* * @param updateVoiceChannelRequest * @return A Java Future containing the result of the UpdateVoiceChannel operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateVoiceChannel * @see AWS * API Documentation */ @Override public CompletableFuture updateVoiceChannel(UpdateVoiceChannelRequest updateVoiceChannelRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateVoiceChannelRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateVoiceChannel"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateVoiceChannelResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateVoiceChannel") .withMarshaller(new UpdateVoiceChannelRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateVoiceChannelRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateVoiceChannelRequest.overrideConfiguration() .orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates an existing message template for messages that are sent through the voice channel. *

* * @param updateVoiceTemplateRequest * @return A Java Future containing the result of the UpdateVoiceTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • BadRequestException The request contains a syntax error (BadRequestException).
  • *
  • InternalServerErrorException The request failed due to an unknown internal server error, exception, * or failure (InternalServerErrorException).
  • *
  • PayloadTooLargeException The request failed because the payload for the body of the request is too * large (RequestEntityTooLargeException).
  • *
  • ForbiddenException The request was denied because access to the specified resource is forbidden * (ForbiddenException).
  • *
  • NotFoundException The request failed because the specified resource was not found * (NotFoundException).
  • *
  • MethodNotAllowedException The request failed because the method is not allowed for the specified * resource (MethodNotAllowedException).
  • *
  • TooManyRequestsException The request failed because too many requests were sent during a certain * amount of time (TooManyRequestsException).
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • PinpointException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample PinpointAsyncClient.UpdateVoiceTemplate * @see AWS * API Documentation */ @Override public CompletableFuture updateVoiceTemplate( UpdateVoiceTemplateRequest updateVoiceTemplateRequest) { List metricPublishers = resolveMetricPublishers(clientConfiguration, updateVoiceTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Pinpoint"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateVoiceTemplate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateVoiceTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateVoiceTemplate") .withMarshaller(new UpdateVoiceTemplateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withMetricCollector(apiCallMetricCollector).withInput(updateVoiceTemplateRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = updateVoiceTemplateRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } @Override public void close() { clientHandler.close(); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(PinpointException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("ForbiddenException") .exceptionBuilderSupplier(ForbiddenException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("NotFoundException") .exceptionBuilderSupplier(NotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("MethodNotAllowedException") .exceptionBuilderSupplier(MethodNotAllowedException::builder).httpStatusCode(405).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictException") .exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("PayloadTooLargeException") .exceptionBuilderSupplier(PayloadTooLargeException::builder).httpStatusCode(413).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TooManyRequestsException") .exceptionBuilderSupplier(TooManyRequestsException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("BadRequestException") .exceptionBuilderSupplier(BadRequestException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServerErrorException") .exceptionBuilderSupplier(InternalServerErrorException::builder).httpStatusCode(500).build()); } 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); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy