/* * Copyright 2010-2022 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 com.amazonaws.services.cognitoidentityprovider; import java.util.*; import com.amazonaws.*; import com.amazonaws.auth.*; import com.amazonaws.handlers.*; import com.amazonaws.http.*; import com.amazonaws.internal.*; import com.amazonaws.metrics.*; import com.amazonaws.transform.*; import com.amazonaws.util.*; import com.amazonaws.util.AWSRequestMetrics.Field; import com.amazonaws.services.cognitoidentityprovider.model.*; import com.amazonaws.services.cognitoidentityprovider.model.transform.*; /** * Client for accessing Amazon Cognito Your User Pool. All service calls made * using this client are blocking, and will not return until the service call * completes. *

*

* Using the Amazon Cognito user pools API, you can create a user pool to manage * directories and users. You can authenticate a user to obtain tokens related * to user identity and access policies. *

*

* This API reference provides information about user pools in Amazon Cognito * user pools. *

*

* For more information, see the Amazon Cognito Documentation. *

*/ public class AmazonCognitoIdentityProviderClient extends AmazonWebServiceClient implements AmazonCognitoIdentityProvider { /** Provider for AWS credentials. */ private AWSCredentialsProvider awsCredentialsProvider; /** * List of exception unmarshallers for all Amazon Cognito Your User Pool * exceptions. */ protected List jsonErrorUnmarshallers; /** * Constructs a new client to invoke service methods on * AmazonCognitoIdentityProvider. A credentials provider chain will be used * that searches for credentials in this order: * *

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @see DefaultAWSCredentialsProviderChain */ @Deprecated public AmazonCognitoIdentityProviderClient() { this(new DefaultAWSCredentialsProviderChain(), new ClientConfiguration()); } /** * Constructs a new client to invoke service methods on * AmazonCognitoIdentityProvider. A credentials provider chain will be used * that searches for credentials in this order: *

*

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param clientConfiguration The client configuration options controlling * how this client connects to AmazonCognitoIdentityProvider (ex: * proxy settings, retry counts, etc.). * @see DefaultAWSCredentialsProviderChain */ @Deprecated public AmazonCognitoIdentityProviderClient(ClientConfiguration clientConfiguration) { this(new DefaultAWSCredentialsProviderChain(), clientConfiguration); } /** * Constructs a new client to invoke service methods on * AmazonCognitoIdentityProvider using the specified AWS account * credentials. *

* The client requests are authenticated using the {@link AWSCredentials} * provided in this constructor. Static AWSCredentials can be passed for * quick testing. However, it is strongly recommended to use Amazon Cognito * vended temporary credentials for use in production. This can be achieved * by using {@link AWSMobileClient}. Please see * https://aws-amplify.github.io/docs/android/authentication for * instructions on how to enable {@link AWSMobileClient}. * *

     * AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() {
     *     @Override
     *     public void onResult(final UserStateDetails details) {
     *         AmazonCognitoIdentityProviderClient client = new AmazonCognitoIdentityProviderClient(
     *                 AWSMobileClient.getInstance());
     *     }
     * 
     *     @Override
     *     public void onError(final Exception e) {
     *         e.printStackTrace();
     *     }
     * });
     * 
*

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentials The AWS credentials (access key ID and secret key) * to use when authenticating with AWS services. */ public AmazonCognitoIdentityProviderClient(AWSCredentials awsCredentials) { this(awsCredentials, new ClientConfiguration()); } /** * Constructs a new client to invoke service methods on * AmazonCognitoIdentityProvider using the specified AWS account credentials * and client configuration options. *

* The client requests are authenticated using the {@link AWSCredentials} * provided in this constructor. Static AWSCredentials can be passed for * quick testing. However, it is strongly recommended to use Amazon Cognito * vended temporary credentials for use in production. This can be achieved * by using {@link AWSMobileClient}. Please see * https://aws-amplify.github.io/docs/android/authentication for * instructions on how to enable {@link AWSMobileClient}. * *

     * AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() {
     *     @Override
     *     public void onResult(final UserStateDetails details) {
     *         AmazonCognitoIdentityProviderClient client = new AmazonCognitoIdentityProviderClient(
     *                 AWSMobileClient.getInstance());
     *     }
     * 
     *     @Override
     *     public void onError(final Exception e) {
     *         e.printStackTrace();
     *     }
     * });
     * 
*

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentials The AWS credentials (access key ID and secret key) * to use when authenticating with AWS services. * @param clientConfiguration The client configuration options controlling * how this client connects to AmazonCognitoIdentityProvider (ex: * proxy settings, retry counts, etc.). */ public AmazonCognitoIdentityProviderClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) { this(new StaticCredentialsProvider(awsCredentials), clientConfiguration); } /** * Constructs a new client to invoke service methods on * AmazonCognitoIdentityProvider using the specified AWS account credentials * provider. *

* The client requests are authenticated using the {@link AWSCredentials} * provided by the {@link AWSCredentialsProvider}. Static AWSCredentials can * be passed for quick testing. However, it is strongly recommended to use * Amazon Cognito vended temporary credentials for use in production. This * can be achieved by using {@link AWSMobileClient}. Please see * https://aws-amplify.github.io/docs/android/authentication for * instructions on how to enable {@link AWSMobileClient}. * *

     * AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() {
     *     @Override
     *     public void onResult(final UserStateDetails details) {
     *         AmazonCognitoIdentityProviderClient client = new AmazonCognitoIdentityProviderClient(
     *                 AWSMobileClient.getInstance());
     *     }
     * 
     *     @Override
     *     public void onError(final Exception e) {
     *         e.printStackTrace();
     *     }
     * });
     * 
*

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentialsProvider The AWS credentials provider which will * provide credentials to authenticate requests with AWS * services. */ public AmazonCognitoIdentityProviderClient(AWSCredentialsProvider awsCredentialsProvider) { this(awsCredentialsProvider, new ClientConfiguration()); } /** * Constructs a new client to invoke service methods on * AmazonCognitoIdentityProvider using the specified AWS account credentials * provider and client configuration options. *

* The client requests are authenticated using the {@link AWSCredentials} * provided by the {@link AWSCredentialsProvider}. Static AWSCredentials can * be passed for quick testing. However, it is strongly recommended to use * Amazon Cognito vended temporary credentials for use in production. This * can be achieved by using {@link AWSMobileClient}. Please see * https://aws-amplify.github.io/docs/android/authentication for * instructions on how to enable {@link AWSMobileClient}. * *

     * AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() {
     *     @Override
     *     public void onResult(final UserStateDetails details) {
     *         AmazonCognitoIdentityProviderClient client = new AmazonCognitoIdentityProviderClient(
     *                 AWSMobileClient.getInstance());
     *     }
     * 
     *     @Override
     *     public void onError(final Exception e) {
     *         e.printStackTrace();
     *     }
     * });
     * 
*

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentialsProvider The AWS credentials provider which will * provide credentials to authenticate requests with AWS * services. * @param clientConfiguration The client configuration options controlling * how this client connects to AmazonCognitoIdentityProvider (ex: * proxy settings, retry counts, etc.). */ public AmazonCognitoIdentityProviderClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) { this(awsCredentialsProvider, clientConfiguration, new UrlHttpClient(clientConfiguration)); } /** * Constructs a new client to invoke service methods on * AmazonCognitoIdentityProvider using the specified AWS account credentials * provider, client configuration options and request metric collector. *

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentialsProvider The AWS credentials provider which will * provide credentials to authenticate requests with AWS * services. * @param clientConfiguration The client configuration options controlling * how this client connects to AmazonCognitoIdentityProvider (ex: * proxy settings, retry counts, etc.). * @param requestMetricCollector optional request metric collector */ @Deprecated public AmazonCognitoIdentityProviderClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector) { super(adjustClientConfiguration(clientConfiguration), requestMetricCollector); this.awsCredentialsProvider = awsCredentialsProvider; init(); } /** * Constructs a new client to invoke service methods on * AmazonCognitoIdentityProvider using the specified AWS account credentials * provider, client configuration options and request metric collector. *

* The client requests are authenticated using the {@link AWSCredentials} * provided by the {@link AWSCredentialsProvider}. Static AWSCredentials can * be passed for quick testing. However, it is strongly recommended to use * Amazon Cognito vended temporary credentials for use in production. This * can be achieved by using {@link AWSMobileClient}. Please see * https://aws-amplify.github.io/docs/android/authentication for * instructions on how to enable {@link AWSMobileClient}. * *

     * AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() {
     *     @Override
     *     public void onResult(final UserStateDetails details) {
     *         AmazonCognitoIdentityProviderClient client = new AmazonCognitoIdentityProviderClient(
     *                 AWSMobileClient.getInstance());
     *     }
     * 
     *     @Override
     *     public void onError(final Exception e) {
     *         e.printStackTrace();
     *     }
     * });
     * 
*

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentialsProvider The AWS credentials provider which will * provide credentials to authenticate requests with AWS * services. * @param clientConfiguration The client configuration options controlling * how this client connects to AmazonCognitoIdentityProvider (ex: * proxy settings, retry counts, etc.). * @param httpClient A http client */ public AmazonCognitoIdentityProviderClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, HttpClient httpClient) { super(adjustClientConfiguration(clientConfiguration), httpClient); this.awsCredentialsProvider = awsCredentialsProvider; init(); } private void init() { jsonErrorUnmarshallers = new ArrayList(); jsonErrorUnmarshallers.add(new AliasExistsExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new CodeDeliveryFailureExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new CodeMismatchExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new ConcurrentModificationExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new DuplicateProviderExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new EnableSoftwareTokenMFAExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new ExpiredCodeExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new ForbiddenExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new GroupExistsExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InternalErrorExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InvalidEmailRoleAccessPolicyExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InvalidLambdaResponseExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InvalidOAuthFlowExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InvalidParameterExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InvalidPasswordExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InvalidSmsRoleAccessPolicyExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InvalidSmsRoleTrustRelationshipExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InvalidUserPoolConfigurationExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new LimitExceededExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new MFAMethodNotFoundExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new NotAuthorizedExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new PasswordResetRequiredExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new PreconditionNotMetExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new ResourceNotFoundExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new ScopeDoesNotExistExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new SoftwareTokenMFANotFoundExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new TooManyFailedAttemptsExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new TooManyRequestsExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UnauthorizedExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UnexpectedLambdaExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UnsupportedIdentityProviderExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UnsupportedOperationExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UnsupportedTokenTypeExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UnsupportedUserStateExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UserImportInProgressExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UserLambdaValidationExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UserNotConfirmedExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UserNotFoundExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UserPoolAddOnNotEnabledExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UserPoolTaggingExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UsernameExistsExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new JsonErrorUnmarshaller()); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("cognito-idp.us-east-1.amazonaws.com"); this.endpointPrefix = "cognito-idp"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( "/com/amazonaws/services/cognitoidentityprovider/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain( "/com/amazonaws/services/cognitoidentityprovider/request.handler2s")); } private static ClientConfiguration adjustClientConfiguration(ClientConfiguration orig) { ClientConfiguration config = orig; return config; } /** *

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

* * @param addCustomAttributesRequest

* Represents the request to add custom attributes. *

* @return addCustomAttributesResult The response from the * AddCustomAttributes service method, as returned by Amazon Cognito * Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserImportInProgressException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AddCustomAttributesResult addCustomAttributes( AddCustomAttributesRequest addCustomAttributesRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(addCustomAttributesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AddCustomAttributesRequestMarshaller() .marshall(addCustomAttributesRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AddCustomAttributesResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Adds the specified user to the specified group. *

*

* Calling this action requires developer credentials. *

* * @param adminAddUserToGroupRequest * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public void adminAddUserToGroup(AdminAddUserToGroupRequest adminAddUserToGroupRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminAddUserToGroupRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminAddUserToGroupRequestMarshaller() .marshall(adminAddUserToGroupRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } JsonResponseHandler responseHandler = new JsonResponseHandler(null); invoke(request, responseHandler, executionContext); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

*

* Calling this action requires developer credentials. *

* * @param adminConfirmSignUpRequest

* Represents the request to confirm user registration. *

* @return adminConfirmSignUpResult The response from the AdminConfirmSignUp * service method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @throws UserLambdaValidationException * @throws NotAuthorizedException * @throws TooManyFailedAttemptsException * @throws InvalidLambdaResponseException * @throws TooManyRequestsException * @throws LimitExceededException * @throws UserNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminConfirmSignUpResult adminConfirmSignUp( AdminConfirmSignUpRequest adminConfirmSignUpRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminConfirmSignUpRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminConfirmSignUpRequestMarshaller() .marshall(adminConfirmSignUpRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminConfirmSignUpResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Creates a new user in the specified user pool. *

*

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

* *

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

*

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

*
*

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

*

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

*

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

*

* AdminCreateUser requires developer credentials. *

* * @param adminCreateUserRequest

* Represents the request to create a user in the specified user * pool. *

* @return adminCreateUserResult The response from the AdminCreateUser * service method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UserNotFoundException * @throws UsernameExistsException * @throws InvalidPasswordException * @throws CodeDeliveryFailureException * @throws UnexpectedLambdaException * @throws UserLambdaValidationException * @throws InvalidLambdaResponseException * @throws PreconditionNotMetException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UnsupportedUserStateException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminCreateUserResult adminCreateUser(AdminCreateUserRequest adminCreateUserRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminCreateUserRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminCreateUserRequestMarshaller().marshall(adminCreateUserRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminCreateUserResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Deletes a user as an administrator. Works on any user. *

*

* Calling this action requires developer credentials. *

* * @param adminDeleteUserRequest

* Represents the request to delete a user as an administrator. *

* @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public void adminDeleteUser(AdminDeleteUserRequest adminDeleteUserRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminDeleteUserRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminDeleteUserRequestMarshaller().marshall(adminDeleteUserRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } JsonResponseHandler responseHandler = new JsonResponseHandler(null); invoke(request, responseHandler, executionContext); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Deletes the user attributes in a user pool as an administrator. Works on * any user. *

*

* Calling this action requires developer credentials. *

* * @param adminDeleteUserAttributesRequest

* Represents the request to delete user attributes as an * administrator. *

* @return adminDeleteUserAttributesResult The response from the * AdminDeleteUserAttributes service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminDeleteUserAttributesResult adminDeleteUserAttributes( AdminDeleteUserAttributesRequest adminDeleteUserAttributesRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminDeleteUserAttributesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminDeleteUserAttributesRequestMarshaller() .marshall(adminDeleteUserAttributesRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminDeleteUserAttributesResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* 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. *

*

* This action is enabled only for admin access and requires developer * credentials. *

*

* 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. *

* * @param adminDisableProviderForUserRequest * @return adminDisableProviderForUserResult The response from the * AdminDisableProviderForUser service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws AliasExistsException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminDisableProviderForUserResult adminDisableProviderForUser( AdminDisableProviderForUserRequest adminDisableProviderForUserRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminDisableProviderForUserRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminDisableProviderForUserRequestMarshaller() .marshall(adminDisableProviderForUserRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminDisableProviderForUserResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* 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. *

*

* You must make this API request with Amazon Web Services credentials that * have cognito-idp:AdminDisableUser permissions. *

* * @param adminDisableUserRequest

* Represents the request to disable the user as an * administrator. *

* @return adminDisableUserResult The response from the AdminDisableUser * service method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminDisableUserResult adminDisableUser(AdminDisableUserRequest adminDisableUserRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminDisableUserRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminDisableUserRequestMarshaller().marshall(adminDisableUserRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminDisableUserResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Enables the specified user as an administrator. Works on any user. *

*

* Calling this action requires developer credentials. *

* * @param adminEnableUserRequest

* Represents the request that enables the user as an * administrator. *

* @return adminEnableUserResult The response from the AdminEnableUser * service method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminEnableUserResult adminEnableUser(AdminEnableUserRequest adminEnableUserRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminEnableUserRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminEnableUserRequestMarshaller().marshall(adminEnableUserRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminEnableUserResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Forgets the device, as an administrator. *

*

* Calling this action requires developer credentials. *

* * @param adminForgetDeviceRequest

* Sends the forgot device request, as an administrator. *

* @throws ResourceNotFoundException * @throws InvalidParameterException * @throws InvalidUserPoolConfigurationException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public void adminForgetDevice(AdminForgetDeviceRequest adminForgetDeviceRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminForgetDeviceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminForgetDeviceRequestMarshaller() .marshall(adminForgetDeviceRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } JsonResponseHandler responseHandler = new JsonResponseHandler(null); invoke(request, responseHandler, executionContext); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Gets the device, as an administrator. *

*

* Calling this action requires developer credentials. *

* * @param adminGetDeviceRequest

* Represents the request to get the device, as an administrator. *

* @return adminGetDeviceResult The response from the AdminGetDevice service * method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws InvalidUserPoolConfigurationException * @throws TooManyRequestsException * @throws InternalErrorException * @throws NotAuthorizedException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminGetDeviceResult adminGetDevice(AdminGetDeviceRequest adminGetDeviceRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminGetDeviceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminGetDeviceRequestMarshaller().marshall(adminGetDeviceRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminGetDeviceResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

*

* Calling this action requires developer credentials. *

* * @param adminGetUserRequest

* Represents the request to get the specified user as an * administrator. *

* @return adminGetUserResult The response from the AdminGetUser service * method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminGetUserResult adminGetUser(AdminGetUserRequest adminGetUserRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminGetUserRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminGetUserRequestMarshaller().marshall(adminGetUserRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminGetUserResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Initiates the authentication flow, as an administrator. *

* *

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

*

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

*
*

* Calling this action requires developer credentials. *

* * @param adminInitiateAuthRequest

* Initiates the authorization request, as an administrator. *

* @return adminInitiateAuthResult The response from the AdminInitiateAuth * service method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InternalErrorException * @throws UnexpectedLambdaException * @throws InvalidUserPoolConfigurationException * @throws UserLambdaValidationException * @throws InvalidLambdaResponseException * @throws MFAMethodNotFoundException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminInitiateAuthResult adminInitiateAuth( AdminInitiateAuthRequest adminInitiateAuthRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminInitiateAuthRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminInitiateAuthRequestMarshaller() .marshall(adminInitiateAuthRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminInitiateAuthResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* 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. *

*
*

* This action is administrative and requires developer credentials. *

* * @param adminLinkProviderForUserRequest * @return adminLinkProviderForUserResult The response from the * AdminLinkProviderForUser service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws AliasExistsException * @throws LimitExceededException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminLinkProviderForUserResult adminLinkProviderForUser( AdminLinkProviderForUserRequest adminLinkProviderForUserRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminLinkProviderForUserRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminLinkProviderForUserRequestMarshaller() .marshall(adminLinkProviderForUserRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminLinkProviderForUserResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Lists devices, as an administrator. *

*

* Calling this action requires developer credentials. *

* * @param adminListDevicesRequest

* Represents the request to list devices, as an administrator. *

* @return adminListDevicesResult The response from the AdminListDevices * service method, as returned by Amazon Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws InvalidUserPoolConfigurationException * @throws TooManyRequestsException * @throws InternalErrorException * @throws NotAuthorizedException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminListDevicesResult adminListDevices(AdminListDevicesRequest adminListDevicesRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminListDevicesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminListDevicesRequestMarshaller().marshall(adminListDevicesRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminListDevicesResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Lists the groups that the user belongs to. *

*

* Calling this action requires developer credentials. *

* * @param adminListGroupsForUserRequest * @return adminListGroupsForUserResult The response from the * AdminListGroupsForUser service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminListGroupsForUserResult adminListGroupsForUser( AdminListGroupsForUserRequest adminListGroupsForUserRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminListGroupsForUserRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminListGroupsForUserRequestMarshaller() .marshall(adminListGroupsForUserRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminListGroupsForUserResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param adminListUserAuthEventsRequest * @return adminListUserAuthEventsResult The response from the * AdminListUserAuthEvents service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws UserPoolAddOnNotEnabledException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminListUserAuthEventsResult adminListUserAuthEvents( AdminListUserAuthEventsRequest adminListUserAuthEventsRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminListUserAuthEventsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminListUserAuthEventsRequestMarshaller() .marshall(adminListUserAuthEventsRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminListUserAuthEventsResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Removes the specified user from the specified group. *

*

* Calling this action requires developer credentials. *

* * @param adminRemoveUserFromGroupRequest * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public void adminRemoveUserFromGroup( AdminRemoveUserFromGroupRequest adminRemoveUserFromGroupRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminRemoveUserFromGroupRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminRemoveUserFromGroupRequestMarshaller() .marshall(adminRemoveUserFromGroupRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } JsonResponseHandler responseHandler = new JsonResponseHandler(null); invoke(request, responseHandler, executionContext); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

*

* When a developer calls this API, the current password is invalidated, so * it must be changed. If a user tries to sign in after the API is called, * the app will get a PasswordResetRequiredException exception back and * should direct the user down the flow to reset the password, which is the * same as 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. *

* *

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

*

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

*
*

* Calling this action requires developer credentials. *

* * @param adminResetUserPasswordRequest

* Represents the request to reset a user's password as an * administrator. *

* @return adminResetUserPasswordResult The response from the * AdminResetUserPassword service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @throws UserLambdaValidationException * @throws NotAuthorizedException * @throws InvalidLambdaResponseException * @throws TooManyRequestsException * @throws LimitExceededException * @throws UserNotFoundException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidEmailRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminResetUserPasswordResult adminResetUserPassword( AdminResetUserPasswordRequest adminResetUserPasswordRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminResetUserPasswordRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminResetUserPasswordRequestMarshaller() .marshall(adminResetUserPasswordRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminResetUserPasswordResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* *

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

*

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

*
*

* Calling this action requires developer credentials. *

* * @param adminRespondToAuthChallengeRequest

* The request to respond to the authentication challenge, as an * administrator. *

* @return adminRespondToAuthChallengeResult The response from the * AdminRespondToAuthChallenge service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws CodeMismatchException * @throws ExpiredCodeException * @throws UnexpectedLambdaException * @throws InvalidPasswordException * @throws UserLambdaValidationException * @throws InvalidLambdaResponseException * @throws TooManyRequestsException * @throws InvalidUserPoolConfigurationException * @throws InternalErrorException * @throws MFAMethodNotFoundException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws AliasExistsException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws SoftwareTokenMFANotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminRespondToAuthChallengeResult adminRespondToAuthChallenge( AdminRespondToAuthChallengeRequest adminRespondToAuthChallengeRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminRespondToAuthChallengeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminRespondToAuthChallengeRequestMarshaller() .marshall(adminRespondToAuthChallengeRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminRespondToAuthChallengeResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* 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. *

* * @param adminSetUserMFAPreferenceRequest * @return adminSetUserMFAPreferenceResult The response from the * AdminSetUserMFAPreference service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminSetUserMFAPreferenceResult adminSetUserMFAPreference( AdminSetUserMFAPreferenceRequest adminSetUserMFAPreferenceRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminSetUserMFAPreferenceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminSetUserMFAPreferenceRequestMarshaller() .marshall(adminSetUserMFAPreferenceRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminSetUserMFAPreferenceResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* 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. *

* * @param adminSetUserPasswordRequest * @return adminSetUserPasswordResult The response from the * AdminSetUserPassword service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws InternalErrorException * @throws TooManyRequestsException * @throws InvalidParameterException * @throws InvalidPasswordException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminSetUserPasswordResult adminSetUserPassword( AdminSetUserPasswordRequest adminSetUserPasswordRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminSetUserPasswordRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminSetUserPasswordRequestMarshaller() .marshall(adminSetUserPasswordRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminSetUserPasswordResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* 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. *

* * @param adminSetUserSettingsRequest

* You can use this parameter to set an MFA configuration that * uses the SMS delivery medium. *

* @return adminSetUserSettingsResult The response from the * AdminSetUserSettings service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminSetUserSettingsResult adminSetUserSettings( AdminSetUserSettingsRequest adminSetUserSettingsRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminSetUserSettingsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminSetUserSettingsRequestMarshaller() .marshall(adminSetUserSettingsRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminSetUserSettingsResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* 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. *

* * @param adminUpdateAuthEventFeedbackRequest * @return adminUpdateAuthEventFeedbackResult The response from the * AdminUpdateAuthEventFeedback service method, as returned by * Amazon Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws UserPoolAddOnNotEnabledException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminUpdateAuthEventFeedbackResult adminUpdateAuthEventFeedback( AdminUpdateAuthEventFeedbackRequest adminUpdateAuthEventFeedbackRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminUpdateAuthEventFeedbackRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminUpdateAuthEventFeedbackRequestMarshaller() .marshall(adminUpdateAuthEventFeedbackRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminUpdateAuthEventFeedbackResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Updates the device status as an administrator. *

*

* Calling this action requires developer credentials. *

* * @param adminUpdateDeviceStatusRequest

* The request to update the device status, as an administrator. *

* @return adminUpdateDeviceStatusResult The response from the * AdminUpdateDeviceStatus service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws InvalidUserPoolConfigurationException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminUpdateDeviceStatusResult adminUpdateDeviceStatus( AdminUpdateDeviceStatusRequest adminUpdateDeviceStatusRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminUpdateDeviceStatusRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminUpdateDeviceStatusRequestMarshaller() .marshall(adminUpdateDeviceStatusRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminUpdateDeviceStatusResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Updates the specified user's attributes, including developer attributes, * as an administrator. Works on any user. *

*

* 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. *

* *

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

*

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

*
*

* Calling this action requires developer credentials. *

* * @param adminUpdateUserAttributesRequest

* Represents the request to update the user's attributes as an * administrator. *

* @return adminUpdateUserAttributesResult The response from the * AdminUpdateUserAttributes service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @throws UserLambdaValidationException * @throws InvalidLambdaResponseException * @throws AliasExistsException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws InternalErrorException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidEmailRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminUpdateUserAttributesResult adminUpdateUserAttributes( AdminUpdateUserAttributesRequest adminUpdateUserAttributesRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminUpdateUserAttributesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminUpdateUserAttributesRequestMarshaller() .marshall(adminUpdateUserAttributesRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminUpdateUserAttributesResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Signs out a user from all devices. You must sign * AdminUserGlobalSignOut requests with Amazon Web Services * credentials. It also invalidates all refresh tokens that Amazon Cognito * has issued to a user. The user's current access and ID tokens remain * valid until they expire. By default, access and ID tokens expire one hour * after they're issued. A user can still use a hosted UI cookie to retrieve * new tokens for the duration of the cookie validity period of 1 hour. *

*

* Calling this action requires developer credentials. *

* * @param adminUserGlobalSignOutRequest

* The request to sign out of all devices, as an administrator. *

* @return adminUserGlobalSignOutResult The response from the * AdminUserGlobalSignOut service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AdminUserGlobalSignOutResult adminUserGlobalSignOut( AdminUserGlobalSignOutRequest adminUserGlobalSignOutRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(adminUserGlobalSignOutRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AdminUserGlobalSignOutRequestMarshaller() .marshall(adminUserGlobalSignOutRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AdminUserGlobalSignOutResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* *

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

*

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

*
* * @param associateSoftwareTokenRequest * @return associateSoftwareTokenResult The response from the * AssociateSoftwareToken service method, as returned by Amazon * Cognito Your User Pool. * @throws ConcurrentModificationException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws ResourceNotFoundException * @throws InternalErrorException * @throws SoftwareTokenMFANotFoundException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public AssociateSoftwareTokenResult associateSoftwareToken( AssociateSoftwareTokenRequest associateSoftwareTokenRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(associateSoftwareTokenRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AssociateSoftwareTokenRequestMarshaller() .marshall(associateSoftwareTokenRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AssociateSoftwareTokenResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Changes the password for a specified user in a user pool. *

* * @param changePasswordRequest

* Represents the request to change a user password. *

* @return changePasswordResult The response from the ChangePassword service * method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws InvalidPasswordException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws LimitExceededException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ChangePasswordResult changePassword(ChangePasswordRequest changePasswordRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(changePasswordRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ChangePasswordRequestMarshaller().marshall(changePasswordRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ChangePasswordResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param confirmDeviceRequest

* Confirms the device request. *

* @return confirmDeviceResult The response from the ConfirmDevice service * method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws InvalidPasswordException * @throws InvalidLambdaResponseException * @throws UsernameExistsException * @throws InvalidUserPoolConfigurationException * @throws TooManyRequestsException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ConfirmDeviceResult confirmDevice(ConfirmDeviceRequest confirmDeviceRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(confirmDeviceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ConfirmDeviceRequestMarshaller().marshall(confirmDeviceRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ConfirmDeviceResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param confirmForgotPasswordRequest

* The request representing the confirmation for a password * reset. *

* @return confirmForgotPasswordResult The response from the * ConfirmForgotPassword service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws UnexpectedLambdaException * @throws UserLambdaValidationException * @throws InvalidParameterException * @throws InvalidPasswordException * @throws NotAuthorizedException * @throws CodeMismatchException * @throws ExpiredCodeException * @throws TooManyFailedAttemptsException * @throws InvalidLambdaResponseException * @throws TooManyRequestsException * @throws LimitExceededException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ConfirmForgotPasswordResult confirmForgotPassword( ConfirmForgotPasswordRequest confirmForgotPasswordRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(confirmForgotPasswordRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ConfirmForgotPasswordRequestMarshaller() .marshall(confirmForgotPasswordRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ConfirmForgotPasswordResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Confirms registration of a new user. *

* * @param confirmSignUpRequest

* Represents the request to confirm registration of a user. *

* @return confirmSignUpResult The response from the ConfirmSignUp service * method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @throws UserLambdaValidationException * @throws NotAuthorizedException * @throws TooManyFailedAttemptsException * @throws CodeMismatchException * @throws ExpiredCodeException * @throws InvalidLambdaResponseException * @throws AliasExistsException * @throws TooManyRequestsException * @throws LimitExceededException * @throws UserNotFoundException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ConfirmSignUpResult confirmSignUp(ConfirmSignUpRequest confirmSignUpRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(confirmSignUpRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ConfirmSignUpRequestMarshaller().marshall(confirmSignUpRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ConfirmSignUpResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Creates a new group in the specified user pool. *

*

* Calling this action requires developer credentials. *

* * @param createGroupRequest * @return createGroupResult The response from the CreateGroup service * method, as returned by Amazon Cognito Your User Pool. * @throws InvalidParameterException * @throws GroupExistsException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @throws LimitExceededException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public CreateGroupResult createGroup(CreateGroupRequest createGroupRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(createGroupRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateGroupRequestMarshaller().marshall(createGroupRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new CreateGroupResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Creates an IdP for a user pool. *

* * @param createIdentityProviderRequest * @return createIdentityProviderResult The response from the * CreateIdentityProvider service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws DuplicateProviderException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws LimitExceededException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public CreateIdentityProviderResult createIdentityProvider( CreateIdentityProviderRequest createIdentityProviderRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(createIdentityProviderRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateIdentityProviderRequestMarshaller() .marshall(createIdentityProviderRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new CreateIdentityProviderResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Creates a new OAuth2.0 resource server and defines custom scopes within * it. *

* * @param createResourceServerRequest * @return createResourceServerResult The response from the * CreateResourceServer service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws LimitExceededException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public CreateResourceServerResult createResourceServer( CreateResourceServerRequest createResourceServerRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(createResourceServerRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateResourceServerRequestMarshaller() .marshall(createResourceServerRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new CreateResourceServerResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Creates the user import job. *

* * @param createUserImportJobRequest

* Represents the request to create the user import job. *

* @return createUserImportJobResult The response from the * CreateUserImportJob service method, as returned by Amazon Cognito * Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws PreconditionNotMetException * @throws NotAuthorizedException * @throws LimitExceededException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public CreateUserImportJobResult createUserImportJob( CreateUserImportJobRequest createUserImportJobRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(createUserImportJobRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateUserImportJobRequestMarshaller() .marshall(createUserImportJobRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new CreateUserImportJobResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* *

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

*

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

*
* * @param createUserPoolRequest

* Represents the request to create a user pool. *

* @return createUserPoolResult The response from the CreateUserPool service * method, as returned by Amazon Cognito Your User Pool. * @throws InvalidParameterException * @throws TooManyRequestsException * @throws LimitExceededException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws InvalidEmailRoleAccessPolicyException * @throws NotAuthorizedException * @throws UserPoolTaggingException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public CreateUserPoolResult createUserPool(CreateUserPoolRequest createUserPoolRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(createUserPoolRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateUserPoolRequestMarshaller().marshall(createUserPoolRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new CreateUserPoolResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* 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. *

* * @param createUserPoolClientRequest

* Represents the request to create a user pool client. *

* @return createUserPoolClientResult The response from the * CreateUserPoolClient service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @throws LimitExceededException * @throws NotAuthorizedException * @throws ScopeDoesNotExistException * @throws InvalidOAuthFlowException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public CreateUserPoolClientResult createUserPoolClient( CreateUserPoolClientRequest createUserPoolClientRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(createUserPoolClientRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateUserPoolClientRequestMarshaller() .marshall(createUserPoolClientRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new CreateUserPoolClientResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Creates a new domain for a user pool. *

* * @param createUserPoolDomainRequest * @return createUserPoolDomainResult The response from the * CreateUserPoolDomain service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws NotAuthorizedException * @throws ResourceNotFoundException * @throws LimitExceededException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public CreateUserPoolDomainResult createUserPoolDomain( CreateUserPoolDomainRequest createUserPoolDomainRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(createUserPoolDomainRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateUserPoolDomainRequestMarshaller() .marshall(createUserPoolDomainRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new CreateUserPoolDomainResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Deletes a group. *

*

* Calling this action requires developer credentials. *

* * @param deleteGroupRequest * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public void deleteGroup(DeleteGroupRequest deleteGroupRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(deleteGroupRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteGroupRequestMarshaller().marshall(deleteGroupRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } JsonResponseHandler responseHandler = new JsonResponseHandler(null); invoke(request, responseHandler, executionContext); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Deletes an IdP for a user pool. *

* * @param deleteIdentityProviderRequest * @throws InvalidParameterException * @throws UnsupportedIdentityProviderException * @throws ConcurrentModificationException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public void deleteIdentityProvider(DeleteIdentityProviderRequest deleteIdentityProviderRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(deleteIdentityProviderRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteIdentityProviderRequestMarshaller() .marshall(deleteIdentityProviderRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } JsonResponseHandler responseHandler = new JsonResponseHandler(null); invoke(request, responseHandler, executionContext); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Deletes a resource server. *

* * @param deleteResourceServerRequest * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public void deleteResourceServer(DeleteResourceServerRequest deleteResourceServerRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(deleteResourceServerRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteResourceServerRequestMarshaller() .marshall(deleteResourceServerRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } JsonResponseHandler responseHandler = new JsonResponseHandler(null); invoke(request, responseHandler, executionContext); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Allows a user to delete himself or herself. *

* * @param deleteUserRequest

* Represents the request to delete a user. *

* @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public void deleteUser(DeleteUserRequest deleteUserRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(deleteUserRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteUserRequestMarshaller().marshall(deleteUserRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } JsonResponseHandler responseHandler = new JsonResponseHandler(null); invoke(request, responseHandler, executionContext); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Deletes the attributes for a user. *

* * @param deleteUserAttributesRequest

* Represents the request to delete user attributes. *

* @return deleteUserAttributesResult The response from the * DeleteUserAttributes service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public DeleteUserAttributesResult deleteUserAttributes( DeleteUserAttributesRequest deleteUserAttributesRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(deleteUserAttributesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteUserAttributesRequestMarshaller() .marshall(deleteUserAttributesRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new DeleteUserAttributesResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Deletes the specified Amazon Cognito user pool. *

* * @param deleteUserPoolRequest

* Represents the request to delete a user pool. *

* @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserImportInProgressException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public void deleteUserPool(DeleteUserPoolRequest deleteUserPoolRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(deleteUserPoolRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteUserPoolRequestMarshaller().marshall(deleteUserPoolRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } JsonResponseHandler responseHandler = new JsonResponseHandler(null); invoke(request, responseHandler, executionContext); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param deleteUserPoolClientRequest

* Represents the request to delete a user pool client. *

* @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws ConcurrentModificationException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public void deleteUserPoolClient(DeleteUserPoolClientRequest deleteUserPoolClientRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(deleteUserPoolClientRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteUserPoolClientRequestMarshaller() .marshall(deleteUserPoolClientRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } JsonResponseHandler responseHandler = new JsonResponseHandler(null); invoke(request, responseHandler, executionContext); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Deletes a domain for a user pool. *

* * @param deleteUserPoolDomainRequest * @return deleteUserPoolDomainResult The response from the * DeleteUserPoolDomain service method, as returned by Amazon * Cognito Your User Pool. * @throws NotAuthorizedException * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public DeleteUserPoolDomainResult deleteUserPoolDomain( DeleteUserPoolDomainRequest deleteUserPoolDomainRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(deleteUserPoolDomainRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteUserPoolDomainRequestMarshaller() .marshall(deleteUserPoolDomainRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new DeleteUserPoolDomainResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Gets information about a specific IdP. *

* * @param describeIdentityProviderRequest * @return describeIdentityProviderResult The response from the * DescribeIdentityProvider service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public DescribeIdentityProviderResult describeIdentityProvider( DescribeIdentityProviderRequest describeIdentityProviderRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(describeIdentityProviderRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeIdentityProviderRequestMarshaller() .marshall(describeIdentityProviderRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new DescribeIdentityProviderResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Describes a resource server. *

* * @param describeResourceServerRequest * @return describeResourceServerResult The response from the * DescribeResourceServer service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public DescribeResourceServerResult describeResourceServer( DescribeResourceServerRequest describeResourceServerRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(describeResourceServerRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeResourceServerRequestMarshaller() .marshall(describeResourceServerRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new DescribeResourceServerResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Describes the risk configuration. *

* * @param describeRiskConfigurationRequest * @return describeRiskConfigurationResult The response from the * DescribeRiskConfiguration service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserPoolAddOnNotEnabledException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public DescribeRiskConfigurationResult describeRiskConfiguration( DescribeRiskConfigurationRequest describeRiskConfigurationRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(describeRiskConfigurationRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeRiskConfigurationRequestMarshaller() .marshall(describeRiskConfigurationRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new DescribeRiskConfigurationResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Describes the user import job. *

* * @param describeUserImportJobRequest

* Represents the request to describe the user import job. *

* @return describeUserImportJobResult The response from the * DescribeUserImportJob service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public DescribeUserImportJobResult describeUserImportJob( DescribeUserImportJobRequest describeUserImportJobRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(describeUserImportJobRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeUserImportJobRequestMarshaller() .marshall(describeUserImportJobRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new DescribeUserImportJobResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param describeUserPoolRequest

* Represents the request to describe the user pool. *

* @return describeUserPoolResult The response from the DescribeUserPool * service method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserPoolTaggingException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public DescribeUserPoolResult describeUserPool(DescribeUserPoolRequest describeUserPoolRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(describeUserPoolRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeUserPoolRequestMarshaller().marshall(describeUserPoolRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new DescribeUserPoolResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param describeUserPoolClientRequest

* Represents the request to describe a user pool client. *

* @return describeUserPoolClientResult The response from the * DescribeUserPoolClient service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public DescribeUserPoolClientResult describeUserPoolClient( DescribeUserPoolClientRequest describeUserPoolClientRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(describeUserPoolClientRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeUserPoolClientRequestMarshaller() .marshall(describeUserPoolClientRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new DescribeUserPoolClientResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Gets information about a domain. *

* * @param describeUserPoolDomainRequest * @return describeUserPoolDomainResult The response from the * DescribeUserPoolDomain service method, as returned by Amazon * Cognito Your User Pool. * @throws NotAuthorizedException * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public DescribeUserPoolDomainResult describeUserPoolDomain( DescribeUserPoolDomainRequest describeUserPoolDomainRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(describeUserPoolDomainRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeUserPoolDomainRequestMarshaller() .marshall(describeUserPoolDomainRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new DescribeUserPoolDomainResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Forgets the specified device. *

* * @param forgetDeviceRequest

* Represents the request to forget the device. *

* @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InvalidUserPoolConfigurationException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public void forgetDevice(ForgetDeviceRequest forgetDeviceRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(forgetDeviceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ForgetDeviceRequestMarshaller().marshall(forgetDeviceRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } JsonResponseHandler responseHandler = new JsonResponseHandler(null); invoke(request, responseHandler, executionContext); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* 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. If neither a verified phone number nor a verified email * exists, an InvalidParameterException is thrown. To use the * confirmation code for resetting the password, call ConfirmForgotPassword. *

* *

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

*

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

*
* * @param forgotPasswordRequest

* Represents the request to reset a user's password. *

* @return forgotPasswordResult The response from the ForgotPassword service * method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @throws UserLambdaValidationException * @throws NotAuthorizedException * @throws InvalidLambdaResponseException * @throws TooManyRequestsException * @throws LimitExceededException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws InvalidEmailRoleAccessPolicyException * @throws CodeDeliveryFailureException * @throws UserNotFoundException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ForgotPasswordResult forgotPassword(ForgotPasswordRequest forgotPasswordRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(forgotPasswordRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ForgotPasswordRequestMarshaller().marshall(forgotPasswordRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ForgotPasswordResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* 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 getCSVHeaderResult The response from the GetCSVHeader service * method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public GetCSVHeaderResult getCSVHeader(GetCSVHeaderRequest getCSVHeaderRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(getCSVHeaderRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetCSVHeaderRequestMarshaller().marshall(getCSVHeaderRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GetCSVHeaderResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Gets the device. *

* * @param getDeviceRequest

* Represents the request to get the device. *

* @return getDeviceResult The response from the GetDevice service method, * as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws InvalidUserPoolConfigurationException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public GetDeviceResult getDevice(GetDeviceRequest getDeviceRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(getDeviceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetDeviceRequestMarshaller().marshall(getDeviceRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GetDeviceResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Gets a group. *

*

* Calling this action requires developer credentials. *

* * @param getGroupRequest * @return getGroupResult The response from the GetGroup service method, as * returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public GetGroupResult getGroup(GetGroupRequest getGroupRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(getGroupRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetGroupRequestMarshaller().marshall(getGroupRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GetGroupResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Gets the specified IdP. *

* * @param getIdentityProviderByIdentifierRequest * @return getIdentityProviderByIdentifierResult The response from the * GetIdentityProviderByIdentifier service method, as returned by * Amazon Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public GetIdentityProviderByIdentifierResult getIdentityProviderByIdentifier( GetIdentityProviderByIdentifierRequest getIdentityProviderByIdentifierRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(getIdentityProviderByIdentifierRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetIdentityProviderByIdentifierRequestMarshaller() .marshall(getIdentityProviderByIdentifierRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GetIdentityProviderByIdentifierResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* 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 getSigningCertificateResult The response from the * GetSigningCertificate service method, as returned by Amazon * Cognito Your User Pool. * @throws InternalErrorException * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public GetSigningCertificateResult getSigningCertificate( GetSigningCertificateRequest getSigningCertificateRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(getSigningCertificateRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetSigningCertificateRequestMarshaller() .marshall(getSigningCertificateRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GetSigningCertificateResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* 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 getUICustomizationResult The response from the GetUICustomization * service method, as returned by Amazon Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public GetUICustomizationResult getUICustomization( GetUICustomizationRequest getUICustomizationRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(getUICustomizationRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetUICustomizationRequestMarshaller() .marshall(getUICustomizationRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GetUICustomizationResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param getUserRequest

* Represents the request to get information about the user. *

* @return getUserResult The response from the GetUser service method, as * returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public GetUserResult getUser(GetUserRequest getUserRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(getUserRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetUserRequestMarshaller().marshall(getUserRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GetUserResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* *

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

*

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

*
* * @param getUserAttributeVerificationCodeRequest

* Represents the request to get user attribute verification. *

* @return getUserAttributeVerificationCodeResult The response from the * GetUserAttributeVerificationCode service method, as returned by * Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UnexpectedLambdaException * @throws UserLambdaValidationException * @throws InvalidLambdaResponseException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws InvalidEmailRoleAccessPolicyException * @throws CodeDeliveryFailureException * @throws LimitExceededException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public GetUserAttributeVerificationCodeResult getUserAttributeVerificationCode( GetUserAttributeVerificationCodeRequest getUserAttributeVerificationCodeRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(getUserAttributeVerificationCodeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetUserAttributeVerificationCodeRequestMarshaller() .marshall(getUserAttributeVerificationCodeRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GetUserAttributeVerificationCodeResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param getUserPoolMfaConfigRequest * @return getUserPoolMfaConfigResult The response from the * GetUserPoolMfaConfig service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public GetUserPoolMfaConfigResult getUserPoolMfaConfig( GetUserPoolMfaConfigRequest getUserPoolMfaConfigRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(getUserPoolMfaConfigRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetUserPoolMfaConfigRequestMarshaller() .marshall(getUserPoolMfaConfigRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GetUserPoolMfaConfigResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param globalSignOutRequest

* Represents the request to sign out all devices. *

* @return globalSignOutResult The response from the GlobalSignOut service * method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws PasswordResetRequiredException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public GlobalSignOutResult globalSignOut(GlobalSignOutRequest globalSignOutRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(globalSignOutRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GlobalSignOutRequestMarshaller().marshall(globalSignOutRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GlobalSignOutResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* *

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

*

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

*
* * @param initiateAuthRequest

* Initiates the authentication request. *

* @return initiateAuthResult The response from the InitiateAuth service * method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws UnexpectedLambdaException * @throws InvalidUserPoolConfigurationException * @throws UserLambdaValidationException * @throws InvalidLambdaResponseException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public InitiateAuthResult initiateAuth(InitiateAuthRequest initiateAuthRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(initiateAuthRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new InitiateAuthRequestMarshaller().marshall(initiateAuthRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new InitiateAuthResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param listDevicesRequest

* Represents the request to list the devices. *

* @return listDevicesResult The response from the ListDevices service * method, as returned by Amazon Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws InvalidUserPoolConfigurationException * @throws TooManyRequestsException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ListDevicesResult listDevices(ListDevicesRequest listDevicesRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(listDevicesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListDevicesRequestMarshaller().marshall(listDevicesRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ListDevicesResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Lists the groups associated with a user pool. *

*

* Calling this action requires developer credentials. *

* * @param listGroupsRequest * @return listGroupsResult The response from the ListGroups service method, * as returned by Amazon Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ListGroupsResult listGroups(ListGroupsRequest listGroupsRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(listGroupsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListGroupsRequestMarshaller().marshall(listGroupsRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ListGroupsResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param listIdentityProvidersRequest * @return listIdentityProvidersResult The response from the * ListIdentityProviders service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ListIdentityProvidersResult listIdentityProviders( ListIdentityProvidersRequest listIdentityProvidersRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(listIdentityProvidersRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListIdentityProvidersRequestMarshaller() .marshall(listIdentityProvidersRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ListIdentityProvidersResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Lists the resource servers for a user pool. *

* * @param listResourceServersRequest * @return listResourceServersResult The response from the * ListResourceServers service method, as returned by Amazon Cognito * Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ListResourceServersResult listResourceServers( ListResourceServersRequest listResourceServersRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(listResourceServersRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListResourceServersRequestMarshaller() .marshall(listResourceServersRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ListResourceServersResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

*

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

*

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

* * @param listTagsForResourceRequest * @return listTagsForResourceResult The response from the * ListTagsForResource service method, as returned by Amazon Cognito * Your User Pool. * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InvalidParameterException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ListTagsForResourceResult listTagsForResource( ListTagsForResourceRequest listTagsForResourceRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListTagsForResourceRequestMarshaller() .marshall(listTagsForResourceRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ListTagsForResourceResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Lists the user import jobs. *

* * @param listUserImportJobsRequest

* Represents the request to list the user import jobs. *

* @return listUserImportJobsResult The response from the ListUserImportJobs * service method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ListUserImportJobsResult listUserImportJobs( ListUserImportJobsRequest listUserImportJobsRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(listUserImportJobsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListUserImportJobsRequestMarshaller() .marshall(listUserImportJobsRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ListUserImportJobsResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param listUserPoolClientsRequest

* Represents the request to list the user pool clients. *

* @return listUserPoolClientsResult The response from the * ListUserPoolClients service method, as returned by Amazon Cognito * Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ListUserPoolClientsResult listUserPoolClients( ListUserPoolClientsRequest listUserPoolClientsRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(listUserPoolClientsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListUserPoolClientsRequestMarshaller() .marshall(listUserPoolClientsRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ListUserPoolClientsResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param listUserPoolsRequest

* Represents the request to list user pools. *

* @return listUserPoolsResult The response from the ListUserPools service * method, as returned by Amazon Cognito Your User Pool. * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ListUserPoolsResult listUserPools(ListUserPoolsRequest listUserPoolsRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(listUserPoolsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListUserPoolsRequestMarshaller().marshall(listUserPoolsRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ListUserPoolsResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Lists the users in the Amazon Cognito user pool. *

* * @param listUsersRequest

* Represents the request to list users. *

* @return listUsersResult The response from the ListUsers service method, * as returned by Amazon Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ListUsersResult listUsers(ListUsersRequest listUsersRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(listUsersRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListUsersRequestMarshaller().marshall(listUsersRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ListUsersResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Lists the users in the specified group. *

*

* Calling this action requires developer credentials. *

* * @param listUsersInGroupRequest * @return listUsersInGroupResult The response from the ListUsersInGroup * service method, as returned by Amazon Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ListUsersInGroupResult listUsersInGroup(ListUsersInGroupRequest listUsersInGroupRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(listUsersInGroupRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListUsersInGroupRequestMarshaller().marshall(listUsersInGroupRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ListUsersInGroupResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* *

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

*

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

*
* * @param resendConfirmationCodeRequest

* Represents the request to resend the confirmation code. *

* @return resendConfirmationCodeResult The response from the * ResendConfirmationCode service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @throws UserLambdaValidationException * @throws NotAuthorizedException * @throws InvalidLambdaResponseException * @throws TooManyRequestsException * @throws LimitExceededException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws InvalidEmailRoleAccessPolicyException * @throws CodeDeliveryFailureException * @throws UserNotFoundException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public ResendConfirmationCodeResult resendConfirmationCode( ResendConfirmationCodeRequest resendConfirmationCodeRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(resendConfirmationCodeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ResendConfirmationCodeRequestMarshaller() .marshall(resendConfirmationCodeRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ResendConfirmationCodeResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Responds to the authentication challenge. *

* *

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

*

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

*
* * @param respondToAuthChallengeRequest

* The request to respond to an authentication challenge. *

* @return respondToAuthChallengeResult The response from the * RespondToAuthChallenge service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws CodeMismatchException * @throws ExpiredCodeException * @throws UnexpectedLambdaException * @throws UserLambdaValidationException * @throws InvalidPasswordException * @throws InvalidLambdaResponseException * @throws TooManyRequestsException * @throws InvalidUserPoolConfigurationException * @throws MFAMethodNotFoundException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws AliasExistsException * @throws InternalErrorException * @throws SoftwareTokenMFANotFoundException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public RespondToAuthChallengeResult respondToAuthChallenge( RespondToAuthChallengeRequest respondToAuthChallengeRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(respondToAuthChallengeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new RespondToAuthChallengeRequestMarshaller() .marshall(respondToAuthChallengeRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new RespondToAuthChallengeResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param revokeTokenRequest * @return revokeTokenResult The response from the RevokeToken service * method, as returned by Amazon Cognito Your User Pool. * @throws TooManyRequestsException * @throws InternalErrorException * @throws UnauthorizedException * @throws InvalidParameterException * @throws UnsupportedOperationException * @throws UnsupportedTokenTypeException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public RevokeTokenResult revokeToken(RevokeTokenRequest revokeTokenRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(revokeTokenRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new RevokeTokenRequestMarshaller().marshall(revokeTokenRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new RevokeTokenResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

*

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

* * @param setRiskConfigurationRequest * @return setRiskConfigurationResult The response from the * SetRiskConfiguration service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserPoolAddOnNotEnabledException * @throws CodeDeliveryFailureException * @throws InvalidEmailRoleAccessPolicyException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public SetRiskConfigurationResult setRiskConfiguration( SetRiskConfigurationRequest setRiskConfigurationRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(setRiskConfigurationRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new SetRiskConfigurationRequestMarshaller() .marshall(setRiskConfigurationRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new SetRiskConfigurationResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

*

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

* *

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

*
* * @param setUICustomizationRequest * @return setUICustomizationResult The response from the SetUICustomization * service method, as returned by Amazon Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public SetUICustomizationResult setUICustomization( SetUICustomizationRequest setUICustomizationRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(setUICustomizationRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new SetUICustomizationRequestMarshaller() .marshall(setUICustomizationRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new SetUICustomizationResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param setUserMFAPreferenceRequest * @return setUserMFAPreferenceResult The response from the * SetUserMFAPreference service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public SetUserMFAPreferenceResult setUserMFAPreference( SetUserMFAPreferenceRequest setUserMFAPreferenceRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(setUserMFAPreferenceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new SetUserMFAPreferenceRequestMarshaller() .marshall(setUserMFAPreferenceRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new SetUserMFAPreferenceResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* *

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

*

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

*
* * @param setUserPoolMfaConfigRequest * @return setUserPoolMfaConfigResult The response from the * SetUserPoolMfaConfig service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public SetUserPoolMfaConfigResult setUserPoolMfaConfig( SetUserPoolMfaConfigRequest setUserPoolMfaConfigRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(setUserPoolMfaConfigRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new SetUserPoolMfaConfigRequestMarshaller() .marshall(setUserPoolMfaConfigRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new SetUserPoolMfaConfigResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param setUserSettingsRequest

* Represents the request to set user settings. *

* @return setUserSettingsResult The response from the SetUserSettings * service method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public SetUserSettingsResult setUserSettings(SetUserSettingsRequest setUserSettingsRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(setUserSettingsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new SetUserSettingsRequestMarshaller().marshall(setUserSettingsRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new SetUserSettingsResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* *

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

*

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

*
* * @param signUpRequest

* Represents the request to register a user. *

* @return signUpResult The response from the SignUp service method, as * returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @throws UserLambdaValidationException * @throws NotAuthorizedException * @throws InvalidPasswordException * @throws InvalidLambdaResponseException * @throws UsernameExistsException * @throws TooManyRequestsException * @throws InternalErrorException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws InvalidEmailRoleAccessPolicyException * @throws CodeDeliveryFailureException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public SignUpResult signUp(SignUpRequest signUpRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(signUpRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new SignUpRequestMarshaller().marshall(signUpRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new SignUpResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Starts the user import. *

* * @param startUserImportJobRequest

* Represents the request to start the user import job. *

* @return startUserImportJobResult The response from the StartUserImportJob * service method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws InternalErrorException * @throws PreconditionNotMetException * @throws NotAuthorizedException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public StartUserImportJobResult startUserImportJob( StartUserImportJobRequest startUserImportJobRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(startUserImportJobRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new StartUserImportJobRequestMarshaller() .marshall(startUserImportJobRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new StartUserImportJobResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Stops the user import job. *

* * @param stopUserImportJobRequest

* Represents the request to stop the user import job. *

* @return stopUserImportJobResult The response from the StopUserImportJob * service method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws InternalErrorException * @throws PreconditionNotMetException * @throws NotAuthorizedException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public StopUserImportJobResult stopUserImportJob( StopUserImportJobRequest stopUserImportJobRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(stopUserImportJobRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new StopUserImportJobRequestMarshaller() .marshall(stopUserImportJobRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new StopUserImportJobResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

*

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

*

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

*

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

* * @param tagResourceRequest * @return tagResourceResult The response from the TagResource service * method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InvalidParameterException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public TagResourceResult tagResource(TagResourceRequest tagResourceRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(tagResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new TagResourceRequestMarshaller().marshall(tagResourceRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new TagResourceResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Removes the specified tags from an Amazon Cognito user pool. You can use * this action up to 5 times per second, per account. *

* * @param untagResourceRequest * @return untagResourceResult The response from the UntagResource service * method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InvalidParameterException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public UntagResourceResult untagResource(UntagResourceRequest untagResourceRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(untagResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UntagResourceRequestMarshaller().marshall(untagResourceRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new UntagResourceResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param updateAuthEventFeedbackRequest * @return updateAuthEventFeedbackResult The response from the * UpdateAuthEventFeedback service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserNotFoundException * @throws UserPoolAddOnNotEnabledException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public UpdateAuthEventFeedbackResult updateAuthEventFeedback( UpdateAuthEventFeedbackRequest updateAuthEventFeedbackRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(updateAuthEventFeedbackRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateAuthEventFeedbackRequestMarshaller() .marshall(updateAuthEventFeedbackRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new UpdateAuthEventFeedbackResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Updates the device status. *

* * @param updateDeviceStatusRequest

* Represents the request to update the device status. *

* @return updateDeviceStatusResult The response from the UpdateDeviceStatus * service method, as returned by Amazon Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws InvalidUserPoolConfigurationException * @throws TooManyRequestsException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public UpdateDeviceStatusResult updateDeviceStatus( UpdateDeviceStatusRequest updateDeviceStatusRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(updateDeviceStatusRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateDeviceStatusRequestMarshaller() .marshall(updateDeviceStatusRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new UpdateDeviceStatusResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Updates the specified group with the specified attributes. *

*

* Calling this action requires developer credentials. *

* * @param updateGroupRequest * @return updateGroupResult The response from the UpdateGroup service * method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public UpdateGroupResult updateGroup(UpdateGroupRequest updateGroupRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(updateGroupRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateGroupRequestMarshaller().marshall(updateGroupRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new UpdateGroupResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Updates IdP information for a user pool. *

* * @param updateIdentityProviderRequest * @return updateIdentityProviderResult The response from the * UpdateIdentityProvider service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws UnsupportedIdentityProviderException * @throws ResourceNotFoundException * @throws ConcurrentModificationException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public UpdateIdentityProviderResult updateIdentityProvider( UpdateIdentityProviderRequest updateIdentityProviderRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(updateIdentityProviderRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateIdentityProviderRequestMarshaller() .marshall(updateIdentityProviderRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new UpdateIdentityProviderResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Updates the name and scopes of resource server. All other fields are * read-only. *

* *

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

*
* * @param updateResourceServerRequest * @return updateResourceServerResult The response from the * UpdateResourceServer service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public UpdateResourceServerResult updateResourceServer( UpdateResourceServerRequest updateResourceServerRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(updateResourceServerRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateResourceServerRequestMarshaller() .marshall(updateResourceServerRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new UpdateResourceServerResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* *

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

*

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

*
* * @param updateUserAttributesRequest

* Represents the request to update user attributes. *

* @return updateUserAttributesResult The response from the * UpdateUserAttributes service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws CodeMismatchException * @throws ExpiredCodeException * @throws NotAuthorizedException * @throws UnexpectedLambdaException * @throws UserLambdaValidationException * @throws InvalidLambdaResponseException * @throws TooManyRequestsException * @throws AliasExistsException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws InvalidEmailRoleAccessPolicyException * @throws CodeDeliveryFailureException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public UpdateUserAttributesResult updateUserAttributes( UpdateUserAttributesRequest updateUserAttributesRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(updateUserAttributesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateUserAttributesRequestMarshaller() .marshall(updateUserAttributesRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new UpdateUserAttributesResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Updates the specified user pool with the specified attributes. You can * get a list of the current user pool settings using DescribeUserPool. If you don't provide a value for an attribute, it * will be set to the default value. *

* *

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

*

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

*
* * @param updateUserPoolRequest

* Represents the request to update the user pool. *

* @return updateUserPoolResult The response from the UpdateUserPool service * method, as returned by Amazon Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws ConcurrentModificationException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws UserImportInProgressException * @throws InternalErrorException * @throws InvalidSmsRoleAccessPolicyException * @throws InvalidSmsRoleTrustRelationshipException * @throws UserPoolTaggingException * @throws InvalidEmailRoleAccessPolicyException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public UpdateUserPoolResult updateUserPool(UpdateUserPoolRequest updateUserPoolRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(updateUserPoolRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateUserPoolRequestMarshaller().marshall(updateUserPoolRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new UpdateUserPoolResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* *

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

*
*

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

* * @param updateUserPoolClientRequest

* Represents the request to update the user pool client. *

* @return updateUserPoolClientResult The response from the * UpdateUserPoolClient service method, as returned by Amazon * Cognito Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws ConcurrentModificationException * @throws TooManyRequestsException * @throws NotAuthorizedException * @throws ScopeDoesNotExistException * @throws InvalidOAuthFlowException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public UpdateUserPoolClientResult updateUserPoolClient( UpdateUserPoolClientRequest updateUserPoolClientRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(updateUserPoolClientRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateUserPoolClientRequestMarshaller() .marshall(updateUserPoolClientRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new UpdateUserPoolClientResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Updates the Secure Sockets Layer (SSL) certificate for the custom domain * for your user pool. *

*

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

*

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

*

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

*

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

*

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

*

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

*

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

* * @param updateUserPoolDomainRequest

* The UpdateUserPoolDomain request input. *

* @return updateUserPoolDomainResult The response from the * UpdateUserPoolDomain service method, as returned by Amazon * Cognito Your User Pool. * @throws InvalidParameterException * @throws NotAuthorizedException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @throws InternalErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public UpdateUserPoolDomainResult updateUserPoolDomain( UpdateUserPoolDomainRequest updateUserPoolDomainRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(updateUserPoolDomainRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateUserPoolDomainRequestMarshaller() .marshall(updateUserPoolDomainRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new UpdateUserPoolDomainResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param verifySoftwareTokenRequest * @return verifySoftwareTokenResult The response from the * VerifySoftwareToken service method, as returned by Amazon Cognito * Your User Pool. * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws InvalidUserPoolConfigurationException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws EnableSoftwareTokenMFAException * @throws NotAuthorizedException * @throws SoftwareTokenMFANotFoundException * @throws CodeMismatchException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public VerifySoftwareTokenResult verifySoftwareToken( VerifySoftwareTokenRequest verifySoftwareTokenRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(verifySoftwareTokenRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new VerifySoftwareTokenRequestMarshaller() .marshall(verifySoftwareTokenRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new VerifySoftwareTokenResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

*

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

* * @param verifyUserAttributeRequest

* Represents the request to verify user attributes. *

* @return verifyUserAttributeResult The response from the * VerifyUserAttribute service method, as returned by Amazon Cognito * Your User Pool. * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws CodeMismatchException * @throws ExpiredCodeException * @throws NotAuthorizedException * @throws TooManyRequestsException * @throws LimitExceededException * @throws PasswordResetRequiredException * @throws UserNotFoundException * @throws UserNotConfirmedException * @throws InternalErrorException * @throws AliasExistsException * @throws ForbiddenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Cognito Your User Pool indicating either a problem with the * data in the request, or a server side issue. */ public VerifyUserAttributeResult verifyUserAttribute( VerifyUserAttributeRequest verifyUserAttributeRequest) throws AmazonServiceException, AmazonClientException { ExecutionContext executionContext = createExecutionContext(verifyUserAttributeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new VerifyUserAttributeRequestMarshaller() .marshall(verifyUserAttributeRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new VerifyUserAttributeResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler( unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { awsRequestMetrics.endEvent(Field.ClientExecuteTime); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** * Returns additional metadata for a previously executed successful, * request, typically used for debugging issues where a service isn't acting * as expected. This data isn't considered part of the result data returned * by an operation, so it's available through this separate, diagnostic * interface. *

* Response metadata is only cached for a limited period of time, so if you * need to access this extra diagnostic information for an executed request, * you should use this method to retrieve it as soon as possible after * executing the request. * * @param request The originally executed request * @return The response metadata for the specified request, or null if none * is available. * @deprecated ResponseMetadata cache can hold up to 50 requests and * responses in memory and will cause memory issue. This method * now always returns null. */ @Deprecated public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) { return client.getResponseMetadataForRequest(request); } private Response invoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { request.setEndpoint(endpoint); request.setTimeOffset(timeOffset); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); AWSCredentials credentials; awsRequestMetrics.startEvent(Field.CredentialsRequestTime); try { credentials = awsCredentialsProvider.getCredentials(); } finally { awsRequestMetrics.endEvent(Field.CredentialsRequestTime); } AmazonWebServiceRequest originalRequest = request.getOriginalRequest(); if (originalRequest != null && originalRequest.getRequestCredentials() != null) { credentials = originalRequest.getRequestCredentials(); } executionContext.setCredentials(credentials); JsonErrorResponseHandler errorResponseHandler = new JsonErrorResponseHandler( jsonErrorUnmarshallers); Response result = client.execute(request, responseHandler, errorResponseHandler, executionContext); return result; } }