software.amazon.awssdk.services.cognitoidentityprovider.DefaultCognitoIdentityProviderClient Maven / Gradle / Ivy
Show all versions of cognitoidentityprovider Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.cognitoidentityprovider;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.awscore.retry.AwsRetryStrategy;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.retry.RetryMode;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.retries.api.RetryStrategy;
import software.amazon.awssdk.services.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.PasswordHistoryPolicyViolationException;
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.Logger;
/**
* Internal implementation of {@link CognitoIdentityProviderClient}.
*
* @see CognitoIdentityProviderClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultCognitoIdentityProviderClient implements CognitoIdentityProviderClient {
private static final Logger log = Logger.loggerFor(DefaultCognitoIdentityProviderClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.AWS_JSON).build();
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultCognitoIdentityProviderClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
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 Result of the AddCustomAttributes operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws 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.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AddCustomAttributes
* @see AWS API Documentation
*/
@Override
public AddCustomAttributesResponse addCustomAttributes(AddCustomAttributesRequest addCustomAttributesRequest)
throws ResourceNotFoundException, InvalidParameterException, TooManyRequestsException, NotAuthorizedException,
UserImportInProgressException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AddCustomAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AddCustomAttributes").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(addCustomAttributesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AddCustomAttributesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds a user to a group. A user who is in a group can present a preferred-role claim to an identity pool, and
* populates a cognito:groups
claim to their access and identity tokens.
*
*
*
* 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 Result of the AdminAddUserToGroup operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminAddUserToGroup
* @see AWS API Documentation
*/
@Override
public AdminAddUserToGroupResponse adminAddUserToGroup(AdminAddUserToGroupRequest adminAddUserToGroupRequest)
throws InvalidParameterException, ResourceNotFoundException, TooManyRequestsException, NotAuthorizedException,
UserNotFoundException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminAddUserToGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AdminAddUserToGroup").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminAddUserToGroupRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminAddUserToGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* This IAM-authenticated API operation confirms user sign-up as an administrator. Unlike ConfirmSignUp, your IAM credentials authorize user account confirmation. No confirmation code is required.
*
*
* This request sets a user account active in a user pool that requires confirmation of new user accounts before they can sign in. You can configure your user pool to not
* send confirmation codes to new users and instead confirm them with this API operation on the back end.
*
*
*
* 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 Result of the AdminConfirmSignUp operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws UnexpectedLambdaException
* This exception is thrown when Amazon Cognito encounters an unexpected exception with Lambda.
* @throws UserLambdaValidationException
* This exception is thrown when the Amazon Cognito service encounters a user validation exception with the
* Lambda service.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyFailedAttemptsException
* This exception is thrown when the user has made too many failed attempts for a given action, such as
* sign-in.
* @throws InvalidLambdaResponseException
* This exception is thrown when Amazon Cognito encounters an invalid Lambda response.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminConfirmSignUp
* @see AWS API Documentation
*/
@Override
public AdminConfirmSignUpResponse adminConfirmSignUp(AdminConfirmSignUpRequest adminConfirmSignUpRequest)
throws ResourceNotFoundException, InvalidParameterException, UnexpectedLambdaException,
UserLambdaValidationException, NotAuthorizedException, TooManyFailedAttemptsException,
InvalidLambdaResponseException, TooManyRequestsException, LimitExceededException, UserNotFoundException,
InternalErrorException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminConfirmSignUpResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AdminConfirmSignUp").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminConfirmSignUpRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminConfirmSignUpRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Services 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 Result of the AdminCreateUser operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws UsernameExistsException
* This exception is thrown when Amazon Cognito encounters a user name that already exists in the user pool.
* @throws InvalidPasswordException
* This exception is thrown when Amazon Cognito encounters an invalid password.
* @throws CodeDeliveryFailureException
* This exception is thrown when a verification code fails to deliver successfully.
* @throws UnexpectedLambdaException
* This exception is thrown when Amazon Cognito encounters an unexpected exception with Lambda.
* @throws UserLambdaValidationException
* This exception is thrown when the Amazon Cognito service encounters a user validation exception with the
* Lambda service.
* @throws InvalidLambdaResponseException
* This exception is thrown when Amazon Cognito encounters an invalid Lambda response.
* @throws PreconditionNotMetException
* This exception is thrown when a precondition is not met.
* @throws InvalidSmsRoleAccessPolicyException
* This exception is returned when the role provided for SMS configuration doesn't have permission to
* publish using Amazon SNS.
* @throws 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.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UnsupportedUserStateException
* The request failed because the user is in an unsupported state.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminCreateUser
* @see AWS
* API Documentation
*/
@Override
public AdminCreateUserResponse adminCreateUser(AdminCreateUserRequest adminCreateUserRequest)
throws ResourceNotFoundException, InvalidParameterException, UserNotFoundException, UsernameExistsException,
InvalidPasswordException, CodeDeliveryFailureException, UnexpectedLambdaException, UserLambdaValidationException,
InvalidLambdaResponseException, PreconditionNotMetException, InvalidSmsRoleAccessPolicyException,
InvalidSmsRoleTrustRelationshipException, TooManyRequestsException, NotAuthorizedException,
UnsupportedUserStateException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AdminCreateUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AdminCreateUser").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminCreateUserRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminCreateUserRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminDeleteUser operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminDeleteUser
* @see AWS
* API Documentation
*/
@Override
public AdminDeleteUserResponse adminDeleteUser(AdminDeleteUserRequest adminDeleteUserRequest)
throws ResourceNotFoundException, InvalidParameterException, TooManyRequestsException, NotAuthorizedException,
UserNotFoundException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AdminDeleteUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AdminDeleteUser").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminDeleteUserRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminDeleteUserRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminDeleteUserAttributes operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminDeleteUserAttributes
* @see AWS API Documentation
*/
@Override
public AdminDeleteUserAttributesResponse adminDeleteUserAttributes(
AdminDeleteUserAttributesRequest adminDeleteUserAttributesRequest) throws ResourceNotFoundException,
InvalidParameterException, TooManyRequestsException, NotAuthorizedException, UserNotFoundException,
InternalErrorException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminDeleteUserAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AdminDeleteUserAttributes").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminDeleteUserAttributesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminDeleteUserAttributesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminDisableProviderForUser operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws 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.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminDisableProviderForUser
* @see AWS API Documentation
*/
@Override
public AdminDisableProviderForUserResponse adminDisableProviderForUser(
AdminDisableProviderForUserRequest adminDisableProviderForUserRequest) throws ResourceNotFoundException,
InvalidParameterException, TooManyRequestsException, NotAuthorizedException, UserNotFoundException,
AliasExistsException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminDisableProviderForUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AdminDisableProviderForUser").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminDisableProviderForUserRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminDisableProviderForUserRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminDisableUser operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminDisableUser
* @see AWS
* API Documentation
*/
@Override
public AdminDisableUserResponse adminDisableUser(AdminDisableUserRequest adminDisableUserRequest)
throws ResourceNotFoundException, InvalidParameterException, TooManyRequestsException, NotAuthorizedException,
UserNotFoundException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AdminDisableUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AdminDisableUser").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminDisableUserRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminDisableUserRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminEnableUser operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminEnableUser
* @see AWS
* API Documentation
*/
@Override
public AdminEnableUserResponse adminEnableUser(AdminEnableUserRequest adminEnableUserRequest)
throws ResourceNotFoundException, InvalidParameterException, TooManyRequestsException, NotAuthorizedException,
UserNotFoundException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AdminEnableUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AdminEnableUser").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminEnableUserRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminEnableUserRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminForgetDevice operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws InvalidUserPoolConfigurationException
* This exception is thrown when the user pool configuration is not valid.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminForgetDevice
* @see AWS
* API Documentation
*/
@Override
public AdminForgetDeviceResponse adminForgetDevice(AdminForgetDeviceRequest adminForgetDeviceRequest)
throws ResourceNotFoundException, InvalidParameterException, InvalidUserPoolConfigurationException,
TooManyRequestsException, NotAuthorizedException, UserNotFoundException, InternalErrorException, AwsServiceException,
SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AdminForgetDeviceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AdminForgetDevice").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminForgetDeviceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminForgetDeviceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminGetDevice operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws InvalidUserPoolConfigurationException
* This exception is thrown when the user pool configuration is not valid.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminGetDevice
* @see AWS
* API Documentation
*/
@Override
public AdminGetDeviceResponse adminGetDevice(AdminGetDeviceRequest adminGetDeviceRequest) throws ResourceNotFoundException,
InvalidParameterException, InvalidUserPoolConfigurationException, TooManyRequestsException, InternalErrorException,
NotAuthorizedException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AdminGetDeviceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AdminGetDevice").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminGetDeviceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminGetDeviceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminGetUser operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminGetUser
* @see AWS API
* Documentation
*/
@Override
public AdminGetUserResponse adminGetUser(AdminGetUserRequest adminGetUserRequest) throws ResourceNotFoundException,
InvalidParameterException, TooManyRequestsException, NotAuthorizedException, UserNotFoundException,
InternalErrorException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AdminGetUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AdminGetUser").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminGetUserRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminGetUserRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Services 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 Result of the AdminInitiateAuth operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws UnexpectedLambdaException
* This exception is thrown when Amazon Cognito encounters an unexpected exception with Lambda.
* @throws InvalidUserPoolConfigurationException
* This exception is thrown when the user pool configuration is not valid.
* @throws UserLambdaValidationException
* This exception is thrown when the Amazon Cognito service encounters a user validation exception with the
* Lambda service.
* @throws InvalidLambdaResponseException
* This exception is thrown when Amazon Cognito encounters an invalid Lambda response.
* @throws MfaMethodNotFoundException
* This exception is thrown when Amazon Cognito can't find a multi-factor authentication (MFA) method.
* @throws InvalidSmsRoleAccessPolicyException
* This exception is returned when the role provided for SMS configuration doesn't have permission to
* publish using Amazon SNS.
* @throws 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.
* @throws PasswordResetRequiredException
* This exception is thrown when a password reset is required.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws UserNotConfirmedException
* This exception is thrown when a user isn't confirmed successfully.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminInitiateAuth
* @see AWS
* API Documentation
*/
@Override
public AdminInitiateAuthResponse adminInitiateAuth(AdminInitiateAuthRequest adminInitiateAuthRequest)
throws ResourceNotFoundException, InvalidParameterException, NotAuthorizedException, TooManyRequestsException,
InternalErrorException, UnexpectedLambdaException, InvalidUserPoolConfigurationException,
UserLambdaValidationException, InvalidLambdaResponseException, MfaMethodNotFoundException,
InvalidSmsRoleAccessPolicyException, InvalidSmsRoleTrustRelationshipException, PasswordResetRequiredException,
UserNotFoundException, UserNotConfirmedException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AdminInitiateAuthResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AdminInitiateAuth").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminInitiateAuthRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminInitiateAuthRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminLinkProviderForUser operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws 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.
* @throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminLinkProviderForUser
* @see AWS API Documentation
*/
@Override
public AdminLinkProviderForUserResponse adminLinkProviderForUser(
AdminLinkProviderForUserRequest adminLinkProviderForUserRequest) throws ResourceNotFoundException,
InvalidParameterException, TooManyRequestsException, NotAuthorizedException, UserNotFoundException,
AliasExistsException, LimitExceededException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminLinkProviderForUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AdminLinkProviderForUser").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminLinkProviderForUserRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminLinkProviderForUserRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminListDevices operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidUserPoolConfigurationException
* This exception is thrown when the user pool configuration is not valid.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminListDevices
* @see AWS
* API Documentation
*/
@Override
public AdminListDevicesResponse adminListDevices(AdminListDevicesRequest adminListDevicesRequest)
throws InvalidParameterException, ResourceNotFoundException, InvalidUserPoolConfigurationException,
TooManyRequestsException, InternalErrorException, NotAuthorizedException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AdminListDevicesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AdminListDevices").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminListDevicesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminListDevicesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the groups that a 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 Result of the AdminListGroupsForUser operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminListGroupsForUser
* @see AWS API Documentation
*/
@Override
public AdminListGroupsForUserResponse adminListGroupsForUser(AdminListGroupsForUserRequest adminListGroupsForUserRequest)
throws InvalidParameterException, ResourceNotFoundException, TooManyRequestsException, NotAuthorizedException,
UserNotFoundException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminListGroupsForUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AdminListGroupsForUser").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminListGroupsForUserRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminListGroupsForUserRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminListUserAuthEvents operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws UserPoolAddOnNotEnabledException
* This exception is thrown when user pool add-ons aren't enabled.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminListUserAuthEvents
* @see AWS API Documentation
*/
@Override
public AdminListUserAuthEventsResponse adminListUserAuthEvents(AdminListUserAuthEventsRequest adminListUserAuthEventsRequest)
throws InvalidParameterException, ResourceNotFoundException, TooManyRequestsException, NotAuthorizedException,
UserNotFoundException, UserPoolAddOnNotEnabledException, InternalErrorException, AwsServiceException,
SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminListUserAuthEventsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AdminListUserAuthEvents").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminListUserAuthEventsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminListUserAuthEventsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminRemoveUserFromGroup operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminRemoveUserFromGroup
* @see AWS API Documentation
*/
@Override
public AdminRemoveUserFromGroupResponse adminRemoveUserFromGroup(
AdminRemoveUserFromGroupRequest adminRemoveUserFromGroupRequest) throws InvalidParameterException,
ResourceNotFoundException, TooManyRequestsException, NotAuthorizedException, UserNotFoundException,
InternalErrorException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminRemoveUserFromGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AdminRemoveUserFromGroup").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminRemoveUserFromGroupRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminRemoveUserFromGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Resets the specified user's password in a user pool as an administrator. Works on any user.
*
*
* To use this API operation, your user pool must have self-service account recovery configured. Use AdminSetUserPassword if you manage passwords 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 Services 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 Result of the AdminResetUserPassword operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws UnexpectedLambdaException
* This exception is thrown when Amazon Cognito encounters an unexpected exception with Lambda.
* @throws UserLambdaValidationException
* This exception is thrown when the Amazon Cognito service encounters a user validation exception with the
* Lambda service.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws InvalidLambdaResponseException
* This exception is thrown when Amazon Cognito encounters an invalid Lambda response.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InvalidSmsRoleAccessPolicyException
* This exception is returned when the role provided for SMS configuration doesn't have permission to
* publish using Amazon SNS.
* @throws InvalidEmailRoleAccessPolicyException
* This exception is thrown when Amazon Cognito isn't allowed to use your email identity. HTTP status code:
* 400.
* @throws 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.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminResetUserPassword
* @see AWS API Documentation
*/
@Override
public AdminResetUserPasswordResponse adminResetUserPassword(AdminResetUserPasswordRequest adminResetUserPasswordRequest)
throws ResourceNotFoundException, InvalidParameterException, UnexpectedLambdaException,
UserLambdaValidationException, NotAuthorizedException, InvalidLambdaResponseException, TooManyRequestsException,
LimitExceededException, UserNotFoundException, InvalidSmsRoleAccessPolicyException,
InvalidEmailRoleAccessPolicyException, InvalidSmsRoleTrustRelationshipException, InternalErrorException,
AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminResetUserPasswordResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AdminResetUserPassword").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminResetUserPasswordRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminResetUserPasswordRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Some API operations in a user pool generate a challenge, like a prompt for an MFA code, for device authentication
* that bypasses MFA, or for a custom authentication challenge. An AdminRespondToAuthChallenge
API
* request provides the answer to that challenge, like a code or a secure remote password (SRP). The parameters of a
* response to an authentication challenge vary with the type of challenge.
*
*
* For more information about custom authentication challenges, see Custom
* authentication challenge Lambda triggers.
*
*
*
* 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 Services 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 Result of the AdminRespondToAuthChallenge operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws CodeMismatchException
* This exception is thrown if the provided code doesn't match what the server was expecting.
* @throws ExpiredCodeException
* This exception is thrown if a code has expired.
* @throws UnexpectedLambdaException
* This exception is thrown when Amazon Cognito encounters an unexpected exception with Lambda.
* @throws InvalidPasswordException
* This exception is thrown when Amazon Cognito encounters an invalid password.
* @throws PasswordHistoryPolicyViolationException
* The message returned when a user's new password matches a previous password and doesn't comply with the
* password-history policy.
* @throws UserLambdaValidationException
* This exception is thrown when the Amazon Cognito service encounters a user validation exception with the
* Lambda service.
* @throws InvalidLambdaResponseException
* This exception is thrown when Amazon Cognito encounters an invalid Lambda response.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws InvalidUserPoolConfigurationException
* This exception is thrown when the user pool configuration is not valid.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws MfaMethodNotFoundException
* This exception is thrown when Amazon Cognito can't find a multi-factor authentication (MFA) method.
* @throws InvalidSmsRoleAccessPolicyException
* This exception is returned when the role provided for SMS configuration doesn't have permission to
* publish using Amazon SNS.
* @throws 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.
* @throws 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.
* @throws PasswordResetRequiredException
* This exception is thrown when a password reset is required.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws UserNotConfirmedException
* This exception is thrown when a user isn't confirmed successfully.
* @throws 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.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminRespondToAuthChallenge
* @see AWS API Documentation
*/
@Override
public AdminRespondToAuthChallengeResponse adminRespondToAuthChallenge(
AdminRespondToAuthChallengeRequest adminRespondToAuthChallengeRequest) throws ResourceNotFoundException,
InvalidParameterException, NotAuthorizedException, CodeMismatchException, ExpiredCodeException,
UnexpectedLambdaException, InvalidPasswordException, PasswordHistoryPolicyViolationException,
UserLambdaValidationException, InvalidLambdaResponseException, TooManyRequestsException,
InvalidUserPoolConfigurationException, InternalErrorException, MfaMethodNotFoundException,
InvalidSmsRoleAccessPolicyException, InvalidSmsRoleTrustRelationshipException, AliasExistsException,
PasswordResetRequiredException, UserNotFoundException, UserNotConfirmedException, SoftwareTokenMfaNotFoundException,
AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminRespondToAuthChallengeResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AdminRespondToAuthChallenge").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminRespondToAuthChallengeRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminRespondToAuthChallengeRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminSetUserMFAPreference operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws PasswordResetRequiredException
* This exception is thrown when a password reset is required.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws UserNotConfirmedException
* This exception is thrown when a user isn't confirmed successfully.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminSetUserMFAPreference
* @see AWS API Documentation
*/
@Override
public AdminSetUserMfaPreferenceResponse adminSetUserMFAPreference(
AdminSetUserMfaPreferenceRequest adminSetUserMfaPreferenceRequest) throws ResourceNotFoundException,
InvalidParameterException, NotAuthorizedException, PasswordResetRequiredException, UserNotFoundException,
UserNotConfirmedException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminSetUserMfaPreferenceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AdminSetUserMFAPreference").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminSetUserMfaPreferenceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminSetUserMfaPreferenceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminSetUserPassword operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws InvalidPasswordException
* This exception is thrown when Amazon Cognito encounters an invalid password.
* @throws PasswordHistoryPolicyViolationException
* The message returned when a user's new password matches a previous password and doesn't comply with the
* password-history policy.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminSetUserPassword
* @see AWS API Documentation
*/
@Override
public AdminSetUserPasswordResponse adminSetUserPassword(AdminSetUserPasswordRequest adminSetUserPasswordRequest)
throws ResourceNotFoundException, NotAuthorizedException, UserNotFoundException, InternalErrorException,
TooManyRequestsException, InvalidParameterException, InvalidPasswordException,
PasswordHistoryPolicyViolationException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminSetUserPasswordResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AdminSetUserPassword").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminSetUserPasswordRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminSetUserPasswordRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminSetUserSettings operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminSetUserSettings
* @see AWS API Documentation
*/
@Override
public AdminSetUserSettingsResponse adminSetUserSettings(AdminSetUserSettingsRequest adminSetUserSettingsRequest)
throws ResourceNotFoundException, InvalidParameterException, NotAuthorizedException, UserNotFoundException,
InternalErrorException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminSetUserSettingsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AdminSetUserSettings").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminSetUserSettingsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminSetUserSettingsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminUpdateAuthEventFeedback operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws UserPoolAddOnNotEnabledException
* This exception is thrown when user pool add-ons aren't enabled.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminUpdateAuthEventFeedback
* @see AWS API Documentation
*/
@Override
public AdminUpdateAuthEventFeedbackResponse adminUpdateAuthEventFeedback(
AdminUpdateAuthEventFeedbackRequest adminUpdateAuthEventFeedbackRequest) throws InvalidParameterException,
ResourceNotFoundException, TooManyRequestsException, NotAuthorizedException, UserNotFoundException,
UserPoolAddOnNotEnabledException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminUpdateAuthEventFeedbackResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AdminUpdateAuthEventFeedback").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminUpdateAuthEventFeedbackRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminUpdateAuthEventFeedbackRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the AdminUpdateDeviceStatus operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidUserPoolConfigurationException
* This exception is thrown when the user pool configuration is not valid.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminUpdateDeviceStatus
* @see AWS API Documentation
*/
@Override
public AdminUpdateDeviceStatusResponse adminUpdateDeviceStatus(AdminUpdateDeviceStatusRequest adminUpdateDeviceStatusRequest)
throws InvalidParameterException, ResourceNotFoundException, InvalidUserPoolConfigurationException,
TooManyRequestsException, NotAuthorizedException, UserNotFoundException, InternalErrorException, AwsServiceException,
SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminUpdateDeviceStatusResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AdminUpdateDeviceStatus").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminUpdateDeviceStatusRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminUpdateDeviceStatusRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
*
* 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 Services 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 Result of the AdminUpdateUserAttributes operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws UnexpectedLambdaException
* This exception is thrown when Amazon Cognito encounters an unexpected exception with Lambda.
* @throws UserLambdaValidationException
* This exception is thrown when the Amazon Cognito service encounters a user validation exception with the
* Lambda service.
* @throws InvalidLambdaResponseException
* This exception is thrown when Amazon Cognito encounters an invalid Lambda response.
* @throws 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.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws InvalidSmsRoleAccessPolicyException
* This exception is returned when the role provided for SMS configuration doesn't have permission to
* publish using Amazon SNS.
* @throws InvalidEmailRoleAccessPolicyException
* This exception is thrown when Amazon Cognito isn't allowed to use your email identity. HTTP status code:
* 400.
* @throws 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.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminUpdateUserAttributes
* @see AWS API Documentation
*/
@Override
public AdminUpdateUserAttributesResponse adminUpdateUserAttributes(
AdminUpdateUserAttributesRequest adminUpdateUserAttributesRequest) throws ResourceNotFoundException,
InvalidParameterException, UnexpectedLambdaException, UserLambdaValidationException, InvalidLambdaResponseException,
AliasExistsException, TooManyRequestsException, NotAuthorizedException, UserNotFoundException,
InternalErrorException, InvalidSmsRoleAccessPolicyException, InvalidEmailRoleAccessPolicyException,
InvalidSmsRoleTrustRelationshipException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminUpdateUserAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AdminUpdateUserAttributes").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminUpdateUserAttributesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminUpdateUserAttributesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Invalidates the identity, access, and refresh tokens that Amazon Cognito issued to a user. Call this operation
* with your administrative credentials when your user signs out of your app. This results in the following
* behavior.
*
*
* -
*
* Amazon Cognito no longer accepts token-authorized user operations that you authorize with a signed-out
* user's access tokens. For more information, see Using the Amazon
* Cognito user pools API and user pool endpoints.
*
*
* Amazon Cognito returns an Access Token has been revoked
error when your app attempts to authorize a
* user pools API request with a revoked access token that contains the scope
* aws.cognito.signin.user.admin
.
*
*
* -
*
* Amazon Cognito no longer accepts a signed-out user's ID token in a GetId request to an
* identity pool with ServerSideTokenCheck
enabled for its user pool IdP configuration in CognitoIdentityProvider.
*
*
* -
*
* Amazon Cognito no longer accepts a signed-out user's refresh tokens in refresh requests.
*
*
*
*
* Other requests might be valid until your user's token expires.
*
*
*
* 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 Result of the AdminUserGlobalSignOut operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AdminUserGlobalSignOut
* @see AWS API Documentation
*/
@Override
public AdminUserGlobalSignOutResponse adminUserGlobalSignOut(AdminUserGlobalSignOutRequest adminUserGlobalSignOutRequest)
throws ResourceNotFoundException, InvalidParameterException, TooManyRequestsException, NotAuthorizedException,
UserNotFoundException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AdminUserGlobalSignOutResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AdminUserGlobalSignOut").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(adminUserGlobalSignOutRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AdminUserGlobalSignOutRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 in. 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 user pools API and user pool endpoints.
*
*
*
* @param associateSoftwareTokenRequest
* @return Result of the AssociateSoftwareToken operation returned by the service.
* @throws ConcurrentModificationException
* This exception is thrown if two or more modifications are happening concurrently.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws 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.
* @throws ForbiddenException
* This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with
* your user pool.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.AssociateSoftwareToken
* @see AWS API Documentation
*/
@Override
public AssociateSoftwareTokenResponse associateSoftwareToken(AssociateSoftwareTokenRequest associateSoftwareTokenRequest)
throws ConcurrentModificationException, InvalidParameterException, NotAuthorizedException, ResourceNotFoundException,
InternalErrorException, SoftwareTokenMfaNotFoundException, ForbiddenException, AwsServiceException,
SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AssociateSoftwareTokenResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AssociateSoftwareToken").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(associateSoftwareTokenRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AssociateSoftwareTokenRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Changes the password for a specified user in a user pool.
*
*
* Authorize this action with a signed-in user's access token. It must include the scope
* aws.cognito.signin.user.admin
.
*
*
*
* 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 user pools API and user pool endpoints.
*
*
*
* @param changePasswordRequest
* Represents the request to change a user password.
* @return Result of the ChangePassword operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws InvalidPasswordException
* This exception is thrown when Amazon Cognito encounters an invalid password.
* @throws PasswordHistoryPolicyViolationException
* The message returned when a user's new password matches a previous password and doesn't comply with the
* password-history policy.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.
* @throws PasswordResetRequiredException
* This exception is thrown when a password reset is required.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws UserNotConfirmedException
* This exception is thrown when a user isn't confirmed successfully.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws ForbiddenException
* This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with
* your user pool.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.ChangePassword
* @see AWS
* API Documentation
*/
@Override
public ChangePasswordResponse changePassword(ChangePasswordRequest changePasswordRequest) throws ResourceNotFoundException,
InvalidParameterException, InvalidPasswordException, PasswordHistoryPolicyViolationException, NotAuthorizedException,
TooManyRequestsException, LimitExceededException, PasswordResetRequiredException, UserNotFoundException,
UserNotConfirmedException, InternalErrorException, ForbiddenException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ChangePasswordResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ChangePassword").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(changePasswordRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ChangePasswordRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Confirms tracking of the device. This API call is the call that begins device tracking. For more information
* about device authentication, see Working with user devices in your user pool.
*
*
* Authorize this action with a signed-in user's access token. It must include the scope
* aws.cognito.signin.user.admin
.
*
*
*
* 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 user pools API and user pool endpoints.
*
*
*
* @param confirmDeviceRequest
* Confirms the device request.
* @return Result of the ConfirmDevice operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws InvalidPasswordException
* This exception is thrown when Amazon Cognito encounters an invalid password.
* @throws InvalidLambdaResponseException
* This exception is thrown when Amazon Cognito encounters an invalid Lambda response.
* @throws UsernameExistsException
* This exception is thrown when Amazon Cognito encounters a user name that already exists in the user pool.
* @throws InvalidUserPoolConfigurationException
* This exception is thrown when the user pool configuration is not valid.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws PasswordResetRequiredException
* This exception is thrown when a password reset is required.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws UserNotConfirmedException
* This exception is thrown when a user isn't confirmed successfully.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws ForbiddenException
* This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with
* your user pool.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.ConfirmDevice
* @see AWS API
* Documentation
*/
@Override
public ConfirmDeviceResponse confirmDevice(ConfirmDeviceRequest confirmDeviceRequest) throws ResourceNotFoundException,
InvalidParameterException, NotAuthorizedException, InvalidPasswordException, InvalidLambdaResponseException,
UsernameExistsException, InvalidUserPoolConfigurationException, TooManyRequestsException,
PasswordResetRequiredException, UserNotFoundException, UserNotConfirmedException, InternalErrorException,
ForbiddenException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ConfirmDeviceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ConfirmDevice").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(confirmDeviceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ConfirmDeviceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 user pools API and user pool endpoints.
*
*
*
* @param confirmForgotPasswordRequest
* The request representing the confirmation for a password reset.
* @return Result of the ConfirmForgotPassword operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws UnexpectedLambdaException
* This exception is thrown when Amazon Cognito encounters an unexpected exception with Lambda.
* @throws UserLambdaValidationException
* This exception is thrown when the Amazon Cognito service encounters a user validation exception with the
* Lambda service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws InvalidPasswordException
* This exception is thrown when Amazon Cognito encounters an invalid password.
* @throws PasswordHistoryPolicyViolationException
* The message returned when a user's new password matches a previous password and doesn't comply with the
* password-history policy.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws CodeMismatchException
* This exception is thrown if the provided code doesn't match what the server was expecting.
* @throws ExpiredCodeException
* This exception is thrown if a code has expired.
* @throws TooManyFailedAttemptsException
* This exception is thrown when the user has made too many failed attempts for a given action, such as
* sign-in.
* @throws InvalidLambdaResponseException
* This exception is thrown when Amazon Cognito encounters an invalid Lambda response.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws UserNotConfirmedException
* This exception is thrown when a user isn't confirmed successfully.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws ForbiddenException
* This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with
* your user pool.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.ConfirmForgotPassword
* @see AWS API Documentation
*/
@Override
public ConfirmForgotPasswordResponse confirmForgotPassword(ConfirmForgotPasswordRequest confirmForgotPasswordRequest)
throws ResourceNotFoundException, UnexpectedLambdaException, UserLambdaValidationException,
InvalidParameterException, InvalidPasswordException, PasswordHistoryPolicyViolationException, NotAuthorizedException,
CodeMismatchException, ExpiredCodeException, TooManyFailedAttemptsException, InvalidLambdaResponseException,
TooManyRequestsException, LimitExceededException, UserNotFoundException, UserNotConfirmedException,
InternalErrorException, ForbiddenException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ConfirmForgotPasswordResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ConfirmForgotPassword").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(confirmForgotPasswordRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ConfirmForgotPasswordRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* This public API operation provides a code that Amazon Cognito sent to your user when they signed up in your user
* pool via the SignUp API
* operation. After your user enters their code, they confirm ownership of the email address or phone number that
* they provided, and their user account becomes active. Depending on your user pool configuration, your users will
* receive their confirmation code in an email or SMS message.
*
*
* Local users who signed up in your user pool are the only type of user who can confirm sign-up with a code. Users
* who federate through an external identity provider (IdP) have already been confirmed by their IdP.
* Administrator-created users, users created with the AdminCreateUser API operation, confirm their accounts when they respond to their invitation email message
* and choose a password. They do not receive a confirmation code. Instead, they receive a temporary 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 user pools API and user pool endpoints.
*
*
*
* @param confirmSignUpRequest
* Represents the request to confirm registration of a user.
* @return Result of the ConfirmSignUp operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws UnexpectedLambdaException
* This exception is thrown when Amazon Cognito encounters an unexpected exception with Lambda.
* @throws UserLambdaValidationException
* This exception is thrown when the Amazon Cognito service encounters a user validation exception with the
* Lambda service.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyFailedAttemptsException
* This exception is thrown when the user has made too many failed attempts for a given action, such as
* sign-in.
* @throws CodeMismatchException
* This exception is thrown if the provided code doesn't match what the server was expecting.
* @throws ExpiredCodeException
* This exception is thrown if a code has expired.
* @throws InvalidLambdaResponseException
* This exception is thrown when Amazon Cognito encounters an invalid Lambda response.
* @throws 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.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws ForbiddenException
* This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with
* your user pool.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.ConfirmSignUp
* @see AWS API
* Documentation
*/
@Override
public ConfirmSignUpResponse confirmSignUp(ConfirmSignUpRequest confirmSignUpRequest) throws ResourceNotFoundException,
InvalidParameterException, UnexpectedLambdaException, UserLambdaValidationException, NotAuthorizedException,
TooManyFailedAttemptsException, CodeMismatchException, ExpiredCodeException, InvalidLambdaResponseException,
AliasExistsException, TooManyRequestsException, LimitExceededException, UserNotFoundException,
InternalErrorException, ForbiddenException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ConfirmSignUpResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ConfirmSignUp").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(confirmSignUpRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ConfirmSignUpRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CreateGroup operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws GroupExistsException
* This exception is thrown when Amazon Cognito encounters a group that already exists in the user pool.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.CreateGroup
* @see AWS API
* Documentation
*/
@Override
public CreateGroupResponse createGroup(CreateGroupRequest createGroupRequest) throws InvalidParameterException,
GroupExistsException, ResourceNotFoundException, TooManyRequestsException, LimitExceededException,
NotAuthorizedException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateGroup").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(createGroupRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds a configuration and trust relationship between a third-party identity provider (IdP) and 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 Result of the CreateIdentityProvider operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws DuplicateProviderException
* This exception is thrown when the provider is already supported by the user pool.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.CreateIdentityProvider
* @see AWS API Documentation
*/
@Override
public CreateIdentityProviderResponse createIdentityProvider(CreateIdentityProviderRequest createIdentityProviderRequest)
throws InvalidParameterException, DuplicateProviderException, ResourceNotFoundException, NotAuthorizedException,
TooManyRequestsException, LimitExceededException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateIdentityProviderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateIdentityProvider").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createIdentityProviderRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateIdentityProviderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CreateResourceServer operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.CreateResourceServer
* @see AWS API Documentation
*/
@Override
public CreateResourceServerResponse createResourceServer(CreateResourceServerRequest createResourceServerRequest)
throws InvalidParameterException, ResourceNotFoundException, NotAuthorizedException, TooManyRequestsException,
LimitExceededException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateResourceServerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateResourceServer").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createResourceServerRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateResourceServerRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CreateUserImportJob operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws PreconditionNotMetException
* This exception is thrown when a precondition is not met.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.CreateUserImportJob
* @see AWS API Documentation
*/
@Override
public CreateUserImportJobResponse createUserImportJob(CreateUserImportJobRequest createUserImportJobRequest)
throws ResourceNotFoundException, InvalidParameterException, TooManyRequestsException, PreconditionNotMetException,
NotAuthorizedException, LimitExceededException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateUserImportJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateUserImportJob").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createUserImportJobRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateUserImportJobRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
*
* 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 Services 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 Result of the CreateUserPool operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.
* @throws InvalidSmsRoleAccessPolicyException
* This exception is returned when the role provided for SMS configuration doesn't have permission to
* publish using Amazon SNS.
* @throws 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.
* @throws InvalidEmailRoleAccessPolicyException
* This exception is thrown when Amazon Cognito isn't allowed to use your email identity. HTTP status code:
* 400.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserPoolTaggingException
* This exception is thrown when a user pool tag can't be set or updated.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.CreateUserPool
* @see AWS
* API Documentation
*/
@Override
public CreateUserPoolResponse createUserPool(CreateUserPoolRequest createUserPoolRequest) throws InvalidParameterException,
TooManyRequestsException, LimitExceededException, InvalidSmsRoleAccessPolicyException,
InvalidSmsRoleTrustRelationshipException, InvalidEmailRoleAccessPolicyException, NotAuthorizedException,
UserPoolTaggingException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateUserPoolResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateUserPool").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createUserPoolRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateUserPoolRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CreateUserPoolClient operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws ScopeDoesNotExistException
* This exception is thrown when the specified scope doesn't exist.
* @throws InvalidOAuthFlowException
* This exception is thrown when the specified OAuth flow is not valid.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.CreateUserPoolClient
* @see AWS API Documentation
*/
@Override
public CreateUserPoolClientResponse createUserPoolClient(CreateUserPoolClientRequest createUserPoolClientRequest)
throws InvalidParameterException, ResourceNotFoundException, TooManyRequestsException, LimitExceededException,
NotAuthorizedException, ScopeDoesNotExistException, InvalidOAuthFlowException, InternalErrorException,
AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateUserPoolClientResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateUserPoolClient").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createUserPoolClientRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateUserPoolClientRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CreateUserPoolDomain operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.CreateUserPoolDomain
* @see AWS API Documentation
*/
@Override
public CreateUserPoolDomainResponse createUserPoolDomain(CreateUserPoolDomainRequest createUserPoolDomainRequest)
throws InvalidParameterException, NotAuthorizedException, ResourceNotFoundException, LimitExceededException,
InternalErrorException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateUserPoolDomainResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateUserPoolDomain").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createUserPoolDomainRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateUserPoolDomainRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a group.
*
*
* Calling this action requires developer credentials.
*
*
* @param deleteGroupRequest
* @return Result of the DeleteGroup operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DeleteGroup
* @see AWS API
* Documentation
*/
@Override
public DeleteGroupResponse deleteGroup(DeleteGroupRequest deleteGroupRequest) throws ResourceNotFoundException,
InvalidParameterException, TooManyRequestsException, NotAuthorizedException, InternalErrorException,
AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteGroup").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(deleteGroupRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes an IdP for a user pool.
*
*
* @param deleteIdentityProviderRequest
* @return Result of the DeleteIdentityProvider operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws UnsupportedIdentityProviderException
* This exception is thrown when the specified identifier isn't supported.
* @throws ConcurrentModificationException
* This exception is thrown if two or more modifications are happening concurrently.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DeleteIdentityProvider
* @see AWS API Documentation
*/
@Override
public DeleteIdentityProviderResponse deleteIdentityProvider(DeleteIdentityProviderRequest deleteIdentityProviderRequest)
throws InvalidParameterException, UnsupportedIdentityProviderException, ConcurrentModificationException,
ResourceNotFoundException, NotAuthorizedException, TooManyRequestsException, InternalErrorException,
AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteIdentityProviderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteIdentityProvider").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteIdentityProviderRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteIdentityProviderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a resource server.
*
*
* @param deleteResourceServerRequest
* @return Result of the DeleteResourceServer operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DeleteResourceServer
* @see AWS API Documentation
*/
@Override
public DeleteResourceServerResponse deleteResourceServer(DeleteResourceServerRequest deleteResourceServerRequest)
throws InvalidParameterException, ResourceNotFoundException, NotAuthorizedException, TooManyRequestsException,
InternalErrorException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteResourceServerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteResourceServer").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteResourceServerRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteResourceServerRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Allows a user to delete their own user profile.
*
*
* Authorize this action with a signed-in user's access token. It must include the scope
* aws.cognito.signin.user.admin
.
*
*
*
* 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 user pools API and user pool endpoints.
*
*
*
* @param deleteUserRequest
* Represents the request to delete a user.
* @return Result of the DeleteUser operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws PasswordResetRequiredException
* This exception is thrown when a password reset is required.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws UserNotConfirmedException
* This exception is thrown when a user isn't confirmed successfully.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws ForbiddenException
* This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with
* your user pool.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DeleteUser
* @see AWS API
* Documentation
*/
@Override
public DeleteUserResponse deleteUser(DeleteUserRequest deleteUserRequest) throws ResourceNotFoundException,
InvalidParameterException, NotAuthorizedException, TooManyRequestsException, PasswordResetRequiredException,
UserNotFoundException, UserNotConfirmedException, InternalErrorException, ForbiddenException, AwsServiceException,
SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteUser").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(deleteUserRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteUserRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the attributes for a user.
*
*
* Authorize this action with a signed-in user's access token. It must include the scope
* aws.cognito.signin.user.admin
.
*
*
*
* 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 user pools API and user pool endpoints.
*
*
*
* @param deleteUserAttributesRequest
* Represents the request to delete user attributes.
* @return Result of the DeleteUserAttributes operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws PasswordResetRequiredException
* This exception is thrown when a password reset is required.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws UserNotConfirmedException
* This exception is thrown when a user isn't confirmed successfully.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws ForbiddenException
* This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with
* your user pool.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DeleteUserAttributes
* @see AWS API Documentation
*/
@Override
public DeleteUserAttributesResponse deleteUserAttributes(DeleteUserAttributesRequest deleteUserAttributesRequest)
throws ResourceNotFoundException, InvalidParameterException, NotAuthorizedException, TooManyRequestsException,
PasswordResetRequiredException, UserNotFoundException, UserNotConfirmedException, InternalErrorException,
ForbiddenException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteUserAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteUserAttributes").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteUserAttributesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteUserAttributesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the specified Amazon Cognito user pool.
*
*
* @param deleteUserPoolRequest
* Represents the request to delete a user pool.
* @return Result of the DeleteUserPool operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws 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.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DeleteUserPool
* @see AWS
* API Documentation
*/
@Override
public DeleteUserPoolResponse deleteUserPool(DeleteUserPoolRequest deleteUserPoolRequest) throws ResourceNotFoundException,
InvalidParameterException, TooManyRequestsException, NotAuthorizedException, UserImportInProgressException,
InternalErrorException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteUserPoolResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteUserPool").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteUserPoolRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteUserPoolRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Allows the developer to delete the user pool client.
*
*
* @param deleteUserPoolClientRequest
* Represents the request to delete a user pool client.
* @return Result of the DeleteUserPoolClient operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws ConcurrentModificationException
* This exception is thrown if two or more modifications are happening concurrently.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DeleteUserPoolClient
* @see AWS API Documentation
*/
@Override
public DeleteUserPoolClientResponse deleteUserPoolClient(DeleteUserPoolClientRequest deleteUserPoolClientRequest)
throws ResourceNotFoundException, InvalidParameterException, TooManyRequestsException, NotAuthorizedException,
ConcurrentModificationException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteUserPoolClientResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteUserPoolClient").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteUserPoolClientRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteUserPoolClientRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a domain for a user pool.
*
*
* @param deleteUserPoolDomainRequest
* @return Result of the DeleteUserPoolDomain operation returned by the service.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DeleteUserPoolDomain
* @see AWS API Documentation
*/
@Override
public DeleteUserPoolDomainResponse deleteUserPoolDomain(DeleteUserPoolDomainRequest deleteUserPoolDomainRequest)
throws NotAuthorizedException, InvalidParameterException, ResourceNotFoundException, InternalErrorException,
AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteUserPoolDomainResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteUserPoolDomain").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteUserPoolDomainRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteUserPoolDomainRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets information about a specific IdP.
*
*
* @param describeIdentityProviderRequest
* @return Result of the DescribeIdentityProvider operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DescribeIdentityProvider
* @see AWS API Documentation
*/
@Override
public DescribeIdentityProviderResponse describeIdentityProvider(
DescribeIdentityProviderRequest describeIdentityProviderRequest) throws InvalidParameterException,
ResourceNotFoundException, NotAuthorizedException, TooManyRequestsException, InternalErrorException,
AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeIdentityProviderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeIdentityProvider").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeIdentityProviderRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeIdentityProviderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes a resource server.
*
*
* @param describeResourceServerRequest
* @return Result of the DescribeResourceServer operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DescribeResourceServer
* @see AWS API Documentation
*/
@Override
public DescribeResourceServerResponse describeResourceServer(DescribeResourceServerRequest describeResourceServerRequest)
throws InvalidParameterException, ResourceNotFoundException, NotAuthorizedException, TooManyRequestsException,
InternalErrorException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeResourceServerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeResourceServer").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeResourceServerRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeResourceServerRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes the risk configuration.
*
*
* @param describeRiskConfigurationRequest
* @return Result of the DescribeRiskConfiguration operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserPoolAddOnNotEnabledException
* This exception is thrown when user pool add-ons aren't enabled.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DescribeRiskConfiguration
* @see AWS API Documentation
*/
@Override
public DescribeRiskConfigurationResponse describeRiskConfiguration(
DescribeRiskConfigurationRequest describeRiskConfigurationRequest) throws ResourceNotFoundException,
InvalidParameterException, TooManyRequestsException, NotAuthorizedException, UserPoolAddOnNotEnabledException,
InternalErrorException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeRiskConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeRiskConfiguration").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeRiskConfigurationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeRiskConfigurationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes the user import job.
*
*
* @param describeUserImportJobRequest
* Represents the request to describe the user import job.
* @return Result of the DescribeUserImportJob operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DescribeUserImportJob
* @see AWS API Documentation
*/
@Override
public DescribeUserImportJobResponse describeUserImportJob(DescribeUserImportJobRequest describeUserImportJobRequest)
throws ResourceNotFoundException, InvalidParameterException, TooManyRequestsException, NotAuthorizedException,
InternalErrorException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeUserImportJobResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeUserImportJob").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeUserImportJobRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeUserImportJobRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DescribeUserPool operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws UserPoolTaggingException
* This exception is thrown when a user pool tag can't be set or updated.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DescribeUserPool
* @see AWS
* API Documentation
*/
@Override
public DescribeUserPoolResponse describeUserPool(DescribeUserPoolRequest describeUserPoolRequest)
throws ResourceNotFoundException, InvalidParameterException, TooManyRequestsException, NotAuthorizedException,
UserPoolTaggingException, InternalErrorException, AwsServiceException, SdkClientException,
CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeUserPoolResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeUserPool").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeUserPoolRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeUserPoolRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DescribeUserPoolClient operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DescribeUserPoolClient
* @see AWS API Documentation
*/
@Override
public DescribeUserPoolClientResponse describeUserPoolClient(DescribeUserPoolClientRequest describeUserPoolClientRequest)
throws ResourceNotFoundException, InvalidParameterException, TooManyRequestsException, NotAuthorizedException,
InternalErrorException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeUserPoolClientResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeUserPoolClient").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeUserPoolClientRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeUserPoolClientRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets information about a domain.
*
*
* @param describeUserPoolDomainRequest
* @return Result of the DescribeUserPoolDomain operation returned by the service.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.DescribeUserPoolDomain
* @see AWS API Documentation
*/
@Override
public DescribeUserPoolDomainResponse describeUserPoolDomain(DescribeUserPoolDomainRequest describeUserPoolDomainRequest)
throws NotAuthorizedException, InvalidParameterException, ResourceNotFoundException, InternalErrorException,
AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeUserPoolDomainResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeUserPoolDomain").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(describeUserPoolDomainRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeUserPoolDomainRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Forgets the specified device. For more information about device authentication, see Working with user devices in your user pool.
*
*
* Authorize this action with a signed-in user's access token. It must include the scope
* aws.cognito.signin.user.admin
.
*
*
*
* 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 user pools API and user pool endpoints.
*
*
*
* @param forgetDeviceRequest
* Represents the request to forget the device.
* @return Result of the ForgetDevice operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws InvalidUserPoolConfigurationException
* This exception is thrown when the user pool configuration is not valid.
* @throws PasswordResetRequiredException
* This exception is thrown when a password reset is required.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws UserNotConfirmedException
* This exception is thrown when a user isn't confirmed successfully.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws ForbiddenException
* This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with
* your user pool.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.ForgetDevice
* @see AWS API
* Documentation
*/
@Override
public ForgetDeviceResponse forgetDevice(ForgetDeviceRequest forgetDeviceRequest) throws ResourceNotFoundException,
InvalidParameterException, NotAuthorizedException, TooManyRequestsException, InvalidUserPoolConfigurationException,
PasswordResetRequiredException, UserNotFoundException, UserNotConfirmedException, InternalErrorException,
ForbiddenException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ForgetDeviceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ForgetDevice").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(forgetDeviceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ForgetDeviceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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
.
*
*
* To use this API operation, your user pool must have self-service account recovery configured. Use AdminSetUserPassword if you manage passwords as an administrator.
*
*
*
* 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 user pools API and user pool endpoints.
*
*
*
* 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 Services 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 Result of the ForgotPassword operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws UnexpectedLambdaException
* This exception is thrown when Amazon Cognito encounters an unexpected exception with Lambda.
* @throws UserLambdaValidationException
* This exception is thrown when the Amazon Cognito service encounters a user validation exception with the
* Lambda service.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws InvalidLambdaResponseException
* This exception is thrown when Amazon Cognito encounters an invalid Lambda response.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.
* @throws InvalidSmsRoleAccessPolicyException
* This exception is returned when the role provided for SMS configuration doesn't have permission to
* publish using Amazon SNS.
* @throws 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.
* @throws InvalidEmailRoleAccessPolicyException
* This exception is thrown when Amazon Cognito isn't allowed to use your email identity. HTTP status code:
* 400.
* @throws CodeDeliveryFailureException
* This exception is thrown when a verification code fails to deliver successfully.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws ForbiddenException
* This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with
* your user pool.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.ForgotPassword
* @see AWS
* API Documentation
*/
@Override
public ForgotPasswordResponse forgotPassword(ForgotPasswordRequest forgotPasswordRequest) throws ResourceNotFoundException,
InvalidParameterException, UnexpectedLambdaException, UserLambdaValidationException, NotAuthorizedException,
InvalidLambdaResponseException, TooManyRequestsException, LimitExceededException,
InvalidSmsRoleAccessPolicyException, InvalidSmsRoleTrustRelationshipException, InvalidEmailRoleAccessPolicyException,
CodeDeliveryFailureException, UserNotFoundException, InternalErrorException, ForbiddenException, AwsServiceException,
SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ForgotPasswordResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ForgotPassword").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(forgotPasswordRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ForgotPasswordRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the GetCSVHeader operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.GetCSVHeader
* @see AWS API
* Documentation
*/
@Override
public GetCsvHeaderResponse getCSVHeader(GetCsvHeaderRequest getCsvHeaderRequest) throws ResourceNotFoundException,
InvalidParameterException, TooManyRequestsException, NotAuthorizedException, InternalErrorException,
AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetCsvHeaderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetCSVHeader").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getCsvHeaderRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetCsvHeaderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets the device. For more information about device authentication, see Working with user devices in your user pool.
*
*
* Authorize this action with a signed-in user's access token. It must include the scope
* aws.cognito.signin.user.admin
.
*
*
*
* 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 user pools API and user pool endpoints.
*
*
*
* @param getDeviceRequest
* Represents the request to get the device.
* @return Result of the GetDevice operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws InvalidUserPoolConfigurationException
* This exception is thrown when the user pool configuration is not valid.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws PasswordResetRequiredException
* This exception is thrown when a password reset is required.
* @throws UserNotFoundException
* This exception is thrown when a user isn't found.
* @throws UserNotConfirmedException
* This exception is thrown when a user isn't confirmed successfully.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws ForbiddenException
* This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with
* your user pool.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.GetDevice
* @see AWS API
* Documentation
*/
@Override
public GetDeviceResponse getDevice(GetDeviceRequest getDeviceRequest) throws ResourceNotFoundException,
InvalidParameterException, InvalidUserPoolConfigurationException, NotAuthorizedException, TooManyRequestsException,
PasswordResetRequiredException, UserNotFoundException, UserNotConfirmedException, InternalErrorException,
ForbiddenException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetDeviceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetDevice").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(getDeviceRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetDeviceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets a group.
*
*
* Calling this action requires developer credentials.
*
*
* @param getGroupRequest
* @return Result of the GetGroup operation returned by the service.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.GetGroup
* @see AWS API
* Documentation
*/
@Override
public GetGroupResponse getGroup(GetGroupRequest getGroupRequest) throws ResourceNotFoundException,
InvalidParameterException, TooManyRequestsException, NotAuthorizedException, InternalErrorException,
AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetGroup").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(getGroupRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets the specified IdP.
*
*
* @param getIdentityProviderByIdentifierRequest
* @return Result of the GetIdentityProviderByIdentifier operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.GetIdentityProviderByIdentifier
* @see AWS API Documentation
*/
@Override
public GetIdentityProviderByIdentifierResponse getIdentityProviderByIdentifier(
GetIdentityProviderByIdentifierRequest getIdentityProviderByIdentifierRequest) throws InvalidParameterException,
ResourceNotFoundException, NotAuthorizedException, TooManyRequestsException, InternalErrorException,
AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetIdentityProviderByIdentifierResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetIdentityProviderByIdentifier").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getIdentityProviderByIdentifierRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetIdentityProviderByIdentifierRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets the logging configuration of a user pool.
*
*
* @param getLogDeliveryConfigurationRequest
* @return Result of the GetLogDeliveryConfiguration operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.GetLogDeliveryConfiguration
* @see AWS API Documentation
*/
@Override
public GetLogDeliveryConfigurationResponse getLogDeliveryConfiguration(
GetLogDeliveryConfigurationRequest getLogDeliveryConfigurationRequest) throws InvalidParameterException,
InternalErrorException, TooManyRequestsException, NotAuthorizedException, ResourceNotFoundException,
AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetLogDeliveryConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetLogDeliveryConfiguration").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getLogDeliveryConfigurationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetLogDeliveryConfigurationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the GetSigningCertificate operation returned by the service.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.GetSigningCertificate
* @see AWS API Documentation
*/
@Override
public GetSigningCertificateResponse getSigningCertificate(GetSigningCertificateRequest getSigningCertificateRequest)
throws InternalErrorException, InvalidParameterException, ResourceNotFoundException, AwsServiceException,
SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetSigningCertificateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetSigningCertificate").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getSigningCertificateRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetSigningCertificateRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the GetUICustomization operation returned by the service.
* @throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
* @throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service can't find the requested resource.
* @throws NotAuthorizedException
* This exception is thrown when a user isn't authorized.
* @throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation.
* @throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws CognitoIdentityProviderException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample CognitoIdentityProviderClient.GetUICustomization
* @see AWS API Documentation
*/
@Override
public GetUiCustomizationResponse getUICustomization(GetUiCustomizationRequest getUiCustomizationRequest)
throws InvalidParameterException, ResourceNotFoundException, NotAuthorizedException, TooManyRequestsException,
InternalErrorException, AwsServiceException, SdkClientException, CognitoIdentityProviderException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetUiCustomizationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getUiCustomizationRequest,
this.clientConfiguration);
List