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

software.amazon.awssdk.services.cognitoidentityprovider.DefaultCognitoIdentityProviderAsyncClient Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.cognitoidentityprovider;

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.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
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.interceptor.SdkInternalExecutionAttribute;
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.cognitoidentityprovider.internal.CognitoIdentityProviderServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AddCustomAttributesRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AddCustomAttributesResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminAddUserToGroupRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminAddUserToGroupResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminConfirmSignUpRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminConfirmSignUpResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminCreateUserRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminCreateUserResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminDeleteUserAttributesRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminDeleteUserAttributesResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminDeleteUserRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminDeleteUserResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminDisableProviderForUserRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminDisableProviderForUserResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminDisableUserRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminDisableUserResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminEnableUserRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminEnableUserResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminForgetDeviceRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminForgetDeviceResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminGetDeviceRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminGetDeviceResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminGetUserRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminGetUserResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminInitiateAuthRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminInitiateAuthResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminLinkProviderForUserRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminLinkProviderForUserResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminListDevicesRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminListDevicesResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminListGroupsForUserRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminListGroupsForUserResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminListUserAuthEventsRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminListUserAuthEventsResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminRemoveUserFromGroupRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminRemoveUserFromGroupResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminResetUserPasswordRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminResetUserPasswordResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminRespondToAuthChallengeRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminRespondToAuthChallengeResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminSetUserMfaPreferenceRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminSetUserMfaPreferenceResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminSetUserPasswordRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminSetUserPasswordResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminSetUserSettingsRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminSetUserSettingsResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminUpdateAuthEventFeedbackRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminUpdateAuthEventFeedbackResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminUpdateDeviceStatusRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminUpdateDeviceStatusResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminUpdateUserAttributesRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminUpdateUserAttributesResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminUserGlobalSignOutRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AdminUserGlobalSignOutResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AliasExistsException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AssociateSoftwareTokenRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.AssociateSoftwareTokenResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ChangePasswordRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ChangePasswordResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CodeDeliveryFailureException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CodeMismatchException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CognitoIdentityProviderException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ConcurrentModificationException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ConfirmDeviceRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ConfirmDeviceResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ConfirmForgotPasswordRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ConfirmForgotPasswordResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ConfirmSignUpRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ConfirmSignUpResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CreateGroupRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CreateGroupResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CreateIdentityProviderRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CreateIdentityProviderResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CreateResourceServerRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CreateResourceServerResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CreateUserImportJobRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CreateUserImportJobResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CreateUserPoolClientRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CreateUserPoolClientResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CreateUserPoolDomainRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CreateUserPoolDomainResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CreateUserPoolRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.CreateUserPoolResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteGroupRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteGroupResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteIdentityProviderRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteIdentityProviderResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteResourceServerRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteResourceServerResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteUserAttributesRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteUserAttributesResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteUserPoolClientRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteUserPoolClientResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteUserPoolDomainRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteUserPoolDomainResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteUserPoolRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteUserPoolResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteUserRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DeleteUserResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DescribeIdentityProviderRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DescribeIdentityProviderResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DescribeResourceServerRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DescribeResourceServerResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DescribeRiskConfigurationRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DescribeRiskConfigurationResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DescribeUserImportJobRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DescribeUserImportJobResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DescribeUserPoolClientRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DescribeUserPoolClientResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DescribeUserPoolDomainRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DescribeUserPoolDomainResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DescribeUserPoolRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DescribeUserPoolResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.DuplicateProviderException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.EnableSoftwareTokenMfaException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ExpiredCodeException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ForbiddenException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ForgetDeviceRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ForgetDeviceResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ForgotPasswordRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ForgotPasswordResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetCsvHeaderRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetCsvHeaderResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetDeviceRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetDeviceResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetGroupRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetGroupResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetIdentityProviderByIdentifierRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetIdentityProviderByIdentifierResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetLogDeliveryConfigurationRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetLogDeliveryConfigurationResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetSigningCertificateRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetSigningCertificateResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetUiCustomizationRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetUiCustomizationResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetUserAttributeVerificationCodeRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetUserAttributeVerificationCodeResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetUserPoolMfaConfigRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetUserPoolMfaConfigResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetUserRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GetUserResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GlobalSignOutRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GlobalSignOutResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.GroupExistsException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.InitiateAuthRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.InitiateAuthResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.InternalErrorException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.InvalidEmailRoleAccessPolicyException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.InvalidLambdaResponseException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.InvalidOAuthFlowException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.InvalidParameterException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.InvalidPasswordException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.InvalidSmsRoleAccessPolicyException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.InvalidSmsRoleTrustRelationshipException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.InvalidUserPoolConfigurationException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.LimitExceededException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListDevicesRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListDevicesResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListGroupsRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListGroupsResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListIdentityProvidersRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListIdentityProvidersResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListResourceServersRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListResourceServersResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListUserImportJobsRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListUserImportJobsResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListUserPoolClientsRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListUserPoolClientsResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListUserPoolsRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListUserPoolsResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListUsersInGroupRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListUsersInGroupResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListUsersRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ListUsersResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.MfaMethodNotFoundException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.NotAuthorizedException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.PasswordResetRequiredException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.PreconditionNotMetException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ResendConfirmationCodeRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ResendConfirmationCodeResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ResourceNotFoundException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.RespondToAuthChallengeRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.RespondToAuthChallengeResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.RevokeTokenRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.RevokeTokenResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.ScopeDoesNotExistException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SetLogDeliveryConfigurationRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SetLogDeliveryConfigurationResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SetRiskConfigurationRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SetRiskConfigurationResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SetUiCustomizationRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SetUiCustomizationResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SetUserMfaPreferenceRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SetUserMfaPreferenceResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SetUserPoolMfaConfigRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SetUserPoolMfaConfigResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SetUserSettingsRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SetUserSettingsResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SignUpRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SignUpResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.SoftwareTokenMfaNotFoundException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.StartUserImportJobRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.StartUserImportJobResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.StopUserImportJobRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.StopUserImportJobResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.TagResourceRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.TagResourceResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.TooManyFailedAttemptsException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.TooManyRequestsException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UnauthorizedException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UnexpectedLambdaException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UnsupportedIdentityProviderException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UnsupportedOperationException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UnsupportedTokenTypeException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UnsupportedUserStateException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UntagResourceRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UntagResourceResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateAuthEventFeedbackRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateAuthEventFeedbackResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateDeviceStatusRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateDeviceStatusResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateGroupRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateGroupResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateIdentityProviderRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateIdentityProviderResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateResourceServerRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateResourceServerResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateUserAttributesRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateUserAttributesResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateUserPoolClientRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateUserPoolClientResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateUserPoolDomainRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateUserPoolDomainResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateUserPoolRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UpdateUserPoolResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UserImportInProgressException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UserLambdaValidationException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UserNotConfirmedException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UserNotFoundException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UserPoolAddOnNotEnabledException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UserPoolTaggingException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.UsernameExistsException;
import software.amazon.awssdk.services.cognitoidentityprovider.model.VerifySoftwareTokenRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.VerifySoftwareTokenResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.model.VerifyUserAttributeRequest;
import software.amazon.awssdk.services.cognitoidentityprovider.model.VerifyUserAttributeResponse;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AddCustomAttributesRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminAddUserToGroupRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminConfirmSignUpRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminCreateUserRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminDeleteUserAttributesRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminDeleteUserRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminDisableProviderForUserRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminDisableUserRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminEnableUserRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminForgetDeviceRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminGetDeviceRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminGetUserRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminInitiateAuthRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminLinkProviderForUserRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminListDevicesRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminListGroupsForUserRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminListUserAuthEventsRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminRemoveUserFromGroupRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminResetUserPasswordRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminRespondToAuthChallengeRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminSetUserMfaPreferenceRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminSetUserPasswordRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminSetUserSettingsRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminUpdateAuthEventFeedbackRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminUpdateDeviceStatusRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminUpdateUserAttributesRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AdminUserGlobalSignOutRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.AssociateSoftwareTokenRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ChangePasswordRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ConfirmDeviceRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ConfirmForgotPasswordRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ConfirmSignUpRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.CreateGroupRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.CreateIdentityProviderRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.CreateResourceServerRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.CreateUserImportJobRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.CreateUserPoolClientRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.CreateUserPoolDomainRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.CreateUserPoolRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DeleteGroupRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DeleteIdentityProviderRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DeleteResourceServerRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DeleteUserAttributesRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DeleteUserPoolClientRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DeleteUserPoolDomainRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DeleteUserPoolRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DeleteUserRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DescribeIdentityProviderRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DescribeResourceServerRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DescribeRiskConfigurationRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DescribeUserImportJobRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DescribeUserPoolClientRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DescribeUserPoolDomainRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.DescribeUserPoolRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ForgetDeviceRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ForgotPasswordRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.GetCsvHeaderRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.GetDeviceRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.GetGroupRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.GetIdentityProviderByIdentifierRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.GetLogDeliveryConfigurationRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.GetSigningCertificateRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.GetUiCustomizationRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.GetUserAttributeVerificationCodeRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.GetUserPoolMfaConfigRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.GetUserRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.GlobalSignOutRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.InitiateAuthRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ListDevicesRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ListGroupsRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ListIdentityProvidersRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ListResourceServersRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ListUserImportJobsRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ListUserPoolClientsRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ListUserPoolsRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ListUsersInGroupRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ListUsersRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.ResendConfirmationCodeRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.RespondToAuthChallengeRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.RevokeTokenRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.SetLogDeliveryConfigurationRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.SetRiskConfigurationRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.SetUiCustomizationRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.SetUserMfaPreferenceRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.SetUserPoolMfaConfigRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.SetUserSettingsRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.SignUpRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.StartUserImportJobRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.StopUserImportJobRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.UpdateAuthEventFeedbackRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.UpdateDeviceStatusRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.UpdateGroupRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.UpdateIdentityProviderRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.UpdateResourceServerRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.UpdateUserAttributesRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.UpdateUserPoolClientRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.UpdateUserPoolDomainRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.UpdateUserPoolRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.VerifySoftwareTokenRequestMarshaller;
import software.amazon.awssdk.services.cognitoidentityprovider.transform.VerifyUserAttributeRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;

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

    private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
            .serviceProtocol(AwsServiceProtocol.AWS_JSON).build();

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

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

    /**
     * 

* Adds additional user attributes to the user pool schema. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param addCustomAttributesRequest * Represents the request to add custom attributes. * @return A Java Future containing the result of the AddCustomAttributes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserImportInProgressException This exception is thrown when you're trying to modify a user pool while * a user import job is in progress for that pool.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AddCustomAttributes * @see AWS API Documentation */ @Override public CompletableFuture addCustomAttributes( AddCustomAttributesRequest addCustomAttributesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(addCustomAttributesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, addCustomAttributesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AddCustomAttributes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AddCustomAttributesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AddCustomAttributes").withProtocolMetadata(protocolMetadata) .withMarshaller(new AddCustomAttributesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(addCustomAttributesRequest)); 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 the specified user to the specified group. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminAddUserToGroupRequest * @return A Java Future containing the result of the AdminAddUserToGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminAddUserToGroup * @see AWS API Documentation */ @Override public CompletableFuture adminAddUserToGroup( AdminAddUserToGroupRequest adminAddUserToGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminAddUserToGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminAddUserToGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminAddUserToGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminAddUserToGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminAddUserToGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminAddUserToGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminAddUserToGroupRequest)); 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); } } /** *

* Confirms user registration as an admin without using a confirmation code. Works on any user. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminConfirmSignUpRequest * Confirm a user's registration as a user pool administrator. * @return A Java Future containing the result of the AdminConfirmSignUp operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyFailedAttemptsException This exception is thrown when the user has made too many failed * attempts for a given action, such as sign-in.
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminConfirmSignUp * @see AWS API Documentation */ @Override public CompletableFuture adminConfirmSignUp(AdminConfirmSignUpRequest adminConfirmSignUpRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminConfirmSignUpRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminConfirmSignUpRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminConfirmSignUp"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminConfirmSignUpResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminConfirmSignUp").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminConfirmSignUpRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminConfirmSignUpRequest)); 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 user in the specified user pool. *

*

* If MessageAction isn't set, the default is to send a welcome message via email or phone (SMS). *

* *

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
*

* This message is based on a template that you configured in your call to create or update a user pool. This * template includes your custom sign-up instructions and placeholders for user name and temporary password. *

*

* Alternatively, you can call AdminCreateUser with SUPPRESS for the * MessageAction parameter, and Amazon Cognito won't send any email. *

*

* In either case, the user will be in the FORCE_CHANGE_PASSWORD state until they sign in and change * their password. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminCreateUserRequest * Represents the request to create a user in the specified user pool. * @return A Java Future containing the result of the AdminCreateUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UsernameExistsException This exception is thrown when Amazon Cognito encounters a user name that * already exists in the user pool.
  • *
  • InvalidPasswordException This exception is thrown when Amazon Cognito encounters an invalid password. *
  • *
  • CodeDeliveryFailureException This exception is thrown when a verification code fails to deliver * successfully.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • PreconditionNotMetException This exception is thrown when a precondition is not met.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UnsupportedUserStateException The request failed because the user is in an unsupported state.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminCreateUser * @see AWS * API Documentation */ @Override public CompletableFuture adminCreateUser(AdminCreateUserRequest adminCreateUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminCreateUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminCreateUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminCreateUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminCreateUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminCreateUser").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminCreateUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminCreateUserRequest)); 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 user as an administrator. Works on any user. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminDeleteUserRequest * Represents the request to delete a user as an administrator. * @return A Java Future containing the result of the AdminDeleteUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminDeleteUser * @see AWS * API Documentation */ @Override public CompletableFuture adminDeleteUser(AdminDeleteUserRequest adminDeleteUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminDeleteUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminDeleteUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminDeleteUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminDeleteUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminDeleteUser").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminDeleteUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminDeleteUserRequest)); 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 user attributes in a user pool as an administrator. Works on any user. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminDeleteUserAttributesRequest * Represents the request to delete user attributes as an administrator. * @return A Java Future containing the result of the AdminDeleteUserAttributes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminDeleteUserAttributes * @see AWS API Documentation */ @Override public CompletableFuture adminDeleteUserAttributes( AdminDeleteUserAttributesRequest adminDeleteUserAttributesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminDeleteUserAttributesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminDeleteUserAttributesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminDeleteUserAttributes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminDeleteUserAttributesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminDeleteUserAttributes").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminDeleteUserAttributesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminDeleteUserAttributesRequest)); 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); } } /** *

* Prevents the user from signing in with the specified external (SAML or social) identity provider (IdP). If the * user that you want to deactivate is a Amazon Cognito user pools native username + password user, they can't use * their password to sign in. If the user to deactivate is a linked external IdP user, any link between that user * and an existing user is removed. When the external user signs in again, and the user is no longer attached to the * previously linked DestinationUser, the user must create a new user account. See AdminLinkProviderForUser. *

*

* The ProviderName must match the value specified when creating an IdP for the pool. *

*

* To deactivate a native username + password user, the ProviderName value must be Cognito * and the ProviderAttributeName must be Cognito_Subject. The * ProviderAttributeValue must be the name that is used in the user pool for the user. *

*

* The ProviderAttributeName must always be Cognito_Subject for social IdPs. The * ProviderAttributeValue must always be the exact subject that was used when the user was originally * linked as a source user. *

*

* For de-linking a SAML identity, there are two scenarios. If the linked identity has not yet been used to sign in, * the ProviderAttributeName and ProviderAttributeValue must be the same values that were * used for the SourceUser when the identities were originally linked using * AdminLinkProviderForUser call. (If the linking was done with ProviderAttributeName set * to Cognito_Subject, the same applies here). However, if the user has already signed in, the * ProviderAttributeName must be Cognito_Subject and ProviderAttributeValue * must be the subject of the SAML assertion. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminDisableProviderForUserRequest * @return A Java Future containing the result of the AdminDisableProviderForUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • AliasExistsException This exception is thrown when a user tries to confirm the account with an email * address or phone number that has already been supplied as an alias for a different user profile. This * exception indicates that an account with this email address or phone already exists in a user pool that * you've configured to use email address or phone number as a sign-in alias.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminDisableProviderForUser * @see AWS API Documentation */ @Override public CompletableFuture adminDisableProviderForUser( AdminDisableProviderForUserRequest adminDisableProviderForUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminDisableProviderForUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminDisableProviderForUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminDisableProviderForUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminDisableProviderForUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminDisableProviderForUser").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminDisableProviderForUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminDisableProviderForUserRequest)); 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); } } /** *

* Deactivates a user and revokes all access tokens for the user. A deactivated user can't sign in, but still * appears in the responses to GetUser and ListUsers API requests. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminDisableUserRequest * Represents the request to disable the user as an administrator. * @return A Java Future containing the result of the AdminDisableUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminDisableUser * @see AWS * API Documentation */ @Override public CompletableFuture adminDisableUser(AdminDisableUserRequest adminDisableUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminDisableUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminDisableUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminDisableUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminDisableUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminDisableUser").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminDisableUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminDisableUserRequest)); 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 specified user as an administrator. Works on any user. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminEnableUserRequest * Represents the request that enables the user as an administrator. * @return A Java Future containing the result of the AdminEnableUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminEnableUser * @see AWS * API Documentation */ @Override public CompletableFuture adminEnableUser(AdminEnableUserRequest adminEnableUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminEnableUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminEnableUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminEnableUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminEnableUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminEnableUser").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminEnableUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminEnableUserRequest)); 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); } } /** *

* Forgets the device, as an administrator. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminForgetDeviceRequest * Sends the forgot device request, as an administrator. * @return A Java Future containing the result of the AdminForgetDevice operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • InvalidUserPoolConfigurationException This exception is thrown when the user pool configuration is * not valid.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminForgetDevice * @see AWS * API Documentation */ @Override public CompletableFuture adminForgetDevice(AdminForgetDeviceRequest adminForgetDeviceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminForgetDeviceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminForgetDeviceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminForgetDevice"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminForgetDeviceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminForgetDevice").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminForgetDeviceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminForgetDeviceRequest)); 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); } } /** *

* Gets the device, as an administrator. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminGetDeviceRequest * Represents the request to get the device, as an administrator. * @return A Java Future containing the result of the AdminGetDevice operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • InvalidUserPoolConfigurationException This exception is thrown when the user pool configuration is * not valid.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminGetDevice * @see AWS * API Documentation */ @Override public CompletableFuture adminGetDevice(AdminGetDeviceRequest adminGetDeviceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminGetDeviceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminGetDeviceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminGetDevice"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminGetDeviceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminGetDevice").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminGetDeviceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminGetDeviceRequest)); 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); } } /** *

* Gets the specified user by user name in a user pool as an administrator. Works on any user. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminGetUserRequest * Represents the request to get the specified user as an administrator. * @return A Java Future containing the result of the AdminGetUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminGetUser * @see AWS API * Documentation */ @Override public CompletableFuture adminGetUser(AdminGetUserRequest adminGetUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminGetUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminGetUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminGetUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, AdminGetUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminGetUser").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminGetUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminGetUserRequest)); 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); } } /** *

* Initiates the authentication flow, as an administrator. *

* *

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
*

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminInitiateAuthRequest * Initiates the authorization request, as an administrator. * @return A Java Future containing the result of the AdminInitiateAuth operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • InvalidUserPoolConfigurationException This exception is thrown when the user pool configuration is * not valid.
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • MfaMethodNotFoundException This exception is thrown when Amazon Cognito can't find a multi-factor * authentication (MFA) method.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminInitiateAuth * @see AWS * API Documentation */ @Override public CompletableFuture adminInitiateAuth(AdminInitiateAuthRequest adminInitiateAuthRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminInitiateAuthRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminInitiateAuthRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminInitiateAuth"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminInitiateAuthResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminInitiateAuth").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminInitiateAuthRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminInitiateAuthRequest)); 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); } } /** *

* Links an existing user account in a user pool (DestinationUser) to an identity from an external IdP * (SourceUser) based on a specified attribute name and value from the external IdP. This allows you to * create a link from the existing user account to an external federated user identity that has not yet been used to * sign in. You can then use the federated user identity to sign in as the existing user account. *

*

* For example, if there is an existing user with a username and password, this API links that user to a federated * user identity. When the user signs in with a federated user identity, they sign in as the existing user account. *

* *

* The maximum number of federated identities linked to a user is five. *

*
*

* Because this API allows a user with an external federated identity to sign in as an existing user in the user * pool, it is critical that it only be used with external IdPs and provider attributes that have been trusted by * the application owner. *

*
*

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminLinkProviderForUserRequest * @return A Java Future containing the result of the AdminLinkProviderForUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • AliasExistsException This exception is thrown when a user tries to confirm the account with an email * address or phone number that has already been supplied as an alias for a different user profile. This * exception indicates that an account with this email address or phone already exists in a user pool that * you've configured to use email address or phone number as a sign-in alias.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminLinkProviderForUser * @see AWS API Documentation */ @Override public CompletableFuture adminLinkProviderForUser( AdminLinkProviderForUserRequest adminLinkProviderForUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminLinkProviderForUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminLinkProviderForUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminLinkProviderForUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminLinkProviderForUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminLinkProviderForUser").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminLinkProviderForUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminLinkProviderForUserRequest)); 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); } } /** *

* Lists devices, as an administrator. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminListDevicesRequest * Represents the request to list devices, as an administrator. * @return A Java Future containing the result of the AdminListDevices operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidUserPoolConfigurationException This exception is thrown when the user pool configuration is * not valid.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminListDevices * @see AWS * API Documentation */ @Override public CompletableFuture adminListDevices(AdminListDevicesRequest adminListDevicesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminListDevicesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminListDevicesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminListDevices"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminListDevicesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminListDevices").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminListDevicesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminListDevicesRequest)); 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); } } /** *

* Lists the groups that the user belongs to. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminListGroupsForUserRequest * @return A Java Future containing the result of the AdminListGroupsForUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminListGroupsForUser * @see AWS API Documentation */ @Override public CompletableFuture adminListGroupsForUser( AdminListGroupsForUserRequest adminListGroupsForUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminListGroupsForUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminListGroupsForUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminListGroupsForUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminListGroupsForUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminListGroupsForUser").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminListGroupsForUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminListGroupsForUserRequest)); 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); } } /** *

* A history of user activity and any risks detected as part of Amazon Cognito advanced security. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminListUserAuthEventsRequest * @return A Java Future containing the result of the AdminListUserAuthEvents operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserPoolAddOnNotEnabledException This exception is thrown when user pool add-ons aren't enabled.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminListUserAuthEvents * @see AWS API Documentation */ @Override public CompletableFuture adminListUserAuthEvents( AdminListUserAuthEventsRequest adminListUserAuthEventsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminListUserAuthEventsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminListUserAuthEventsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminListUserAuthEvents"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminListUserAuthEventsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminListUserAuthEvents").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminListUserAuthEventsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminListUserAuthEventsRequest)); 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 the specified user from the specified group. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminRemoveUserFromGroupRequest * @return A Java Future containing the result of the AdminRemoveUserFromGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminRemoveUserFromGroup * @see AWS API Documentation */ @Override public CompletableFuture adminRemoveUserFromGroup( AdminRemoveUserFromGroupRequest adminRemoveUserFromGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminRemoveUserFromGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminRemoveUserFromGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminRemoveUserFromGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminRemoveUserFromGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminRemoveUserFromGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminRemoveUserFromGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminRemoveUserFromGroupRequest)); 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); } } /** *

* Resets the specified user's password in a user pool as an administrator. Works on any user. *

* *

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
*

* Deactivates a user's password, requiring them to change it. If a user tries to sign in after the API is called, * Amazon Cognito responds with a PasswordResetRequiredException error. Your app must then perform the * actions that reset your user's password: the forgot-password flow. In addition, if the user pool has phone * verification selected and a verified phone number exists for the user, or if email verification is selected and a * verified email exists for the user, calling this API will also result in sending a message to the end user with * the code to change their password. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminResetUserPasswordRequest * Represents the request to reset a user's password as an administrator. * @return A Java Future containing the result of the AdminResetUserPassword operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidEmailRoleAccessPolicyException This exception is thrown when Amazon Cognito isn't allowed to * use your email identity. HTTP status code: 400.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminResetUserPassword * @see AWS API Documentation */ @Override public CompletableFuture adminResetUserPassword( AdminResetUserPasswordRequest adminResetUserPasswordRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminResetUserPasswordRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminResetUserPasswordRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminResetUserPassword"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminResetUserPasswordResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminResetUserPassword").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminResetUserPasswordRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminResetUserPasswordRequest)); 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); } } /** *

* Responds to an authentication challenge, as an administrator. *

* *

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
*

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminRespondToAuthChallengeRequest * The request to respond to the authentication challenge, as an administrator. * @return A Java Future containing the result of the AdminRespondToAuthChallenge operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • CodeMismatchException This exception is thrown if the provided code doesn't match what the server was * expecting.
  • *
  • ExpiredCodeException This exception is thrown if a code has expired.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • InvalidPasswordException This exception is thrown when Amazon Cognito encounters an invalid password. *
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InvalidUserPoolConfigurationException This exception is thrown when the user pool configuration is * not valid.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • MfaMethodNotFoundException This exception is thrown when Amazon Cognito can't find a multi-factor * authentication (MFA) method.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • AliasExistsException This exception is thrown when a user tries to confirm the account with an email * address or phone number that has already been supplied as an alias for a different user profile. This * exception indicates that an account with this email address or phone already exists in a user pool that * you've configured to use email address or phone number as a sign-in alias.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • SoftwareTokenMfaNotFoundException This exception is thrown when the software token time-based * one-time password (TOTP) multi-factor authentication (MFA) isn't activated for the user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminRespondToAuthChallenge * @see AWS API Documentation */ @Override public CompletableFuture adminRespondToAuthChallenge( AdminRespondToAuthChallengeRequest adminRespondToAuthChallengeRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminRespondToAuthChallengeRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminRespondToAuthChallengeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminRespondToAuthChallenge"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminRespondToAuthChallengeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminRespondToAuthChallenge").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminRespondToAuthChallengeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminRespondToAuthChallengeRequest)); 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); } } /** *

* The user's multi-factor authentication (MFA) preference, including which MFA options are activated, and if any * are preferred. Only one factor can be set as preferred. The preferred MFA factor will be used to authenticate a * user if multiple factors are activated. If multiple options are activated and no preference is set, a challenge * to choose an MFA option will be returned during sign-in. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminSetUserMfaPreferenceRequest * @return A Java Future containing the result of the AdminSetUserMFAPreference operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminSetUserMFAPreference * @see AWS API Documentation */ @Override public CompletableFuture adminSetUserMFAPreference( AdminSetUserMfaPreferenceRequest adminSetUserMfaPreferenceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminSetUserMfaPreferenceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminSetUserMfaPreferenceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminSetUserMFAPreference"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminSetUserMfaPreferenceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminSetUserMFAPreference").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminSetUserMfaPreferenceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminSetUserMfaPreferenceRequest)); 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); } } /** *

* Sets the specified user's password in a user pool as an administrator. Works on any user. *

*

* The password can be temporary or permanent. If it is temporary, the user status enters the * FORCE_CHANGE_PASSWORD state. When the user next tries to sign in, the InitiateAuth/AdminInitiateAuth * response will contain the NEW_PASSWORD_REQUIRED challenge. If the user doesn't sign in before it * expires, the user won't be able to sign in, and an administrator must reset their password. *

*

* Once the user has set a new password, or the password is permanent, the user status is set to * Confirmed. *

*

* AdminSetUserPassword can set a password for the user profile that Amazon Cognito creates for * third-party federated users. When you set a password, the federated user's status changes from * EXTERNAL_PROVIDER to CONFIRMED. A user in this state can sign in as a federated user, * and initiate authentication flows in the API like a linked native user. They can also modify their password and * attributes in token-authenticated API requests like ChangePassword and * UpdateUserAttributes. As a best security practice and to keep users in sync with your external IdP, * don't set passwords on federated user profiles. To set up a federated user for native sign-in with a linked * native user, refer to Linking federated users to an existing user profile. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminSetUserPasswordRequest * @return A Java Future containing the result of the AdminSetUserPassword operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • InvalidPasswordException This exception is thrown when Amazon Cognito encounters an invalid password. *
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminSetUserPassword * @see AWS API Documentation */ @Override public CompletableFuture adminSetUserPassword( AdminSetUserPasswordRequest adminSetUserPasswordRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminSetUserPasswordRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminSetUserPasswordRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminSetUserPassword"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminSetUserPasswordResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminSetUserPassword").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminSetUserPasswordRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminSetUserPasswordRequest)); 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); } } /** *

* This action is no longer supported. You can use it to configure only SMS MFA. You can't use it to * configure time-based one-time password (TOTP) software token MFA. To configure either type of MFA, use AdminSetUserMFAPreference instead. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminSetUserSettingsRequest * You can use this parameter to set an MFA configuration that uses the SMS delivery medium. * @return A Java Future containing the result of the AdminSetUserSettings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminSetUserSettings * @see AWS API Documentation */ @Override public CompletableFuture adminSetUserSettings( AdminSetUserSettingsRequest adminSetUserSettingsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminSetUserSettingsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminSetUserSettingsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminSetUserSettings"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminSetUserSettingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminSetUserSettings").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminSetUserSettingsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminSetUserSettingsRequest)); 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); } } /** *

* Provides feedback for an authentication event indicating if it was from a valid user. This feedback is used for * improving the risk evaluation decision for the user pool as part of Amazon Cognito advanced security. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminUpdateAuthEventFeedbackRequest * @return A Java Future containing the result of the AdminUpdateAuthEventFeedback operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserPoolAddOnNotEnabledException This exception is thrown when user pool add-ons aren't enabled.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminUpdateAuthEventFeedback * @see AWS API Documentation */ @Override public CompletableFuture adminUpdateAuthEventFeedback( AdminUpdateAuthEventFeedbackRequest adminUpdateAuthEventFeedbackRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminUpdateAuthEventFeedbackRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminUpdateAuthEventFeedbackRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminUpdateAuthEventFeedback"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminUpdateAuthEventFeedbackResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminUpdateAuthEventFeedback").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminUpdateAuthEventFeedbackRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminUpdateAuthEventFeedbackRequest)); 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 device status as an administrator. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminUpdateDeviceStatusRequest * The request to update the device status, as an administrator. * @return A Java Future containing the result of the AdminUpdateDeviceStatus operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidUserPoolConfigurationException This exception is thrown when the user pool configuration is * not valid.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminUpdateDeviceStatus * @see AWS API Documentation */ @Override public CompletableFuture adminUpdateDeviceStatus( AdminUpdateDeviceStatusRequest adminUpdateDeviceStatusRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminUpdateDeviceStatusRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminUpdateDeviceStatusRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminUpdateDeviceStatus"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminUpdateDeviceStatusResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminUpdateDeviceStatus").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminUpdateDeviceStatusRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminUpdateDeviceStatusRequest)); 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); } } /** * *

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
*

* Updates the specified user's attributes, including developer attributes, as an administrator. Works on any user. * To delete an attribute from your user, submit the attribute in your API request with a blank value. *

*

* For custom attributes, you must prepend the custom: prefix to the attribute name. *

*

* In addition to updating user attributes, this API can also be used to mark phone and email as verified. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminUpdateUserAttributesRequest * Represents the request to update the user's attributes as an administrator. * @return A Java Future containing the result of the AdminUpdateUserAttributes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • AliasExistsException This exception is thrown when a user tries to confirm the account with an email * address or phone number that has already been supplied as an alias for a different user profile. This * exception indicates that an account with this email address or phone already exists in a user pool that * you've configured to use email address or phone number as a sign-in alias.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidEmailRoleAccessPolicyException This exception is thrown when Amazon Cognito isn't allowed to * use your email identity. HTTP status code: 400.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminUpdateUserAttributes * @see AWS API Documentation */ @Override public CompletableFuture adminUpdateUserAttributes( AdminUpdateUserAttributesRequest adminUpdateUserAttributesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminUpdateUserAttributesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminUpdateUserAttributesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminUpdateUserAttributes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminUpdateUserAttributesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminUpdateUserAttributes").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminUpdateUserAttributesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminUpdateUserAttributesRequest)); 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); } } /** *

* Signs out a user from all devices. AdminUserGlobalSignOut invalidates all identity, access and * refresh tokens that Amazon Cognito has issued to a user. A user can still use a hosted UI cookie to retrieve new * tokens for the duration of the 1-hour cookie validity period. *

*

* Your app isn't aware that a user's access token is revoked unless it attempts to authorize a user pools API * request with an access token that contains the scope aws.cognito.signin.user.admin. Your app might * otherwise accept access tokens until they expire. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param adminUserGlobalSignOutRequest * The request to sign out of all devices, as an administrator. * @return A Java Future containing the result of the AdminUserGlobalSignOut operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AdminUserGlobalSignOut * @see AWS API Documentation */ @Override public CompletableFuture adminUserGlobalSignOut( AdminUserGlobalSignOutRequest adminUserGlobalSignOutRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(adminUserGlobalSignOutRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, adminUserGlobalSignOutRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AdminUserGlobalSignOut"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AdminUserGlobalSignOutResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AdminUserGlobalSignOut").withProtocolMetadata(protocolMetadata) .withMarshaller(new AdminUserGlobalSignOutRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(adminUserGlobalSignOutRequest)); 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); } } /** *

* Begins setup of time-based one-time password (TOTP) multi-factor authentication (MFA) for a user, with a unique * private key that Amazon Cognito generates and returns in the API response. You can authorize an * AssociateSoftwareToken request with either the user's access token, or a session string from a * challenge response that you received from Amazon Cognito. *

* *

* Amazon Cognito disassociates an existing software token when you verify the new token in a * VerifySoftwareToken API request. If you don't verify the software token and your user pool doesn't require * MFA, the user can then authenticate with user name and password credentials alone. If your user pool requires * TOTP MFA, Amazon Cognito generates an MFA_SETUP or SOFTWARE_TOKEN_SETUP challenge each * time your user signs. Complete setup with AssociateSoftwareToken and * VerifySoftwareToken. *

*

* After you set up software token MFA for your user, Amazon Cognito generates a SOFTWARE_TOKEN_MFA * challenge when they authenticate. Respond to this challenge with your user's TOTP. *

*
*

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param associateSoftwareTokenRequest * @return A Java Future containing the result of the AssociateSoftwareToken operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ConcurrentModificationException This exception is thrown if two or more modifications are happening * concurrently.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • SoftwareTokenMfaNotFoundException This exception is thrown when the software token time-based * one-time password (TOTP) multi-factor authentication (MFA) isn't activated for the user pool.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.AssociateSoftwareToken * @see AWS API Documentation */ @Override public CompletableFuture associateSoftwareToken( AssociateSoftwareTokenRequest associateSoftwareTokenRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateSoftwareTokenRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, associateSoftwareTokenRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateSoftwareToken"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AssociateSoftwareTokenResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateSoftwareToken").withProtocolMetadata(protocolMetadata) .withMarshaller(new AssociateSoftwareTokenRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(associateSoftwareTokenRequest)); 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 password for a specified user in a user pool. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param changePasswordRequest * Represents the request to change a user password. * @return A Java Future containing the result of the ChangePassword operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • InvalidPasswordException This exception is thrown when Amazon Cognito encounters an invalid password. *
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ChangePassword * @see AWS * API Documentation */ @Override public CompletableFuture changePassword(ChangePasswordRequest changePasswordRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(changePasswordRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, changePasswordRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ChangePassword"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ChangePasswordResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ChangePassword").withProtocolMetadata(protocolMetadata) .withMarshaller(new ChangePasswordRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(changePasswordRequest)); 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); } } /** *

* Confirms tracking of the device. This API call is the call that begins device tracking. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param confirmDeviceRequest * Confirms the device request. * @return A Java Future containing the result of the ConfirmDevice operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InvalidPasswordException This exception is thrown when Amazon Cognito encounters an invalid password. *
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • UsernameExistsException This exception is thrown when Amazon Cognito encounters a user name that * already exists in the user pool.
  • *
  • InvalidUserPoolConfigurationException This exception is thrown when the user pool configuration is * not valid.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ConfirmDevice * @see AWS API * Documentation */ @Override public CompletableFuture confirmDevice(ConfirmDeviceRequest confirmDeviceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(confirmDeviceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, confirmDeviceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ConfirmDevice"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ConfirmDeviceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ConfirmDevice").withProtocolMetadata(protocolMetadata) .withMarshaller(new ConfirmDeviceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(confirmDeviceRequest)); 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); } } /** *

* Allows a user to enter a confirmation code to reset a forgotten password. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param confirmForgotPasswordRequest * The request representing the confirmation for a password reset. * @return A Java Future containing the result of the ConfirmForgotPassword operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • InvalidPasswordException This exception is thrown when Amazon Cognito encounters an invalid password. *
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • CodeMismatchException This exception is thrown if the provided code doesn't match what the server was * expecting.
  • *
  • ExpiredCodeException This exception is thrown if a code has expired.
  • *
  • TooManyFailedAttemptsException This exception is thrown when the user has made too many failed * attempts for a given action, such as sign-in.
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ConfirmForgotPassword * @see AWS API Documentation */ @Override public CompletableFuture confirmForgotPassword( ConfirmForgotPasswordRequest confirmForgotPasswordRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(confirmForgotPasswordRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, confirmForgotPasswordRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ConfirmForgotPassword"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ConfirmForgotPasswordResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ConfirmForgotPassword").withProtocolMetadata(protocolMetadata) .withMarshaller(new ConfirmForgotPasswordRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(confirmForgotPasswordRequest)); 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); } } /** *

* Confirms registration of a new user. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param confirmSignUpRequest * Represents the request to confirm registration of a user. * @return A Java Future containing the result of the ConfirmSignUp operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyFailedAttemptsException This exception is thrown when the user has made too many failed * attempts for a given action, such as sign-in.
  • *
  • CodeMismatchException This exception is thrown if the provided code doesn't match what the server was * expecting.
  • *
  • ExpiredCodeException This exception is thrown if a code has expired.
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • AliasExistsException This exception is thrown when a user tries to confirm the account with an email * address or phone number that has already been supplied as an alias for a different user profile. This * exception indicates that an account with this email address or phone already exists in a user pool that * you've configured to use email address or phone number as a sign-in alias.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ConfirmSignUp * @see AWS API * Documentation */ @Override public CompletableFuture confirmSignUp(ConfirmSignUpRequest confirmSignUpRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(confirmSignUpRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, confirmSignUpRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ConfirmSignUp"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ConfirmSignUpResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ConfirmSignUp").withProtocolMetadata(protocolMetadata) .withMarshaller(new ConfirmSignUpRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(confirmSignUpRequest)); 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 group in the specified user pool. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param createGroupRequest * @return A Java Future containing the result of the CreateGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • GroupExistsException This exception is thrown when Amazon Cognito encounters a group that already * exists in the user pool.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.CreateGroup * @see AWS API * Documentation */ @Override public CompletableFuture createGroup(CreateGroupRequest createGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createGroupRequest)); 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 IdP for a user pool. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param createIdentityProviderRequest * @return A Java Future containing the result of the CreateIdentityProvider operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • DuplicateProviderException This exception is thrown when the provider is already supported by the * user pool.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.CreateIdentityProvider * @see AWS API Documentation */ @Override public CompletableFuture createIdentityProvider( CreateIdentityProviderRequest createIdentityProviderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createIdentityProviderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createIdentityProviderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateIdentityProvider"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateIdentityProviderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateIdentityProvider").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateIdentityProviderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createIdentityProviderRequest)); 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 OAuth2.0 resource server and defines custom scopes within it. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param createResourceServerRequest * @return A Java Future containing the result of the CreateResourceServer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.CreateResourceServer * @see AWS API Documentation */ @Override public CompletableFuture createResourceServer( CreateResourceServerRequest createResourceServerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createResourceServerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createResourceServerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateResourceServer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateResourceServerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateResourceServer").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateResourceServerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createResourceServerRequest)); 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 user import job. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param createUserImportJobRequest * Represents the request to create the user import job. * @return A Java Future containing the result of the CreateUserImportJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • PreconditionNotMetException This exception is thrown when a precondition is not met.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.CreateUserImportJob * @see AWS API Documentation */ @Override public CompletableFuture createUserImportJob( CreateUserImportJobRequest createUserImportJobRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createUserImportJobRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createUserImportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateUserImportJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateUserImportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateUserImportJob").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateUserImportJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createUserImportJobRequest)); 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); } } /** * *

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
*

* Creates a new Amazon Cognito user pool and sets the password policy for the pool. *

* *

* If you don't provide a value for an attribute, Amazon Cognito sets it to its default value. *

*
*

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param createUserPoolRequest * Represents the request to create a user pool. * @return A Java Future containing the result of the CreateUserPool operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • InvalidEmailRoleAccessPolicyException This exception is thrown when Amazon Cognito isn't allowed to * use your email identity. HTTP status code: 400.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserPoolTaggingException This exception is thrown when a user pool tag can't be set or updated.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.CreateUserPool * @see AWS * API Documentation */ @Override public CompletableFuture createUserPool(CreateUserPoolRequest createUserPoolRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createUserPoolRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createUserPoolRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateUserPool"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateUserPoolResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateUserPool").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateUserPoolRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createUserPoolRequest)); 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 the user pool client. *

*

* When you create a new user pool client, token revocation is automatically activated. For more information about * revoking tokens, see RevokeToken. *

* *

* If you don't provide a value for an attribute, Amazon Cognito sets it to its default value. *

*
*

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param createUserPoolClientRequest * Represents the request to create a user pool client. * @return A Java Future containing the result of the CreateUserPoolClient operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • ScopeDoesNotExistException This exception is thrown when the specified scope doesn't exist.
  • *
  • InvalidOAuthFlowException This exception is thrown when the specified OAuth flow is not valid.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.CreateUserPoolClient * @see AWS API Documentation */ @Override public CompletableFuture createUserPoolClient( CreateUserPoolClientRequest createUserPoolClientRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createUserPoolClientRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createUserPoolClientRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateUserPoolClient"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateUserPoolClientResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateUserPoolClient").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateUserPoolClientRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createUserPoolClientRequest)); 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 domain for a user pool. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param createUserPoolDomainRequest * @return A Java Future containing the result of the CreateUserPoolDomain operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.CreateUserPoolDomain * @see AWS API Documentation */ @Override public CompletableFuture createUserPoolDomain( CreateUserPoolDomainRequest createUserPoolDomainRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createUserPoolDomainRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createUserPoolDomainRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateUserPoolDomain"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateUserPoolDomainResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateUserPoolDomain").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateUserPoolDomainRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createUserPoolDomainRequest)); 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 group. *

*

* Calling this action requires developer credentials. *

* * @param deleteGroupRequest * @return A Java Future containing the result of the DeleteGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DeleteGroup * @see AWS API * Documentation */ @Override public CompletableFuture deleteGroup(DeleteGroupRequest deleteGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteGroupRequest)); 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 IdP for a user pool. *

* * @param deleteIdentityProviderRequest * @return A Java Future containing the result of the DeleteIdentityProvider operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • UnsupportedIdentityProviderException This exception is thrown when the specified identifier isn't * supported.
  • *
  • ConcurrentModificationException This exception is thrown if two or more modifications are happening * concurrently.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DeleteIdentityProvider * @see AWS API Documentation */ @Override public CompletableFuture deleteIdentityProvider( DeleteIdentityProviderRequest deleteIdentityProviderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteIdentityProviderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteIdentityProviderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteIdentityProvider"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteIdentityProviderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteIdentityProvider").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteIdentityProviderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteIdentityProviderRequest)); 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 resource server. *

* * @param deleteResourceServerRequest * @return A Java Future containing the result of the DeleteResourceServer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DeleteResourceServer * @see AWS API Documentation */ @Override public CompletableFuture deleteResourceServer( DeleteResourceServerRequest deleteResourceServerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteResourceServerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteResourceServerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteResourceServer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteResourceServerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteResourceServer").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteResourceServerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteResourceServerRequest)); 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); } } /** *

* Allows a user to delete their own user profile. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param deleteUserRequest * Represents the request to delete a user. * @return A Java Future containing the result of the DeleteUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DeleteUser * @see AWS API * Documentation */ @Override public CompletableFuture deleteUser(DeleteUserRequest deleteUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("DeleteUser") .withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(deleteUserRequest)); 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 attributes for a user. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param deleteUserAttributesRequest * Represents the request to delete user attributes. * @return A Java Future containing the result of the DeleteUserAttributes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DeleteUserAttributes * @see AWS API Documentation */ @Override public CompletableFuture deleteUserAttributes( DeleteUserAttributesRequest deleteUserAttributesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteUserAttributesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteUserAttributesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteUserAttributes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteUserAttributesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteUserAttributes").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteUserAttributesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(deleteUserAttributesRequest)); 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 specified Amazon Cognito user pool. *

* * @param deleteUserPoolRequest * Represents the request to delete a user pool. * @return A Java Future containing the result of the DeleteUserPool operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserImportInProgressException This exception is thrown when you're trying to modify a user pool while * a user import job is in progress for that pool.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DeleteUserPool * @see AWS * API Documentation */ @Override public CompletableFuture deleteUserPool(DeleteUserPoolRequest deleteUserPoolRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteUserPoolRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteUserPoolRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteUserPool"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteUserPoolResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteUserPool").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteUserPoolRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteUserPoolRequest)); 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); } } /** *

* Allows the developer to delete the user pool client. *

* * @param deleteUserPoolClientRequest * Represents the request to delete a user pool client. * @return A Java Future containing the result of the DeleteUserPoolClient operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • ConcurrentModificationException This exception is thrown if two or more modifications are happening * concurrently.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DeleteUserPoolClient * @see AWS API Documentation */ @Override public CompletableFuture deleteUserPoolClient( DeleteUserPoolClientRequest deleteUserPoolClientRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteUserPoolClientRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteUserPoolClientRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteUserPoolClient"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteUserPoolClientResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteUserPoolClient").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteUserPoolClientRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteUserPoolClientRequest)); 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 domain for a user pool. *

* * @param deleteUserPoolDomainRequest * @return A Java Future containing the result of the DeleteUserPoolDomain operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DeleteUserPoolDomain * @see AWS API Documentation */ @Override public CompletableFuture deleteUserPoolDomain( DeleteUserPoolDomainRequest deleteUserPoolDomainRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteUserPoolDomainRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteUserPoolDomainRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteUserPoolDomain"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteUserPoolDomainResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteUserPoolDomain").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteUserPoolDomainRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteUserPoolDomainRequest)); 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); } } /** *

* Gets information about a specific IdP. *

* * @param describeIdentityProviderRequest * @return A Java Future containing the result of the DescribeIdentityProvider operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DescribeIdentityProvider * @see AWS API Documentation */ @Override public CompletableFuture describeIdentityProvider( DescribeIdentityProviderRequest describeIdentityProviderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeIdentityProviderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeIdentityProviderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeIdentityProvider"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeIdentityProviderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeIdentityProvider").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeIdentityProviderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeIdentityProviderRequest)); 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); } } /** *

* Describes a resource server. *

* * @param describeResourceServerRequest * @return A Java Future containing the result of the DescribeResourceServer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DescribeResourceServer * @see AWS API Documentation */ @Override public CompletableFuture describeResourceServer( DescribeResourceServerRequest describeResourceServerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeResourceServerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeResourceServerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeResourceServer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeResourceServerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeResourceServer").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeResourceServerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeResourceServerRequest)); 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); } } /** *

* Describes the risk configuration. *

* * @param describeRiskConfigurationRequest * @return A Java Future containing the result of the DescribeRiskConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserPoolAddOnNotEnabledException This exception is thrown when user pool add-ons aren't enabled.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DescribeRiskConfiguration * @see AWS API Documentation */ @Override public CompletableFuture describeRiskConfiguration( DescribeRiskConfigurationRequest describeRiskConfigurationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeRiskConfigurationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeRiskConfigurationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeRiskConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeRiskConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeRiskConfiguration").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeRiskConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeRiskConfigurationRequest)); 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); } } /** *

* Describes the user import job. *

* * @param describeUserImportJobRequest * Represents the request to describe the user import job. * @return A Java Future containing the result of the DescribeUserImportJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DescribeUserImportJob * @see AWS API Documentation */ @Override public CompletableFuture describeUserImportJob( DescribeUserImportJobRequest describeUserImportJobRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeUserImportJobRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeUserImportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeUserImportJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeUserImportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeUserImportJob").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeUserImportJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeUserImportJobRequest)); 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); } } /** *

* Returns the configuration information and metadata of the specified user pool. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param describeUserPoolRequest * Represents the request to describe the user pool. * @return A Java Future containing the result of the DescribeUserPool operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserPoolTaggingException This exception is thrown when a user pool tag can't be set or updated.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DescribeUserPool * @see AWS * API Documentation */ @Override public CompletableFuture describeUserPool(DescribeUserPoolRequest describeUserPoolRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeUserPoolRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeUserPoolRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeUserPool"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeUserPoolResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeUserPool").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeUserPoolRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeUserPoolRequest)); 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); } } /** *

* Client method for returning the configuration information and metadata of the specified user pool app client. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param describeUserPoolClientRequest * Represents the request to describe a user pool client. * @return A Java Future containing the result of the DescribeUserPoolClient operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DescribeUserPoolClient * @see AWS API Documentation */ @Override public CompletableFuture describeUserPoolClient( DescribeUserPoolClientRequest describeUserPoolClientRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeUserPoolClientRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeUserPoolClientRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeUserPoolClient"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeUserPoolClientResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeUserPoolClient").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeUserPoolClientRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeUserPoolClientRequest)); 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); } } /** *

* Gets information about a domain. *

* * @param describeUserPoolDomainRequest * @return A Java Future containing the result of the DescribeUserPoolDomain operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.DescribeUserPoolDomain * @see AWS API Documentation */ @Override public CompletableFuture describeUserPoolDomain( DescribeUserPoolDomainRequest describeUserPoolDomainRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeUserPoolDomainRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeUserPoolDomainRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeUserPoolDomain"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeUserPoolDomainResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeUserPoolDomain").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeUserPoolDomainRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeUserPoolDomainRequest)); 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); } } /** *

* Forgets the specified device. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param forgetDeviceRequest * Represents the request to forget the device. * @return A Java Future containing the result of the ForgetDevice operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InvalidUserPoolConfigurationException This exception is thrown when the user pool configuration is * not valid.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ForgetDevice * @see AWS API * Documentation */ @Override public CompletableFuture forgetDevice(ForgetDeviceRequest forgetDeviceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(forgetDeviceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, forgetDeviceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ForgetDevice"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ForgetDeviceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ForgetDevice").withProtocolMetadata(protocolMetadata) .withMarshaller(new ForgetDeviceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(forgetDeviceRequest)); 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); } } /** *

* Calling this API causes a message to be sent to the end user with a confirmation code that is required to change * the user's password. For the Username parameter, you can use the username or user alias. The method * used to send the confirmation code is sent according to the specified AccountRecoverySetting. For more * information, see Recovering * User Accounts in the Amazon Cognito Developer Guide. To use the confirmation code for resetting the * password, call ConfirmForgotPassword. *

*

* If neither a verified phone number nor a verified email exists, this API returns * InvalidParameterException. If your app client has a client secret and you don't provide a * SECRET_HASH parameter, this API returns NotAuthorizedException. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
*

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
* * @param forgotPasswordRequest * Represents the request to reset a user's password. * @return A Java Future containing the result of the ForgotPassword operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • InvalidEmailRoleAccessPolicyException This exception is thrown when Amazon Cognito isn't allowed to * use your email identity. HTTP status code: 400.
  • *
  • CodeDeliveryFailureException This exception is thrown when a verification code fails to deliver * successfully.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ForgotPassword * @see AWS * API Documentation */ @Override public CompletableFuture forgotPassword(ForgotPasswordRequest forgotPasswordRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(forgotPasswordRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, forgotPasswordRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ForgotPassword"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ForgotPasswordResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ForgotPassword").withProtocolMetadata(protocolMetadata) .withMarshaller(new ForgotPasswordRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(forgotPasswordRequest)); 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); } } /** *

* Gets the header information for the comma-separated value (CSV) file to be used as input for the user import job. *

* * @param getCsvHeaderRequest * Represents the request to get the header information of the CSV file for the user import job. * @return A Java Future containing the result of the GetCSVHeader operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.GetCSVHeader * @see AWS API * Documentation */ @Override public CompletableFuture getCSVHeader(GetCsvHeaderRequest getCsvHeaderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCsvHeaderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getCsvHeaderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCSVHeader"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetCsvHeaderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCSVHeader").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetCsvHeaderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getCsvHeaderRequest)); 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); } } /** *

* Gets the device. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param getDeviceRequest * Represents the request to get the device. * @return A Java Future containing the result of the GetDevice operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • InvalidUserPoolConfigurationException This exception is thrown when the user pool configuration is * not valid.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.GetDevice * @see AWS API * Documentation */ @Override public CompletableFuture getDevice(GetDeviceRequest getDeviceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDeviceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getDeviceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDevice"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetDeviceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetDevice") .withProtocolMetadata(protocolMetadata) .withMarshaller(new GetDeviceRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(getDeviceRequest)); 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); } } /** *

* Gets a group. *

*

* Calling this action requires developer credentials. *

* * @param getGroupRequest * @return A Java Future containing the result of the GetGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.GetGroup * @see AWS API * Documentation */ @Override public CompletableFuture getGroup(GetGroupRequest getGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetGroup") .withProtocolMetadata(protocolMetadata) .withMarshaller(new GetGroupRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withMetricCollector(apiCallMetricCollector).withInput(getGroupRequest)); 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); } } /** *

* Gets the specified IdP. *

* * @param getIdentityProviderByIdentifierRequest * @return A Java Future containing the result of the GetIdentityProviderByIdentifier operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.GetIdentityProviderByIdentifier * @see AWS API Documentation */ @Override public CompletableFuture getIdentityProviderByIdentifier( GetIdentityProviderByIdentifierRequest getIdentityProviderByIdentifierRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getIdentityProviderByIdentifierRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getIdentityProviderByIdentifierRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetIdentityProviderByIdentifier"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetIdentityProviderByIdentifierResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetIdentityProviderByIdentifier").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetIdentityProviderByIdentifierRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getIdentityProviderByIdentifierRequest)); 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); } } /** *

* Gets the detailed activity logging configuration for a user pool. *

* * @param getLogDeliveryConfigurationRequest * @return A Java Future containing the result of the GetLogDeliveryConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.GetLogDeliveryConfiguration * @see AWS API Documentation */ @Override public CompletableFuture getLogDeliveryConfiguration( GetLogDeliveryConfigurationRequest getLogDeliveryConfigurationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getLogDeliveryConfigurationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getLogDeliveryConfigurationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetLogDeliveryConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetLogDeliveryConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetLogDeliveryConfiguration").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetLogDeliveryConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getLogDeliveryConfigurationRequest)); 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); } } /** *

* This method takes a user pool ID, and returns the signing certificate. The issued certificate is valid for 10 * years from the date of issue. *

*

* Amazon Cognito issues and assigns a new signing certificate annually. This process returns a new value in the * response to GetSigningCertificate, but doesn't invalidate the original certificate. *

* * @param getSigningCertificateRequest * Request to get a signing certificate from Amazon Cognito. * @return A Java Future containing the result of the GetSigningCertificate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.GetSigningCertificate * @see AWS API Documentation */ @Override public CompletableFuture getSigningCertificate( GetSigningCertificateRequest getSigningCertificateRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSigningCertificateRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getSigningCertificateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSigningCertificate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSigningCertificateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSigningCertificate").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetSigningCertificateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getSigningCertificateRequest)); 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); } } /** *

* Gets the user interface (UI) Customization information for a particular app client's app UI, if any such * information exists for the client. If nothing is set for the particular client, but there is an existing pool * level customization (the app clientId is ALL), then that information is returned. If * nothing is present, then an empty shape is returned. *

* * @param getUiCustomizationRequest * @return A Java Future containing the result of the GetUICustomization operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.GetUICustomization * @see AWS API Documentation */ @Override public CompletableFuture getUICustomization(GetUiCustomizationRequest getUiCustomizationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getUiCustomizationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getUiCustomizationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetUICustomization"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetUiCustomizationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetUICustomization").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetUiCustomizationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getUiCustomizationRequest)); 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); } } /** *

* Gets the user attributes and metadata for a user. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param getUserRequest * Represents the request to get information about the user. * @return A Java Future containing the result of the GetUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.GetUser * @see AWS API * Documentation */ @Override public CompletableFuture getUser(GetUserRequest getUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetUser") .withProtocolMetadata(protocolMetadata).withMarshaller(new GetUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(getUserRequest)); 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); } } /** *

* Generates a user attribute verification code for the specified attribute name. Sends a message to a user with a * code that they must return in a VerifyUserAttribute request. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
*

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
* * @param getUserAttributeVerificationCodeRequest * Represents the request to get user attribute verification. * @return A Java Future containing the result of the GetUserAttributeVerificationCode operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • InvalidEmailRoleAccessPolicyException This exception is thrown when Amazon Cognito isn't allowed to * use your email identity. HTTP status code: 400.
  • *
  • CodeDeliveryFailureException This exception is thrown when a verification code fails to deliver * successfully.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.GetUserAttributeVerificationCode * @see AWS API Documentation */ @Override public CompletableFuture getUserAttributeVerificationCode( GetUserAttributeVerificationCodeRequest getUserAttributeVerificationCodeRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getUserAttributeVerificationCodeRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getUserAttributeVerificationCodeRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetUserAttributeVerificationCode"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, GetUserAttributeVerificationCodeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetUserAttributeVerificationCode").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetUserAttributeVerificationCodeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(getUserAttributeVerificationCodeRequest)); 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); } } /** *

* Gets the user pool multi-factor authentication (MFA) configuration. *

* * @param getUserPoolMfaConfigRequest * @return A Java Future containing the result of the GetUserPoolMfaConfig operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.GetUserPoolMfaConfig * @see AWS API Documentation */ @Override public CompletableFuture getUserPoolMfaConfig( GetUserPoolMfaConfigRequest getUserPoolMfaConfigRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getUserPoolMfaConfigRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getUserPoolMfaConfigRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetUserPoolMfaConfig"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetUserPoolMfaConfigResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetUserPoolMfaConfig").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetUserPoolMfaConfigRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getUserPoolMfaConfigRequest)); 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); } } /** *

* Signs out a user from all devices. GlobalSignOut invalidates all identity, access and refresh tokens * that Amazon Cognito has issued to a user. A user can still use a hosted UI cookie to retrieve new tokens for the * duration of the 1-hour cookie validity period. *

*

* Your app isn't aware that a user's access token is revoked unless it attempts to authorize a user pools API * request with an access token that contains the scope aws.cognito.signin.user.admin. Your app might * otherwise accept access tokens until they expire. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param globalSignOutRequest * Represents the request to sign out all devices. * @return A Java Future containing the result of the GlobalSignOut operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.GlobalSignOut * @see AWS API * Documentation */ @Override public CompletableFuture globalSignOut(GlobalSignOutRequest globalSignOutRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(globalSignOutRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, globalSignOutRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GlobalSignOut"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GlobalSignOutResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GlobalSignOut").withProtocolMetadata(protocolMetadata) .withMarshaller(new GlobalSignOutRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(globalSignOutRequest)); 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); } } /** *

* Initiates sign-in for a user in the Amazon Cognito user directory. You can't sign in a user with a federated IdP * with InitiateAuth. For more information, see * Adding user pool sign-in through a third party. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
*

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
* * @param initiateAuthRequest * Initiates the authentication request. * @return A Java Future containing the result of the InitiateAuth operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • InvalidUserPoolConfigurationException This exception is thrown when the user pool configuration is * not valid.
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.InitiateAuth * @see AWS API * Documentation */ @Override public CompletableFuture initiateAuth(InitiateAuthRequest initiateAuthRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(initiateAuthRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, initiateAuthRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "InitiateAuth"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, InitiateAuthResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("InitiateAuth").withProtocolMetadata(protocolMetadata) .withMarshaller(new InitiateAuthRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(initiateAuthRequest)); 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); } } /** *

* Lists the sign-in devices that Amazon Cognito has registered to the current user. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param listDevicesRequest * Represents the request to list the devices. * @return A Java Future containing the result of the ListDevices operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InvalidUserPoolConfigurationException This exception is thrown when the user pool configuration is * not valid.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ListDevices * @see AWS API * Documentation */ @Override public CompletableFuture listDevices(ListDevicesRequest listDevicesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDevicesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listDevicesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDevices"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListDevicesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListDevices").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListDevicesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(listDevicesRequest)); 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); } } /** *

* Lists the groups associated with a user pool. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param listGroupsRequest * @return A Java Future containing the result of the ListGroups operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ListGroups * @see AWS API * Documentation */ @Override public CompletableFuture listGroups(ListGroupsRequest listGroupsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listGroupsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listGroupsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListGroups"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListGroupsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("ListGroups") .withProtocolMetadata(protocolMetadata) .withMarshaller(new ListGroupsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listGroupsRequest)); 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); } } /** *

* Lists information about all IdPs for a user pool. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param listIdentityProvidersRequest * @return A Java Future containing the result of the ListIdentityProviders operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ListIdentityProviders * @see AWS API Documentation */ @Override public CompletableFuture listIdentityProviders( ListIdentityProvidersRequest listIdentityProvidersRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listIdentityProvidersRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listIdentityProvidersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListIdentityProviders"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListIdentityProvidersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListIdentityProviders").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListIdentityProvidersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listIdentityProvidersRequest)); 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); } } /** *

* Lists the resource servers for a user pool. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param listResourceServersRequest * @return A Java Future containing the result of the ListResourceServers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ListResourceServers * @see AWS API Documentation */ @Override public CompletableFuture listResourceServers( ListResourceServersRequest listResourceServersRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listResourceServersRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listResourceServersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListResourceServers"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListResourceServersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListResourceServers").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListResourceServersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listResourceServersRequest)); 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); } } /** *

* Lists the tags that are assigned to an Amazon Cognito user pool. *

*

* A tag is a label that you can apply to user pools to categorize and manage them in different ways, such as by * purpose, owner, environment, or other criteria. *

*

* You can use this action up to 10 times per second, per account. *

* * @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. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ListTagsForResource * @see AWS API Documentation */ @Override public CompletableFuture listTagsForResource( ListTagsForResourceRequest listTagsForResourceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTagsForResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); 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").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listTagsForResourceRequest)); 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); } } /** *

* Lists user import jobs for a user pool. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param listUserImportJobsRequest * Represents the request to list the user import jobs. * @return A Java Future containing the result of the ListUserImportJobs operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ListUserImportJobs * @see AWS API Documentation */ @Override public CompletableFuture listUserImportJobs(ListUserImportJobsRequest listUserImportJobsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listUserImportJobsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listUserImportJobsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListUserImportJobs"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListUserImportJobsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListUserImportJobs").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListUserImportJobsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listUserImportJobsRequest)); 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); } } /** *

* Lists the clients that have been created for the specified user pool. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param listUserPoolClientsRequest * Represents the request to list the user pool clients. * @return A Java Future containing the result of the ListUserPoolClients operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ListUserPoolClients * @see AWS API Documentation */ @Override public CompletableFuture listUserPoolClients( ListUserPoolClientsRequest listUserPoolClientsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listUserPoolClientsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listUserPoolClientsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListUserPoolClients"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListUserPoolClientsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListUserPoolClients").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListUserPoolClientsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listUserPoolClientsRequest)); 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); } } /** *

* Lists the user pools associated with an Amazon Web Services account. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param listUserPoolsRequest * Represents the request to list user pools. * @return A Java Future containing the result of the ListUserPools operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ListUserPools * @see AWS API * Documentation */ @Override public CompletableFuture listUserPools(ListUserPoolsRequest listUserPoolsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listUserPoolsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listUserPoolsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListUserPools"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListUserPoolsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListUserPools").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListUserPoolsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listUserPoolsRequest)); 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); } } /** *

* Lists users and their basic details in a user pool. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param listUsersRequest * Represents the request to list users. * @return A Java Future containing the result of the ListUsers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ListUsers * @see AWS API * Documentation */ @Override public CompletableFuture listUsers(ListUsersRequest listUsersRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listUsersRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listUsersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListUsers"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListUsersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("ListUsers") .withProtocolMetadata(protocolMetadata) .withMarshaller(new ListUsersRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withMetricCollector(apiCallMetricCollector).withInput(listUsersRequest)); 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); } } /** *

* Lists the users in the specified group. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param listUsersInGroupRequest * @return A Java Future containing the result of the ListUsersInGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ListUsersInGroup * @see AWS * API Documentation */ @Override public CompletableFuture listUsersInGroup(ListUsersInGroupRequest listUsersInGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listUsersInGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listUsersInGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListUsersInGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListUsersInGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListUsersInGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListUsersInGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listUsersInGroupRequest)); 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); } } /** *

* Resends the confirmation (for confirmation of registration) to a specific user in the user pool. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
*

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
* * @param resendConfirmationCodeRequest * Represents the request to resend the confirmation code. * @return A Java Future containing the result of the ResendConfirmationCode operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • InvalidEmailRoleAccessPolicyException This exception is thrown when Amazon Cognito isn't allowed to * use your email identity. HTTP status code: 400.
  • *
  • CodeDeliveryFailureException This exception is thrown when a verification code fails to deliver * successfully.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.ResendConfirmationCode * @see AWS API Documentation */ @Override public CompletableFuture resendConfirmationCode( ResendConfirmationCodeRequest resendConfirmationCodeRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(resendConfirmationCodeRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, resendConfirmationCodeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ResendConfirmationCode"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ResendConfirmationCodeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ResendConfirmationCode").withProtocolMetadata(protocolMetadata) .withMarshaller(new ResendConfirmationCodeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(resendConfirmationCodeRequest)); 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); } } /** *

* Responds to the authentication challenge. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
*

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
* * @param respondToAuthChallengeRequest * The request to respond to an authentication challenge. * @return A Java Future containing the result of the RespondToAuthChallenge operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • CodeMismatchException This exception is thrown if the provided code doesn't match what the server was * expecting.
  • *
  • ExpiredCodeException This exception is thrown if a code has expired.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • InvalidPasswordException This exception is thrown when Amazon Cognito encounters an invalid password. *
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InvalidUserPoolConfigurationException This exception is thrown when the user pool configuration is * not valid.
  • *
  • MfaMethodNotFoundException This exception is thrown when Amazon Cognito can't find a multi-factor * authentication (MFA) method.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • AliasExistsException This exception is thrown when a user tries to confirm the account with an email * address or phone number that has already been supplied as an alias for a different user profile. This * exception indicates that an account with this email address or phone already exists in a user pool that * you've configured to use email address or phone number as a sign-in alias.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • SoftwareTokenMfaNotFoundException This exception is thrown when the software token time-based * one-time password (TOTP) multi-factor authentication (MFA) isn't activated for the user pool.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.RespondToAuthChallenge * @see AWS API Documentation */ @Override public CompletableFuture respondToAuthChallenge( RespondToAuthChallengeRequest respondToAuthChallengeRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(respondToAuthChallengeRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, respondToAuthChallengeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RespondToAuthChallenge"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RespondToAuthChallengeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RespondToAuthChallenge").withProtocolMetadata(protocolMetadata) .withMarshaller(new RespondToAuthChallengeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(respondToAuthChallengeRequest)); 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); } } /** *

* Revokes all of the access tokens generated by, and at the same time as, the specified refresh token. After a * token is revoked, you can't use the revoked token to access Amazon Cognito user APIs, or to authorize access to * your resource server. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param revokeTokenRequest * @return A Java Future containing the result of the RevokeToken operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • UnauthorizedException Exception that is thrown when the request isn't authorized. This can happen due * to an invalid access token in the request.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • UnsupportedOperationException Exception that is thrown when you attempt to perform an operation that * isn't enabled for the user pool client.
  • *
  • UnsupportedTokenTypeException Exception that is thrown when an unsupported token is passed to an * operation.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.RevokeToken * @see AWS API * Documentation */ @Override public CompletableFuture revokeToken(RevokeTokenRequest revokeTokenRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(revokeTokenRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, revokeTokenRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RevokeToken"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, RevokeTokenResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RevokeToken").withProtocolMetadata(protocolMetadata) .withMarshaller(new RevokeTokenRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(revokeTokenRequest)); 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); } } /** *

* Sets up or modifies the detailed activity logging configuration of a user pool. *

* * @param setLogDeliveryConfigurationRequest * @return A Java Future containing the result of the SetLogDeliveryConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.SetLogDeliveryConfiguration * @see AWS API Documentation */ @Override public CompletableFuture setLogDeliveryConfiguration( SetLogDeliveryConfigurationRequest setLogDeliveryConfigurationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(setLogDeliveryConfigurationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, setLogDeliveryConfigurationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SetLogDeliveryConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, SetLogDeliveryConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SetLogDeliveryConfiguration").withProtocolMetadata(protocolMetadata) .withMarshaller(new SetLogDeliveryConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(setLogDeliveryConfigurationRequest)); 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); } } /** *

* Configures actions on detected risks. To delete the risk configuration for UserPoolId or * ClientId, pass null values for all four configuration types. *

*

* To activate Amazon Cognito advanced security features, update the user pool to include the * UserPoolAddOns keyAdvancedSecurityMode. *

* * @param setRiskConfigurationRequest * @return A Java Future containing the result of the SetRiskConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserPoolAddOnNotEnabledException This exception is thrown when user pool add-ons aren't enabled.
  • *
  • CodeDeliveryFailureException This exception is thrown when a verification code fails to deliver * successfully.
  • *
  • InvalidEmailRoleAccessPolicyException This exception is thrown when Amazon Cognito isn't allowed to * use your email identity. HTTP status code: 400.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.SetRiskConfiguration * @see AWS API Documentation */ @Override public CompletableFuture setRiskConfiguration( SetRiskConfigurationRequest setRiskConfigurationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(setRiskConfigurationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, setRiskConfigurationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SetRiskConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, SetRiskConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SetRiskConfiguration").withProtocolMetadata(protocolMetadata) .withMarshaller(new SetRiskConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(setRiskConfigurationRequest)); 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); } } /** *

* Sets the user interface (UI) customization information for a user pool's built-in app UI. *

*

* You can specify app UI customization settings for a single client (with a specific clientId) or for * all clients (by setting the clientId to ALL). If you specify ALL, the * default configuration is used for every client that has no previously set UI customization. If you specify UI * customization settings for a particular client, it will no longer return to the ALL configuration. *

* *

* To use this API, your user pool must have a domain associated with it. Otherwise, there is no place to host the * app's pages, and the service will throw an error. *

*
* * @param setUiCustomizationRequest * @return A Java Future containing the result of the SetUICustomization operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.SetUICustomization * @see AWS API Documentation */ @Override public CompletableFuture setUICustomization(SetUiCustomizationRequest setUiCustomizationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(setUiCustomizationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, setUiCustomizationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SetUICustomization"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, SetUiCustomizationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SetUICustomization").withProtocolMetadata(protocolMetadata) .withMarshaller(new SetUiCustomizationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(setUiCustomizationRequest)); 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); } } /** *

* Set the user's multi-factor authentication (MFA) method preference, including which MFA factors are activated and * if any are preferred. Only one factor can be set as preferred. The preferred MFA factor will be used to * authenticate a user if multiple factors are activated. If multiple options are activated and no preference is * set, a challenge to choose an MFA option will be returned during sign-in. If an MFA type is activated for a user, * the user will be prompted for MFA during all sign-in attempts unless device tracking is turned on and the device * has been trusted. If you want MFA to be applied selectively based on the assessed risk level of sign-in attempts, * deactivate MFA for users and turn on Adaptive Authentication for the user pool. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param setUserMfaPreferenceRequest * @return A Java Future containing the result of the SetUserMFAPreference operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.SetUserMFAPreference * @see AWS API Documentation */ @Override public CompletableFuture setUserMFAPreference( SetUserMfaPreferenceRequest setUserMfaPreferenceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(setUserMfaPreferenceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, setUserMfaPreferenceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SetUserMFAPreference"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, SetUserMfaPreferenceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SetUserMFAPreference").withProtocolMetadata(protocolMetadata) .withMarshaller(new SetUserMfaPreferenceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(setUserMfaPreferenceRequest)); 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); } } /** *

* Sets the user pool multi-factor authentication (MFA) configuration. *

* *

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
* * @param setUserPoolMfaConfigRequest * @return A Java Future containing the result of the SetUserPoolMfaConfig operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.SetUserPoolMfaConfig * @see AWS API Documentation */ @Override public CompletableFuture setUserPoolMfaConfig( SetUserPoolMfaConfigRequest setUserPoolMfaConfigRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(setUserPoolMfaConfigRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, setUserPoolMfaConfigRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SetUserPoolMfaConfig"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, SetUserPoolMfaConfigResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SetUserPoolMfaConfig").withProtocolMetadata(protocolMetadata) .withMarshaller(new SetUserPoolMfaConfigRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(setUserPoolMfaConfigRequest)); 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); } } /** *

* This action is no longer supported. You can use it to configure only SMS MFA. You can't use it to * configure time-based one-time password (TOTP) software token MFA. To configure either type of MFA, use SetUserMFAPreference instead. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param setUserSettingsRequest * Represents the request to set user settings. * @return A Java Future containing the result of the SetUserSettings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.SetUserSettings * @see AWS * API Documentation */ @Override public CompletableFuture setUserSettings(SetUserSettingsRequest setUserSettingsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(setUserSettingsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, setUserSettingsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SetUserSettings"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, SetUserSettingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("SetUserSettings").withProtocolMetadata(protocolMetadata) .withMarshaller(new SetUserSettingsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(setUserSettingsRequest)); 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); } } /** *

* Registers the user in the specified user pool and creates a user name, password, and user attributes. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
*

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
* * @param signUpRequest * Represents the request to register a user. * @return A Java Future containing the result of the SignUp operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InvalidPasswordException This exception is thrown when Amazon Cognito encounters an invalid password. *
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • UsernameExistsException This exception is thrown when Amazon Cognito encounters a user name that * already exists in the user pool.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • InvalidEmailRoleAccessPolicyException This exception is thrown when Amazon Cognito isn't allowed to * use your email identity. HTTP status code: 400.
  • *
  • CodeDeliveryFailureException This exception is thrown when a verification code fails to deliver * successfully.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.SignUp * @see AWS API * Documentation */ @Override public CompletableFuture signUp(SignUpRequest signUpRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(signUpRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, signUpRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SignUp"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, SignUpResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("SignUp") .withProtocolMetadata(protocolMetadata).withMarshaller(new SignUpRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(signUpRequest)); 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); } } /** *

* Starts the user import. *

* * @param startUserImportJobRequest * Represents the request to start the user import job. * @return A Java Future containing the result of the StartUserImportJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • PreconditionNotMetException This exception is thrown when a precondition is not met.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.StartUserImportJob * @see AWS API Documentation */ @Override public CompletableFuture startUserImportJob(StartUserImportJobRequest startUserImportJobRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startUserImportJobRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startUserImportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartUserImportJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartUserImportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartUserImportJob").withProtocolMetadata(protocolMetadata) .withMarshaller(new StartUserImportJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(startUserImportJobRequest)); 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); } } /** *

* Stops the user import job. *

* * @param stopUserImportJobRequest * Represents the request to stop the user import job. * @return A Java Future containing the result of the StopUserImportJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • PreconditionNotMetException This exception is thrown when a precondition is not met.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.StopUserImportJob * @see AWS * API Documentation */ @Override public CompletableFuture stopUserImportJob(StopUserImportJobRequest stopUserImportJobRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopUserImportJobRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, stopUserImportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopUserImportJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StopUserImportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StopUserImportJob").withProtocolMetadata(protocolMetadata) .withMarshaller(new StopUserImportJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(stopUserImportJobRequest)); 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); } } /** *

* Assigns a set of tags to an Amazon Cognito user pool. A tag is a label that you can use to categorize and manage * user pools in different ways, such as by purpose, owner, environment, or other criteria. *

*

* Each tag consists of a key and value, both of which you define. A key is a general category for more specific * values. For example, if you have two versions of a user pool, one for testing and another for production, you * might assign an Environment tag key to both user pools. The value of this key might be * Test for one user pool, and Production for the other. *

*

* Tags are useful for cost tracking and access control. You can activate your tags so that they appear on the * Billing and Cost Management console, where you can track the costs associated with your user pools. In an * Identity and Access Management policy, you can constrain permissions for user pools based on specific tags or tag * values. *

*

* You can use this action up to 5 times per second, per account. A user pool can have as many as 50 tags. *

* * @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. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.TagResource * @see AWS API * Documentation */ @Override public CompletableFuture tagResource(TagResourceRequest tagResourceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(tagResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); 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").withProtocolMetadata(protocolMetadata) .withMarshaller(new TagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(tagResourceRequest)); 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 the specified tags from an Amazon Cognito user pool. You can use this action up to 5 times per second, * per account. *

* * @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. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.UntagResource * @see AWS API * Documentation */ @Override public CompletableFuture untagResource(UntagResourceRequest untagResourceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(untagResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); 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").withProtocolMetadata(protocolMetadata) .withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(untagResourceRequest)); 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); } } /** *

* Provides the feedback for an authentication event, whether it was from a valid user or not. This feedback is used * for improving the risk evaluation decision for the user pool as part of Amazon Cognito advanced security. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param updateAuthEventFeedbackRequest * @return A Java Future containing the result of the UpdateAuthEventFeedback operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserPoolAddOnNotEnabledException This exception is thrown when user pool add-ons aren't enabled.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.UpdateAuthEventFeedback * @see AWS API Documentation */ @Override public CompletableFuture updateAuthEventFeedback( UpdateAuthEventFeedbackRequest updateAuthEventFeedbackRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateAuthEventFeedbackRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAuthEventFeedbackRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAuthEventFeedback"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateAuthEventFeedbackResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateAuthEventFeedback").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateAuthEventFeedbackRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(updateAuthEventFeedbackRequest)); 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 device status. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param updateDeviceStatusRequest * Represents the request to update the device status. * @return A Java Future containing the result of the UpdateDeviceStatus operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InvalidUserPoolConfigurationException This exception is thrown when the user pool configuration is * not valid.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.UpdateDeviceStatus * @see AWS API Documentation */ @Override public CompletableFuture updateDeviceStatus(UpdateDeviceStatusRequest updateDeviceStatusRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateDeviceStatusRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDeviceStatusRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDeviceStatus"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateDeviceStatusResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateDeviceStatus").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateDeviceStatusRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(updateDeviceStatusRequest)); 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 specified group with the specified attributes. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param updateGroupRequest * @return A Java Future containing the result of the UpdateGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.UpdateGroup * @see AWS API * Documentation */ @Override public CompletableFuture updateGroup(UpdateGroupRequest updateGroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateGroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateGroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateGroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateGroupRequest)); 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 IdP information for a user pool. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param updateIdentityProviderRequest * @return A Java Future containing the result of the UpdateIdentityProvider operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • UnsupportedIdentityProviderException This exception is thrown when the specified identifier isn't * supported.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • ConcurrentModificationException This exception is thrown if two or more modifications are happening * concurrently.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.UpdateIdentityProvider * @see AWS API Documentation */ @Override public CompletableFuture updateIdentityProvider( UpdateIdentityProviderRequest updateIdentityProviderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateIdentityProviderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateIdentityProviderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateIdentityProvider"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateIdentityProviderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateIdentityProvider").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateIdentityProviderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateIdentityProviderRequest)); 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 name and scopes of resource server. All other fields are read-only. *

* *

* If you don't provide a value for an attribute, it is set to the default value. *

*
*

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param updateResourceServerRequest * @return A Java Future containing the result of the UpdateResourceServer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.UpdateResourceServer * @see AWS API Documentation */ @Override public CompletableFuture updateResourceServer( UpdateResourceServerRequest updateResourceServerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateResourceServerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateResourceServerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateResourceServer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateResourceServerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateResourceServer").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateResourceServerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateResourceServerRequest)); 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); } } /** *

* Allows a user to update a specific attribute (one at a time). *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
*

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
* * @param updateUserAttributesRequest * Represents the request to update user attributes. * @return A Java Future containing the result of the UpdateUserAttributes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • CodeMismatchException This exception is thrown if the provided code doesn't match what the server was * expecting.
  • *
  • ExpiredCodeException This exception is thrown if a code has expired.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UnexpectedLambdaException This exception is thrown when Amazon Cognito encounters an unexpected * exception with Lambda.
  • *
  • UserLambdaValidationException This exception is thrown when the Amazon Cognito service encounters a * user validation exception with the Lambda service.
  • *
  • InvalidLambdaResponseException This exception is thrown when Amazon Cognito encounters an invalid * Lambda response.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • AliasExistsException This exception is thrown when a user tries to confirm the account with an email * address or phone number that has already been supplied as an alias for a different user profile. This * exception indicates that an account with this email address or phone already exists in a user pool that * you've configured to use email address or phone number as a sign-in alias.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • InvalidEmailRoleAccessPolicyException This exception is thrown when Amazon Cognito isn't allowed to * use your email identity. HTTP status code: 400.
  • *
  • CodeDeliveryFailureException This exception is thrown when a verification code fails to deliver * successfully.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.UpdateUserAttributes * @see AWS API Documentation */ @Override public CompletableFuture updateUserAttributes( UpdateUserAttributesRequest updateUserAttributesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateUserAttributesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateUserAttributesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateUserAttributes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateUserAttributesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateUserAttributes").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateUserAttributesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(updateUserAttributesRequest)); 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); } } /** * *

* This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to * register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text * messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered * number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, * activate their accounts, or sign in. *

*

* If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Service, Amazon Simple * Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send * messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move * out of the sandbox and into production. For more information, see SMS message * settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide. *

*
*

* Updates the specified user pool with the specified attributes. You can get a list of the current user pool * settings using DescribeUserPool. *

* *

* If you don't provide a value for an attribute, Amazon Cognito sets it to its default value. *

*
*

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param updateUserPoolRequest * Represents the request to update the user pool. * @return A Java Future containing the result of the UpdateUserPool operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ConcurrentModificationException This exception is thrown if two or more modifications are happening * concurrently.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • UserImportInProgressException This exception is thrown when you're trying to modify a user pool while * a user import job is in progress for that pool.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • InvalidSmsRoleAccessPolicyException This exception is returned when the role provided for SMS * configuration doesn't have permission to publish using Amazon SNS.
  • *
  • InvalidSmsRoleTrustRelationshipException This exception is thrown when the trust relationship is not * valid for the role provided for SMS configuration. This can happen if you don't trust * cognito-idp.amazonaws.com or the external ID provided in the role does not match what is * provided in the SMS configuration for the user pool.
  • *
  • UserPoolTaggingException This exception is thrown when a user pool tag can't be set or updated.
  • *
  • InvalidEmailRoleAccessPolicyException This exception is thrown when Amazon Cognito isn't allowed to * use your email identity. HTTP status code: 400.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.UpdateUserPool * @see AWS * API Documentation */ @Override public CompletableFuture updateUserPool(UpdateUserPoolRequest updateUserPoolRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateUserPoolRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateUserPoolRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateUserPool"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateUserPoolResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateUserPool").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateUserPoolRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateUserPoolRequest)); 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 specified user pool app client with the specified attributes. You can get a list of the current user * pool app client settings using DescribeUserPoolClient. *

* *

* If you don't provide a value for an attribute, Amazon Cognito sets it to its default value. *

*
*

* You can also use this operation to enable token revocation for user pool clients. For more information about * revoking tokens, see RevokeToken. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param updateUserPoolClientRequest * Represents the request to update the user pool client. * @return A Java Future containing the result of the UpdateUserPoolClient operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ConcurrentModificationException This exception is thrown if two or more modifications are happening * concurrently.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • ScopeDoesNotExistException This exception is thrown when the specified scope doesn't exist.
  • *
  • InvalidOAuthFlowException This exception is thrown when the specified OAuth flow is not valid.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.UpdateUserPoolClient * @see AWS API Documentation */ @Override public CompletableFuture updateUserPoolClient( UpdateUserPoolClientRequest updateUserPoolClientRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateUserPoolClientRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateUserPoolClientRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateUserPoolClient"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateUserPoolClientResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateUserPoolClient").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateUserPoolClientRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateUserPoolClientRequest)); 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 Secure Sockets Layer (SSL) certificate for the custom domain for your user pool. *

*

* You can use this operation to provide the Amazon Resource Name (ARN) of a new certificate to Amazon Cognito. You * can't use it to change the domain for a user pool. *

*

* A custom domain is used to host the Amazon Cognito hosted UI, which provides sign-up and sign-in pages for your * application. When you set up a custom domain, you provide a certificate that you manage with Certificate Manager * (ACM). When necessary, you can use this operation to change the certificate that you applied to your custom * domain. *

*

* Usually, this is unnecessary following routine certificate renewal with ACM. When you renew your existing * certificate in ACM, the ARN for your certificate remains the same, and your custom domain uses the new * certificate automatically. *

*

* However, if you replace your existing certificate with a new one, ACM gives the new certificate a new ARN. To * apply the new certificate to your custom domain, you must provide this ARN to Amazon Cognito. *

*

* When you add your new certificate in ACM, you must choose US East (N. Virginia) as the Amazon Web Services * Region. *

*

* After you submit your request, Amazon Cognito requires up to 1 hour to distribute your new certificate to your * custom domain. *

*

* For more information about adding a custom domain to your user pool, see Using * Your Own Domain for the Hosted UI. *

* *

* Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For * this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding * IAM permission in a policy. *

*

* Learn more *

* *
* * @param updateUserPoolDomainRequest * The UpdateUserPoolDomain request input. * @return A Java Future containing the result of the UpdateUserPoolDomain operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.UpdateUserPoolDomain * @see AWS API Documentation */ @Override public CompletableFuture updateUserPoolDomain( UpdateUserPoolDomainRequest updateUserPoolDomainRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateUserPoolDomainRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateUserPoolDomainRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateUserPoolDomain"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateUserPoolDomainResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateUserPoolDomain").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateUserPoolDomainRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateUserPoolDomainRequest)); 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); } } /** *

* Use this API to register a user's entered time-based one-time password (TOTP) code and mark the user's software * token MFA status as "verified" if successful. The request takes an access token or a session string, but not * both. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param verifySoftwareTokenRequest * @return A Java Future containing the result of the VerifySoftwareToken operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidUserPoolConfigurationException This exception is thrown when the user pool configuration is * not valid.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • EnableSoftwareTokenMfaException This exception is thrown when there is a code mismatch and the * service fails to configure the software token TOTP multi-factor authentication (MFA).
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • SoftwareTokenMfaNotFoundException This exception is thrown when the software token time-based * one-time password (TOTP) multi-factor authentication (MFA) isn't activated for the user pool.
  • *
  • CodeMismatchException This exception is thrown if the provided code doesn't match what the server was * expecting.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.VerifySoftwareToken * @see AWS API Documentation */ @Override public CompletableFuture verifySoftwareToken( VerifySoftwareTokenRequest verifySoftwareTokenRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(verifySoftwareTokenRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, verifySoftwareTokenRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "VerifySoftwareToken"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, VerifySoftwareTokenResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("VerifySoftwareToken").withProtocolMetadata(protocolMetadata) .withMarshaller(new VerifySoftwareTokenRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(verifySoftwareTokenRequest)); 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); } } /** *

* Verifies the specified user attributes in the user pool. *

*

* If your user pool requires verification before Amazon Cognito updates the attribute value, VerifyUserAttribute * updates the affected attribute to its pending value. For more information, see UserAttributeUpdateSettingsType. *

* *

* Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. * For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in * policies. For more information about authorization models in Amazon Cognito, see Using the Amazon * Cognito native and OIDC APIs. *

*
* * @param verifyUserAttributeRequest * Represents the request to verify user attributes. * @return A Java Future containing the result of the VerifyUserAttribute operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException This exception is thrown when the Amazon Cognito service can't find the * requested resource.
  • *
  • InvalidParameterException This exception is thrown when the Amazon Cognito service encounters an * invalid parameter.
  • *
  • CodeMismatchException This exception is thrown if the provided code doesn't match what the server was * expecting.
  • *
  • ExpiredCodeException This exception is thrown if a code has expired.
  • *
  • NotAuthorizedException This exception is thrown when a user isn't authorized.
  • *
  • TooManyRequestsException This exception is thrown when the user has made too many requests for a * given operation.
  • *
  • LimitExceededException This exception is thrown when a user exceeds the limit for a requested Amazon * Web Services resource.
  • *
  • PasswordResetRequiredException This exception is thrown when a password reset is required.
  • *
  • UserNotFoundException This exception is thrown when a user isn't found.
  • *
  • UserNotConfirmedException This exception is thrown when a user isn't confirmed successfully.
  • *
  • InternalErrorException This exception is thrown when Amazon Cognito encounters an internal error.
  • *
  • AliasExistsException This exception is thrown when a user tries to confirm the account with an email * address or phone number that has already been supplied as an alias for a different user profile. This * exception indicates that an account with this email address or phone already exists in a user pool that * you've configured to use email address or phone number as a sign-in alias.
  • *
  • ForbiddenException This exception is thrown when WAF doesn't allow your request based on a web ACL * that's associated with your user pool.
  • *
  • 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.
  • *
  • CognitoIdentityProviderException Base class for all service exceptions. Unknown exceptions will be * thrown as an instance of this type.
  • *
* @sample CognitoIdentityProviderAsyncClient.VerifyUserAttribute * @see AWS API Documentation */ @Override public CompletableFuture verifyUserAttribute( VerifyUserAttributeRequest verifyUserAttributeRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(verifyUserAttributeRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, verifyUserAttributeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Cognito Identity Provider"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "VerifyUserAttribute"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, VerifyUserAttributeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("VerifyUserAttribute").withProtocolMetadata(protocolMetadata) .withMarshaller(new VerifyUserAttributeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) .withInput(verifyUserAttributeRequest)); 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 final CognitoIdentityProviderServiceClientConfiguration serviceClientConfiguration() { return new CognitoIdentityProviderServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public final String serviceName() { return SERVICE_NAME; } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(CognitoIdentityProviderException::builder) .protocol(AwsJsonProtocol.AWS_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("ConcurrentModificationException") .exceptionBuilderSupplier(ConcurrentModificationException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidLambdaResponseException") .exceptionBuilderSupplier(InvalidLambdaResponseException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidOAuthFlowException") .exceptionBuilderSupplier(InvalidOAuthFlowException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidSmsRoleAccessPolicyException") .exceptionBuilderSupplier(InvalidSmsRoleAccessPolicyException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UsernameExistsException") .exceptionBuilderSupplier(UsernameExistsException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UserImportInProgressException") .exceptionBuilderSupplier(UserImportInProgressException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("MFAMethodNotFoundException") .exceptionBuilderSupplier(MfaMethodNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("SoftwareTokenMFANotFoundException") .exceptionBuilderSupplier(SoftwareTokenMfaNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ExpiredCodeException") .exceptionBuilderSupplier(ExpiredCodeException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UnsupportedTokenTypeException") .exceptionBuilderSupplier(UnsupportedTokenTypeException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("LimitExceededException") .exceptionBuilderSupplier(LimitExceededException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UserNotFoundException") .exceptionBuilderSupplier(UserNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidPasswordException") .exceptionBuilderSupplier(InvalidPasswordException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UnsupportedOperationException") .exceptionBuilderSupplier(UnsupportedOperationException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AliasExistsException") .exceptionBuilderSupplier(AliasExistsException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UnsupportedUserStateException") .exceptionBuilderSupplier(UnsupportedUserStateException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("NotAuthorizedException") .exceptionBuilderSupplier(NotAuthorizedException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UnsupportedIdentityProviderException") .exceptionBuilderSupplier(UnsupportedIdentityProviderException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UserNotConfirmedException") .exceptionBuilderSupplier(UserNotConfirmedException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ForbiddenException") .exceptionBuilderSupplier(ForbiddenException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("PasswordResetRequiredException") .exceptionBuilderSupplier(PasswordResetRequiredException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UnexpectedLambdaException") .exceptionBuilderSupplier(UnexpectedLambdaException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("DuplicateProviderException") .exceptionBuilderSupplier(DuplicateProviderException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidParameterException") .exceptionBuilderSupplier(InvalidParameterException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UserLambdaValidationException") .exceptionBuilderSupplier(UserLambdaValidationException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidSmsRoleTrustRelationshipException") .exceptionBuilderSupplier(InvalidSmsRoleTrustRelationshipException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TooManyFailedAttemptsException") .exceptionBuilderSupplier(TooManyFailedAttemptsException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("CodeDeliveryFailureException") .exceptionBuilderSupplier(CodeDeliveryFailureException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UnauthorizedException") .exceptionBuilderSupplier(UnauthorizedException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ScopeDoesNotExistException") .exceptionBuilderSupplier(ScopeDoesNotExistException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalErrorException") .exceptionBuilderSupplier(InternalErrorException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidEmailRoleAccessPolicyException") .exceptionBuilderSupplier(InvalidEmailRoleAccessPolicyException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("PreconditionNotMetException") .exceptionBuilderSupplier(PreconditionNotMetException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("GroupExistsException") .exceptionBuilderSupplier(GroupExistsException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UserPoolTaggingException") .exceptionBuilderSupplier(UserPoolTaggingException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("EnableSoftwareTokenMFAException") .exceptionBuilderSupplier(EnableSoftwareTokenMfaException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UserPoolAddOnNotEnabledException") .exceptionBuilderSupplier(UserPoolAddOnNotEnabledException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidUserPoolConfigurationException") .exceptionBuilderSupplier(InvalidUserPoolConfigurationException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TooManyRequestsException") .exceptionBuilderSupplier(TooManyRequestsException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("CodeMismatchException") .exceptionBuilderSupplier(CodeMismatchException::builder).httpStatusCode(400).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 SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) { List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList()); if (plugins.isEmpty()) { return clientConfiguration; } SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder(); CognitoIdentityProviderServiceClientConfigurationBuilder serviceConfigBuilder = new CognitoIdentityProviderServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } return configuration.build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy