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

com.amazonaws.services.cognitoidentityprovider.AmazonCognitoIdentityProviderClient Maven / Gradle / Ivy

Go to download

The AWS Android SDK for Amazon Cognito Identity Provider module holds the client classes that are used for communicating with Amazon Cognito Identity Provider Service

There is a newer version: 2.79.0
Show newest version
/*
 * Copyright 2010-2016 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 AmazonCognitoIdentityProvider.  All service calls made
 * using this client are blocking, and will not return until the service call
 * completes.
 * 

*

* You can create a user pool in Amazon Cognito Identity 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 Identity, which is a new capability that is available as a * beta. *

*/ public class AmazonCognitoIdentityProviderClient extends AmazonWebServiceClient implements AmazonCognitoIdentityProvider { /** Provider for AWS credentials. */ private AWSCredentialsProvider awsCredentialsProvider; /** * List of exception unmarshallers for all AmazonCognitoIdentityProvider exceptions. */ protected List jsonErrorUnmarshallers; /** * Constructs a new client to invoke service methods on * AmazonCognitoIdentityProvider. A credentials provider chain will be used * that searches for credentials in this order: *
    *
  • 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. * *

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

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

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

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

* 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 TooManyFailedAttemptsExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UsernameExistsExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new ResourceNotFoundExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InternalErrorExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new ExpiredCodeExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InvalidLambdaResponseExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new CodeMismatchExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new AliasExistsExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new ConcurrentModificationExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UserLambdaValidationExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new NotAuthorizedExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new TooManyRequestsExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UnexpectedLambdaExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InvalidPasswordExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new MFAMethodNotFoundExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new InvalidParameterExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new LimitExceededExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new JsonErrorUnmarshaller()); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("cognito-idp.us-east-1.amazonaws.com"); 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; } /** *

* Allows a user to enter a code provided when they reset their password * to update their password. *

* * @param confirmForgotPasswordRequest Container for the necessary * parameters to execute the ConfirmForgotPassword service method on * AmazonCognitoIdentityProvider. * * @return The response from the ConfirmForgotPassword service method, as * returned by AmazonCognitoIdentityProvider. * * @throws TooManyFailedAttemptsException * @throws InvalidLambdaResponseException * @throws UserLambdaValidationException * @throws ResourceNotFoundException * @throws CodeMismatchException * @throws InvalidPasswordException * @throws TooManyRequestsException * @throws UnexpectedLambdaException * @throws InvalidParameterException * @throws LimitExceededException * @throws NotAuthorizedException * @throws InternalErrorException * @throws ExpiredCodeException * * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public ConfirmForgotPasswordResult confirmForgotPassword(ConfirmForgotPasswordRequest confirmForgotPasswordRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

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

* Sets the user settings like multi-factor authentication (MFA). If MFA * is to be removed for a particular attribute pass the attribute with * code delivery as null. If null list is passed, all MFA options are * removed. *

* * @param setUserSettingsRequest Container for the necessary parameters * to execute the SetUserSettings service method on * AmazonCognitoIdentityProvider. * * @return The response from the SetUserSettings service method, as * returned by AmazonCognitoIdentityProvider. * * @throws ResourceNotFoundException * @throws InvalidParameterException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public SetUserSettingsResult setUserSettings(SetUserSettingsRequest setUserSettingsRequest) { ExecutionContext executionContext = createExecutionContext(setUserSettingsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new SetUserSettingsRequestMarshaller().marshall(setUserSettingsRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new SetUserSettingsResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler(unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param adminEnableUserRequest Container for the necessary parameters * to execute the AdminEnableUser service method on * AmazonCognitoIdentityProvider. * * @return The response from the AdminEnableUser service method, as * returned by AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws InternalErrorException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public AdminEnableUserResult adminEnableUser(AdminEnableUserRequest adminEnableUserRequest) { 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 { 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. *

* * @param adminGetUserRequest Container for the necessary parameters to * execute the AdminGetUser service method on * AmazonCognitoIdentityProvider. * * @return The response from the AdminGetUser service method, as returned * by AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws InternalErrorException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public AdminGetUserResult adminGetUser(AdminGetUserRequest adminGetUserRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param adminDeleteUserRequest Container for the necessary parameters * to execute the AdminDeleteUser service method on * AmazonCognitoIdentityProvider. * * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws InternalErrorException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public void adminDeleteUser(AdminDeleteUserRequest adminDeleteUserRequest) { ExecutionContext executionContext = createExecutionContext(adminDeleteUserRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); Request request; 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); } /** *

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

* * @param adminDeleteUserAttributesRequest Container for the necessary * parameters to execute the AdminDeleteUserAttributes service method on * AmazonCognitoIdentityProvider. * * @return The response from the AdminDeleteUserAttributes service * method, as returned by AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws InternalErrorException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public AdminDeleteUserAttributesResult adminDeleteUserAttributes(AdminDeleteUserAttributesRequest adminDeleteUserAttributesRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Deletes the specified Amazon Cognito user pool. *

* * @param deleteUserPoolRequest Container for the necessary parameters to * execute the DeleteUserPool service method on * AmazonCognitoIdentityProvider. * * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws InternalErrorException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public void deleteUserPool(DeleteUserPoolRequest deleteUserPoolRequest) { ExecutionContext executionContext = createExecutionContext(deleteUserPoolRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); Request request; 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); } /** *

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

* * @param deleteUserPoolClientRequest Container for the necessary * parameters to execute the DeleteUserPoolClient service method on * AmazonCognitoIdentityProvider. * * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws InternalErrorException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public void deleteUserPoolClient(DeleteUserPoolClientRequest deleteUserPoolClientRequest) { ExecutionContext executionContext = createExecutionContext(deleteUserPoolClientRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); Request request; 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); } /** *

* Deletes the attributes for a user. *

* * @param deleteUserAttributesRequest Container for the necessary * parameters to execute the DeleteUserAttributes service method on * AmazonCognitoIdentityProvider. * * @return The response from the DeleteUserAttributes service method, as * returned by AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public DeleteUserAttributesResult deleteUserAttributes(DeleteUserAttributesRequest deleteUserAttributesRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* First step of the Secure Remote Password protocol (SRP) auth flow to * authenticate a user. To learn about the second step, see Authenticate. *

* * @param getAuthenticationDetailsRequest Container for the necessary * parameters to execute the GetAuthenticationDetails service method on * AmazonCognitoIdentityProvider. * * @return The response from the GetAuthenticationDetails service method, * as returned by AmazonCognitoIdentityProvider. * * @throws InvalidLambdaResponseException * @throws UserLambdaValidationException * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws UnexpectedLambdaException * @throws InvalidParameterException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public GetAuthenticationDetailsResult getAuthenticationDetails(GetAuthenticationDetailsRequest getAuthenticationDetailsRequest) { ExecutionContext executionContext = createExecutionContext(getAuthenticationDetailsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetAuthenticationDetailsRequestMarshaller().marshall(getAuthenticationDetailsRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GetAuthenticationDetailsResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler(unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Confirms registration of a user and handles the existing alias from a * previous user. *

* * @param confirmSignUpRequest Container for the necessary parameters to * execute the ConfirmSignUp service method on * AmazonCognitoIdentityProvider. * * @return The response from the ConfirmSignUp service method, as * returned by AmazonCognitoIdentityProvider. * * @throws TooManyFailedAttemptsException * @throws InvalidLambdaResponseException * @throws UserLambdaValidationException * @throws ResourceNotFoundException * @throws CodeMismatchException * @throws AliasExistsException * @throws TooManyRequestsException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @throws LimitExceededException * @throws NotAuthorizedException * @throws InternalErrorException * @throws ExpiredCodeException * * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public ConfirmSignUpResult confirmSignUp(ConfirmSignUpRequest confirmSignUpRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Grants the ability to supply a multi-factor authentication (MFA) * token for an MFA-enabled user to get the ID, access, and refresh * tokens. *

* * @param enhanceAuthRequest Container for the necessary parameters to * execute the EnhanceAuth service method on * AmazonCognitoIdentityProvider. * * @return The response from the EnhanceAuth service method, as returned * by AmazonCognitoIdentityProvider. * * @throws InvalidLambdaResponseException * @throws UserLambdaValidationException * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @throws NotAuthorizedException * @throws InternalErrorException * @throws ExpiredCodeException * @throws CodeMismatchException * * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public EnhanceAuthResult enhanceAuth(EnhanceAuthRequest enhanceAuthRequest) { ExecutionContext executionContext = createExecutionContext(enhanceAuthRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new EnhanceAuthRequestMarshaller().marshall(enhanceAuthRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new EnhanceAuthResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler(unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param verifyUserAttributeRequest Container for the necessary * parameters to execute the VerifyUserAttribute service method on * AmazonCognitoIdentityProvider. * * @return The response from the VerifyUserAttribute service method, as * returned by AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws NotAuthorizedException * @throws InternalErrorException * @throws ExpiredCodeException * @throws CodeMismatchException * * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public VerifyUserAttributeResult verifyUserAttribute(VerifyUserAttributeRequest verifyUserAttributeRequest) { ExecutionContext executionContext = createExecutionContext(verifyUserAttributeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new VerifyUserAttributeRequestMarshaller().marshall(verifyUserAttributeRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new VerifyUserAttributeResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler(unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Updates the specified user pool with the specified attributes. *

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

* Creates the user pool client. *

* * @param createUserPoolClientRequest Container for the necessary * parameters to execute the CreateUserPoolClient service method on * AmazonCognitoIdentityProvider. * * @return The response from the CreateUserPoolClient service method, as * returned by AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public CreateUserPoolClientResult createUserPoolClient(CreateUserPoolClientRequest createUserPoolClientRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param adminUpdateUserAttributesRequest Container for the necessary * parameters to execute the AdminUpdateUserAttributes service method on * AmazonCognitoIdentityProvider. * * @return The response from the AdminUpdateUserAttributes service * method, as returned by AmazonCognitoIdentityProvider. * * @throws AliasExistsException * @throws InvalidLambdaResponseException * @throws UserLambdaValidationException * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public AdminUpdateUserAttributesResult adminUpdateUserAttributes(AdminUpdateUserAttributesRequest adminUpdateUserAttributesRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Lists the user pools associated with an AWS account. *

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

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

* * @param getUserRequest Container for the necessary parameters to * execute the GetUser service method on AmazonCognitoIdentityProvider. * * @return The response from the GetUser service method, as returned by * AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public GetUserResult getUser(GetUserRequest getUserRequest) { ExecutionContext executionContext = createExecutionContext(getUserRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetUserRequestMarshaller().marshall(getUserRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GetUserResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler(unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

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

* Retrieves the password for the specified client ID or username. *

* * @param forgotPasswordRequest Container for the necessary parameters to * execute the ForgotPassword service method on * AmazonCognitoIdentityProvider. * * @return The response from the ForgotPassword service method, as * returned by AmazonCognitoIdentityProvider. * * @throws InvalidLambdaResponseException * @throws UserLambdaValidationException * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public ForgotPasswordResult forgotPassword(ForgotPasswordRequest forgotPasswordRequest) { ExecutionContext executionContext = createExecutionContext(forgotPasswordRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ForgotPasswordRequestMarshaller().marshall(forgotPasswordRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ForgotPasswordResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler(unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Refreshes the tokens for the specified client ID. *

* * @param refreshTokensRequest Container for the necessary parameters to * execute the RefreshTokens service method on * AmazonCognitoIdentityProvider. * * @return The response from the RefreshTokens service method, as * returned by AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public RefreshTokensResult refreshTokens(RefreshTokensRequest refreshTokensRequest) { ExecutionContext executionContext = createExecutionContext(refreshTokensRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new RefreshTokensRequestMarshaller().marshall(refreshTokensRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new RefreshTokensResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler(unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param describeUserPoolRequest Container for the necessary parameters * to execute the DescribeUserPool service method on * AmazonCognitoIdentityProvider. * * @return The response from the DescribeUserPool service method, as * returned by AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws InternalErrorException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public DescribeUserPoolResult describeUserPool(DescribeUserPoolRequest describeUserPoolRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Allows the developer to update the specified user pool client and * password policy. *

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

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

* * @param updateUserAttributesRequest Container for the necessary * parameters to execute the UpdateUserAttributes service method on * AmazonCognitoIdentityProvider. * * @return The response from the UpdateUserAttributes service method, as * returned by AmazonCognitoIdentityProvider. * * @throws AliasExistsException * @throws InvalidLambdaResponseException * @throws UserLambdaValidationException * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @throws NotAuthorizedException * @throws InternalErrorException * @throws ExpiredCodeException * @throws CodeMismatchException * * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public UpdateUserAttributesResult updateUserAttributes(UpdateUserAttributesRequest updateUserAttributesRequest) { ExecutionContext executionContext = createExecutionContext(updateUserAttributesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateUserAttributesRequestMarshaller().marshall(updateUserAttributesRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new UpdateUserAttributesResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler(unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param addCustomAttributesRequest Container for the necessary * parameters to execute the AddCustomAttributes service method on * AmazonCognitoIdentityProvider. * * @return The response from the AddCustomAttributes service method, as * returned by AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws InternalErrorException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public AddCustomAttributesResult addCustomAttributes(AddCustomAttributesRequest addCustomAttributesRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param createUserPoolRequest Container for the necessary parameters to * execute the CreateUserPool service method on * AmazonCognitoIdentityProvider. * * @return The response from the CreateUserPool service method, as * returned by AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @throws InvalidParameterException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public CreateUserPoolResult createUserPool(CreateUserPoolRequest createUserPoolRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* The second step in the authentication flow of Secure Remote Password * protocol (SRP) for authenticating a user to get ID, access and refresh * tokens. To learn more about the first step, see * GetAuthenticationDetails. *

* * @param authenticateRequest Container for the necessary parameters to * execute the Authenticate service method on * AmazonCognitoIdentityProvider. * * @return The response from the Authenticate service method, as returned * by AmazonCognitoIdentityProvider. * * @throws InvalidLambdaResponseException * @throws MFAMethodNotFoundException * @throws UserLambdaValidationException * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public AuthenticateResult authenticate(AuthenticateRequest authenticateRequest) { ExecutionContext executionContext = createExecutionContext(authenticateRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AuthenticateRequestMarshaller().marshall(authenticateRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new AuthenticateResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler(unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { 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. *

* * @param adminResetUserPasswordRequest Container for the necessary * parameters to execute the AdminResetUserPassword service method on * AmazonCognitoIdentityProvider. * * @return The response from the AdminResetUserPassword service method, * as returned by AmazonCognitoIdentityProvider. * * @throws InvalidLambdaResponseException * @throws UserLambdaValidationException * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public AdminResetUserPasswordResult adminResetUserPassword(AdminResetUserPasswordRequest adminResetUserPasswordRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Gets the JSON Web keys for the specified user pool. *

* * @param getJWKSRequest Container for the necessary parameters to * execute the GetJWKS service method on AmazonCognitoIdentityProvider. * * @return The response from the GetJWKS service method, as returned by * AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public GetJWKSResult getJWKS(GetJWKSRequest getJWKSRequest) { ExecutionContext executionContext = createExecutionContext(getJWKSRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetJWKSRequestMarshaller().marshall(getJWKSRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GetJWKSResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler(unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

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

* Allows a user to delete one's self. *

* * @param deleteUserRequest Container for the necessary parameters to * execute the DeleteUser service method on * AmazonCognitoIdentityProvider. * * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public void deleteUser(DeleteUserRequest deleteUserRequest) { ExecutionContext executionContext = createExecutionContext(deleteUserRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); Request request; 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); } /** *

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

* * @param signUpRequest Container for the necessary parameters to execute * the SignUp service method on AmazonCognitoIdentityProvider. * * @return The response from the SignUp service method, as returned by * AmazonCognitoIdentityProvider. * * @throws InvalidPasswordException * @throws UsernameExistsException * @throws InvalidLambdaResponseException * @throws UserLambdaValidationException * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public SignUpResult signUp(SignUpRequest signUpRequest) { ExecutionContext executionContext = createExecutionContext(signUpRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new SignUpRequestMarshaller().marshall(signUpRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new SignUpResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler(unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Sets all the user settings for a specified user name. Works on any * user. *

* * @param adminSetUserSettingsRequest Container for the necessary * parameters to execute the AdminSetUserSettings service method on * AmazonCognitoIdentityProvider. * * @return The response from the AdminSetUserSettings service method, as * returned by AmazonCognitoIdentityProvider. * * @throws ResourceNotFoundException * @throws InvalidParameterException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public AdminSetUserSettingsResult adminSetUserSettings(AdminSetUserSettingsRequest adminSetUserSettingsRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param resendConfirmationCodeRequest Container for the necessary * parameters to execute the ResendConfirmationCode service method on * AmazonCognitoIdentityProvider. * * @return The response from the ResendConfirmationCode service method, * as returned by AmazonCognitoIdentityProvider. * * @throws InvalidLambdaResponseException * @throws UserLambdaValidationException * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public ResendConfirmationCodeResult resendConfirmationCode(ResendConfirmationCodeRequest resendConfirmationCodeRequest) { ExecutionContext executionContext = createExecutionContext(resendConfirmationCodeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ResendConfirmationCodeRequestMarshaller().marshall(resendConfirmationCodeRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new ResendConfirmationCodeResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler(unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Gets the user attribute verification code for the specified attribute * name. *

* * @param getUserAttributeVerificationCodeRequest Container for the * necessary parameters to execute the GetUserAttributeVerificationCode * service method on AmazonCognitoIdentityProvider. * * @return The response from the GetUserAttributeVerificationCode service * method, as returned by AmazonCognitoIdentityProvider. * * @throws InvalidLambdaResponseException * @throws TooManyRequestsException * @throws UserLambdaValidationException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public GetUserAttributeVerificationCodeResult getUserAttributeVerificationCode(GetUserAttributeVerificationCodeRequest getUserAttributeVerificationCodeRequest) { ExecutionContext executionContext = createExecutionContext(getUserAttributeVerificationCodeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetUserAttributeVerificationCodeRequestMarshaller().marshall(getUserAttributeVerificationCodeRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GetUserAttributeVerificationCodeResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler(unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param adminDisableUserRequest Container for the necessary parameters * to execute the AdminDisableUser service method on * AmazonCognitoIdentityProvider. * * @return The response from the AdminDisableUser service method, as * returned by AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws InternalErrorException * * @throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response. For example * if a network connection is not available. * @throws AmazonServiceException * If an error response is returned by AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public AdminDisableUserResult adminDisableUser(AdminDisableUserRequest adminDisableUserRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

* Gets the OpenId configuration information for the specified user * pool. *

* * @param getOpenIdConfigurationRequest Container for the necessary * parameters to execute the GetOpenIdConfiguration service method on * AmazonCognitoIdentityProvider. * * @return The response from the GetOpenIdConfiguration service method, * as returned by AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public GetOpenIdConfigurationResult getOpenIdConfiguration(GetOpenIdConfigurationRequest getOpenIdConfigurationRequest) { ExecutionContext executionContext = createExecutionContext(getOpenIdConfigurationRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetOpenIdConfigurationRequestMarshaller().marshall(getOpenIdConfigurationRequest); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } Unmarshaller unmarshaller = new GetOpenIdConfigurationResultJsonUnmarshaller(); JsonResponseHandler responseHandler = new JsonResponseHandler(unmarshaller); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param adminConfirmSignUpRequest Container for the necessary * parameters to execute the AdminConfirmSignUp service method on * AmazonCognitoIdentityProvider. * * @return The response from the AdminConfirmSignUp service method, as * returned by AmazonCognitoIdentityProvider. * * @throws TooManyFailedAttemptsException * @throws InvalidLambdaResponseException * @throws UserLambdaValidationException * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws UnexpectedLambdaException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public AdminConfirmSignUpResult adminConfirmSignUp(AdminConfirmSignUpRequest adminConfirmSignUpRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @param changePasswordRequest Container for the necessary parameters to * execute the ChangePassword service method on * AmazonCognitoIdentityProvider. * * @return The response from the ChangePassword service method, as * returned by AmazonCognitoIdentityProvider. * * @throws InvalidPasswordException * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public ChangePasswordResult changePassword(ChangePasswordRequest changePasswordRequest) { 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 { endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); } } /** *

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

* * @return The response from the GetUser service method, as returned by * AmazonCognitoIdentityProvider. * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public GetUserResult getUser() throws AmazonServiceException, AmazonClientException { return getUser(new GetUserRequest()); } /** *

* Allows a user to delete one's self. *

* * * @throws TooManyRequestsException * @throws ResourceNotFoundException * @throws InvalidParameterException * @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 AmazonCognitoIdentityProvider indicating * either a problem with the data in the request, or a server side issue. */ public void deleteUser() throws AmazonServiceException, AmazonClientException { deleteUser(new DeleteUserRequest()); } @Override public void setEndpoint(String endpoint) { super.setEndpoint(endpoint); } @Override public void setEndpoint(String endpoint, String serviceName, String regionId) throws IllegalArgumentException { super.setEndpoint(endpoint, serviceName, regionId); } /** * Returns additional metadata for a previously executed successful, request, typically used for * debugging issues where a service isn't acting as expected. This data isn't considered part * of the result data returned by an operation, so it's available through this separate, * diagnostic interface. *

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





© 2015 - 2025 Weber Informatics LLC | Privacy Policy