/*
* 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.
*
* 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:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Instance profile credentials delivered through the Amazon EC2
* metadata service
*
*
* 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:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Instance profile credentials delivered through the Amazon EC2
* metadata service
*
*
* 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