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

software.amazon.awssdk.services.lambda.DefaultLambdaAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Lambda module holds the client classes that are used for communicating with AWS Lambda Service

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

package software.amazon.awssdk.services.lambda;

import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.util.VersionInfo;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.lambda.model.AddPermissionRequest;
import software.amazon.awssdk.services.lambda.model.AddPermissionResponse;
import software.amazon.awssdk.services.lambda.model.CodeStorageExceededException;
import software.amazon.awssdk.services.lambda.model.CreateAliasRequest;
import software.amazon.awssdk.services.lambda.model.CreateAliasResponse;
import software.amazon.awssdk.services.lambda.model.CreateEventSourceMappingRequest;
import software.amazon.awssdk.services.lambda.model.CreateEventSourceMappingResponse;
import software.amazon.awssdk.services.lambda.model.CreateFunctionRequest;
import software.amazon.awssdk.services.lambda.model.CreateFunctionResponse;
import software.amazon.awssdk.services.lambda.model.DeleteAliasRequest;
import software.amazon.awssdk.services.lambda.model.DeleteAliasResponse;
import software.amazon.awssdk.services.lambda.model.DeleteEventSourceMappingRequest;
import software.amazon.awssdk.services.lambda.model.DeleteEventSourceMappingResponse;
import software.amazon.awssdk.services.lambda.model.DeleteFunctionConcurrencyRequest;
import software.amazon.awssdk.services.lambda.model.DeleteFunctionConcurrencyResponse;
import software.amazon.awssdk.services.lambda.model.DeleteFunctionRequest;
import software.amazon.awssdk.services.lambda.model.DeleteFunctionResponse;
import software.amazon.awssdk.services.lambda.model.Ec2AccessDeniedException;
import software.amazon.awssdk.services.lambda.model.Ec2ThrottledException;
import software.amazon.awssdk.services.lambda.model.Ec2UnexpectedException;
import software.amazon.awssdk.services.lambda.model.EniLimitReachedException;
import software.amazon.awssdk.services.lambda.model.GetAccountSettingsRequest;
import software.amazon.awssdk.services.lambda.model.GetAccountSettingsResponse;
import software.amazon.awssdk.services.lambda.model.GetAliasRequest;
import software.amazon.awssdk.services.lambda.model.GetAliasResponse;
import software.amazon.awssdk.services.lambda.model.GetEventSourceMappingRequest;
import software.amazon.awssdk.services.lambda.model.GetEventSourceMappingResponse;
import software.amazon.awssdk.services.lambda.model.GetFunctionConfigurationRequest;
import software.amazon.awssdk.services.lambda.model.GetFunctionConfigurationResponse;
import software.amazon.awssdk.services.lambda.model.GetFunctionRequest;
import software.amazon.awssdk.services.lambda.model.GetFunctionResponse;
import software.amazon.awssdk.services.lambda.model.GetPolicyRequest;
import software.amazon.awssdk.services.lambda.model.GetPolicyResponse;
import software.amazon.awssdk.services.lambda.model.InvalidParameterValueException;
import software.amazon.awssdk.services.lambda.model.InvalidRequestContentException;
import software.amazon.awssdk.services.lambda.model.InvalidRuntimeException;
import software.amazon.awssdk.services.lambda.model.InvalidSecurityGroupIdException;
import software.amazon.awssdk.services.lambda.model.InvalidSubnetIdException;
import software.amazon.awssdk.services.lambda.model.InvalidZipFileException;
import software.amazon.awssdk.services.lambda.model.InvokeRequest;
import software.amazon.awssdk.services.lambda.model.InvokeResponse;
import software.amazon.awssdk.services.lambda.model.KmsAccessDeniedException;
import software.amazon.awssdk.services.lambda.model.KmsDisabledException;
import software.amazon.awssdk.services.lambda.model.KmsInvalidStateException;
import software.amazon.awssdk.services.lambda.model.KmsNotFoundException;
import software.amazon.awssdk.services.lambda.model.LambdaException;
import software.amazon.awssdk.services.lambda.model.LambdaRequest;
import software.amazon.awssdk.services.lambda.model.ListAliasesRequest;
import software.amazon.awssdk.services.lambda.model.ListAliasesResponse;
import software.amazon.awssdk.services.lambda.model.ListEventSourceMappingsRequest;
import software.amazon.awssdk.services.lambda.model.ListEventSourceMappingsResponse;
import software.amazon.awssdk.services.lambda.model.ListFunctionsRequest;
import software.amazon.awssdk.services.lambda.model.ListFunctionsResponse;
import software.amazon.awssdk.services.lambda.model.ListTagsRequest;
import software.amazon.awssdk.services.lambda.model.ListTagsResponse;
import software.amazon.awssdk.services.lambda.model.ListVersionsByFunctionRequest;
import software.amazon.awssdk.services.lambda.model.ListVersionsByFunctionResponse;
import software.amazon.awssdk.services.lambda.model.PolicyLengthExceededException;
import software.amazon.awssdk.services.lambda.model.PreconditionFailedException;
import software.amazon.awssdk.services.lambda.model.PublishVersionRequest;
import software.amazon.awssdk.services.lambda.model.PublishVersionResponse;
import software.amazon.awssdk.services.lambda.model.PutFunctionConcurrencyRequest;
import software.amazon.awssdk.services.lambda.model.PutFunctionConcurrencyResponse;
import software.amazon.awssdk.services.lambda.model.RemovePermissionRequest;
import software.amazon.awssdk.services.lambda.model.RemovePermissionResponse;
import software.amazon.awssdk.services.lambda.model.RequestTooLargeException;
import software.amazon.awssdk.services.lambda.model.ResourceConflictException;
import software.amazon.awssdk.services.lambda.model.ResourceInUseException;
import software.amazon.awssdk.services.lambda.model.ResourceNotFoundException;
import software.amazon.awssdk.services.lambda.model.ServiceException;
import software.amazon.awssdk.services.lambda.model.SubnetIpAddressLimitReachedException;
import software.amazon.awssdk.services.lambda.model.TagResourceRequest;
import software.amazon.awssdk.services.lambda.model.TagResourceResponse;
import software.amazon.awssdk.services.lambda.model.TooManyRequestsException;
import software.amazon.awssdk.services.lambda.model.UnsupportedMediaTypeException;
import software.amazon.awssdk.services.lambda.model.UntagResourceRequest;
import software.amazon.awssdk.services.lambda.model.UntagResourceResponse;
import software.amazon.awssdk.services.lambda.model.UpdateAliasRequest;
import software.amazon.awssdk.services.lambda.model.UpdateAliasResponse;
import software.amazon.awssdk.services.lambda.model.UpdateEventSourceMappingRequest;
import software.amazon.awssdk.services.lambda.model.UpdateEventSourceMappingResponse;
import software.amazon.awssdk.services.lambda.model.UpdateFunctionCodeRequest;
import software.amazon.awssdk.services.lambda.model.UpdateFunctionCodeResponse;
import software.amazon.awssdk.services.lambda.model.UpdateFunctionConfigurationRequest;
import software.amazon.awssdk.services.lambda.model.UpdateFunctionConfigurationResponse;
import software.amazon.awssdk.services.lambda.paginators.ListEventSourceMappingsPublisher;
import software.amazon.awssdk.services.lambda.paginators.ListFunctionsPublisher;
import software.amazon.awssdk.services.lambda.transform.AddPermissionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.CreateAliasRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.CreateEventSourceMappingRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.CreateFunctionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.DeleteAliasRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.DeleteEventSourceMappingRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.DeleteFunctionConcurrencyRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.DeleteFunctionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetAccountSettingsRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetAliasRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetEventSourceMappingRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetFunctionConfigurationRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetFunctionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetPolicyRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.InvokeRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListAliasesRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListEventSourceMappingsRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListFunctionsRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListTagsRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListVersionsByFunctionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.PublishVersionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.PutFunctionConcurrencyRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.RemovePermissionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.UpdateAliasRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.UpdateEventSourceMappingRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.UpdateFunctionCodeRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.UpdateFunctionConfigurationRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;

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

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

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

    @Override
    public final String serviceName() {
        return SERVICE_NAME;
    }

    /**
     * 

* Adds a permission to the resource policy associated with the specified AWS Lambda function. You use resource * policies to grant permissions to event sources that use the push model. In a push model, event * sources (such as Amazon S3 and custom applications) invoke your Lambda function. Each permission you add to the * resource policy allows an event source permission to invoke the Lambda function. *

*

* Permissions apply to the Amazon Resource Name (ARN) used to invoke the function, which can be unqualified (the * unpublished version of the function), or include a version or alias. If a client uses a version or alias to * invoke a function, use the Qualifier parameter to apply permissions to that ARN. For more * information about versioning, see AWS Lambda Function Versioning and * Aliases. *

*

* This operation requires permission for the lambda:AddPermission action. *

* * @param addPermissionRequest * @return A Java Future containing the result of the AddPermission operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • ResourceConflictException The resource already exists.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • PolicyLengthExceededException Lambda function access policy is limited to 20 KB.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • PreconditionFailedException The RevisionId provided does not match the latest RevisionId for the * Lambda function or alias. Call the GetFunction or the GetAlias API to retrieve * the latest RevisionId for your resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.AddPermission * @see AWS API * Documentation */ @Override public CompletableFuture addPermission(AddPermissionRequest addPermissionRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, AddPermissionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new AddPermissionRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(addPermissionRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an alias that points to the specified Lambda function version. For more information, see Introduction to AWS Lambda Aliases. *

*

* Alias names are unique for a given function. This requires permission for the lambda:CreateAlias action. *

* * @param createAliasRequest * @return A Java Future containing the result of the CreateAlias operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • ResourceConflictException The resource already exists.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.CreateAlias * @see AWS API * Documentation */ @Override public CompletableFuture createAlias(CreateAliasRequest createAliasRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateAliasResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new CreateAliasRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(createAliasRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a mapping between an event source and an AWS Lambda function. Lambda reads items from the event source * and triggers the function. *

*

* For details about each event source type, see the following topics. *

* * * @param createEventSourceMappingRequest * @return A Java Future containing the result of the CreateEventSourceMapping operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • ResourceConflictException The resource already exists.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.CreateEventSourceMapping * @see AWS API Documentation */ @Override public CompletableFuture createEventSourceMapping( CreateEventSourceMappingRequest createEventSourceMappingRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateEventSourceMappingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler .execute(new ClientExecutionParams() .withMarshaller(new CreateEventSourceMappingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(createEventSourceMappingRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new Lambda function. The function configuration is created from the request parameters, and the code * for the function is provided by a .zip file. The function name is case-sensitive. *

*

* This operation requires permission for the lambda:CreateFunction action. *

* * @param createFunctionRequest * @return A Java Future containing the result of the CreateFunction operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • ResourceConflictException The resource already exists.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • CodeStorageExceededException You have exceeded your maximum total code size per account. Limits
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.CreateFunction * @see AWS API * Documentation */ @Override public CompletableFuture createFunction(CreateFunctionRequest createFunctionRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateFunctionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new CreateFunctionRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(createFunctionRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified Lambda function alias. For more information, see Introduction to AWS Lambda Aliases. *

*

* This requires permission for the lambda:DeleteAlias action. *

* * @param deleteAliasRequest * @return A Java Future containing the result of the DeleteAlias operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.DeleteAlias * @see AWS API * Documentation */ @Override public CompletableFuture deleteAlias(DeleteAliasRequest deleteAliasRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteAliasResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new DeleteAliasRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(deleteAliasRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an event source mapping. *

* * @param deleteEventSourceMappingRequest * @return A Java Future containing the result of the DeleteEventSourceMapping operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • ResourceInUseException The operation conflicts with the resource's availability. For example, you * attempted to update an EventSoure Mapping in CREATING, or tried to delete a EventSoure mapping currently * in the UPDATING state.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.DeleteEventSourceMapping * @see AWS API Documentation */ @Override public CompletableFuture deleteEventSourceMapping( DeleteEventSourceMappingRequest deleteEventSourceMappingRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteEventSourceMappingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler .execute(new ClientExecutionParams() .withMarshaller(new DeleteEventSourceMappingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(deleteEventSourceMappingRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a Lambda function. To delete a specific function version, use the Qualifier parameter. * Otherwise, all versions and aliases are deleted. Event source mappings are not deleted. *

*

* This operation requires permission for the lambda:DeleteFunction action. *

* * @param deleteFunctionRequest * @return A Java Future containing the result of the DeleteFunction operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • ResourceConflictException The resource already exists.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.DeleteFunction * @see AWS API * Documentation */ @Override public CompletableFuture deleteFunction(DeleteFunctionRequest deleteFunctionRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteFunctionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new DeleteFunctionRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(deleteFunctionRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Removes concurrent execution limits from this function. For more information, see Managing Concurrency. *

* * @param deleteFunctionConcurrencyRequest * @return A Java Future containing the result of the DeleteFunctionConcurrency operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.DeleteFunctionConcurrency * @see AWS API Documentation */ @Override public CompletableFuture deleteFunctionConcurrency( DeleteFunctionConcurrencyRequest deleteFunctionConcurrencyRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteFunctionConcurrencyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler .execute(new ClientExecutionParams() .withMarshaller(new DeleteFunctionConcurrencyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(deleteFunctionConcurrencyRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves details about your account's limits and usage in a region. *

* * @param getAccountSettingsRequest * @return A Java Future containing the result of the GetAccountSettings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.GetAccountSettings * @see AWS API * Documentation */ @Override public CompletableFuture getAccountSettings(GetAccountSettingsRequest getAccountSettingsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetAccountSettingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new GetAccountSettingsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(getAccountSettingsRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the specified alias information such as the alias ARN, description, and function version it is pointing * to. For more information, see Introduction to AWS Lambda Aliases. *

*

* This requires permission for the lambda:GetAlias action. *

* * @param getAliasRequest * @return A Java Future containing the result of the GetAlias operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.GetAlias * @see AWS API * Documentation */ @Override public CompletableFuture getAlias(GetAliasRequest getAliasRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetAliasResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new GetAliasRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(getAliasRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns details about an event source mapping. *

* * @param getEventSourceMappingRequest * @return A Java Future containing the result of the GetEventSourceMapping operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.GetEventSourceMapping * @see AWS * API Documentation */ @Override public CompletableFuture getEventSourceMapping( GetEventSourceMappingRequest getEventSourceMappingRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetEventSourceMappingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new GetEventSourceMappingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(getEventSourceMappingRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the configuration information of the Lambda function and a presigned URL link to the .zip file you * uploaded with CreateFunction so you can download the .zip file. Note that the URL is valid for up to 10 * minutes. The configuration information is the same information you provided as parameters when uploading the * function. *

*

* Use the Qualifier parameter to retrieve a published version of the function. Otherwise, returns the * unpublished version ($LATEST). For more information, see AWS Lambda Function Versioning and * Aliases. *

*

* This operation requires permission for the lambda:GetFunction action. *

* * @param getFunctionRequest * @return A Java Future containing the result of the GetFunction operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.GetFunction * @see AWS API * Documentation */ @Override public CompletableFuture getFunction(GetFunctionRequest getFunctionRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetFunctionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new GetFunctionRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(getFunctionRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the configuration information of the Lambda function. This the same information you provided as * parameters when uploading the function by using CreateFunction. *

*

* If you are using the versioning feature, you can retrieve this information for a specific function version by * using the optional Qualifier parameter and specifying the function version or alias that points to * it. If you don't provide it, the API returns information about the $LATEST version of the function. For more * information about versioning, see AWS Lambda Function Versioning and * Aliases. *

*

* This operation requires permission for the lambda:GetFunctionConfiguration operation. *

* * @param getFunctionConfigurationRequest * @return A Java Future containing the result of the GetFunctionConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.GetFunctionConfiguration * @see AWS API Documentation */ @Override public CompletableFuture getFunctionConfiguration( GetFunctionConfigurationRequest getFunctionConfigurationRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetFunctionConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler .execute(new ClientExecutionParams() .withMarshaller(new GetFunctionConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(getFunctionConfigurationRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the resource policy associated with the specified Lambda function. *

*

* This action requires permission for the lambda:GetPolicy action. *

* * @param getPolicyRequest * @return A Java Future containing the result of the GetPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.GetPolicy * @see AWS API * Documentation */ @Override public CompletableFuture getPolicy(GetPolicyRequest getPolicyRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetPolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new GetPolicyRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(getPolicyRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Invokes a Lambda function. For an example, see Create the Lambda Function and Test It Manually. *

*

* Specify just a function name to invoke the latest version of the function. To invoke a published version, use the * Qualifier parameter to specify a version or alias. *

*

* If you use the RequestResponse (synchronous) invocation option, the function will be invoked only * once. If you use the Event (asynchronous) invocation option, the function will be invoked at least * once in response to an event and the function must be idempotent to handle this. *

*

* For functions with a long timeout, your client may be disconnected during synchronous invocation while it waits * for a response. Configure your HTTP client, SDK, firewall, proxy, or operating system to allow for long * connections with timeout or keep-alive settings. *

*

* This operation requires permission for the lambda:InvokeFunction action. *

*

* The TooManyRequestsException noted below will return the following: * ConcurrentInvocationLimitExceeded will be returned if you have no functions with reserved * concurrency and have exceeded your account concurrent limit or if a function without reserved concurrency exceeds * the account's unreserved concurrency limit. ReservedFunctionConcurrentInvocationLimitExceeded will * be returned when a function with reserved concurrency exceeds its configured concurrency limit. *

* * @param invokeRequest * @return A Java Future containing the result of the Invoke operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidRequestContentException The request body could not be parsed as JSON.
  • *
  • RequestTooLargeException The request payload exceeded the Invoke request body JSON input * limit. For more information, see Limits.
  • *
  • UnsupportedMediaTypeException The content type of the Invoke request body is not JSON.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • Ec2UnexpectedException AWS Lambda received an unexpected EC2 client exception while setting up for * the Lambda function.
  • *
  • SubnetIpAddressLimitReachedException AWS Lambda was not able to set up VPC access for the Lambda * function because one or more configured subnets has no available IP addresses.
  • *
  • EniLimitReachedException AWS Lambda was not able to create an Elastic Network Interface (ENI) in the * VPC, specified as part of Lambda function configuration, because the limit for network interfaces has * been reached.
  • *
  • Ec2ThrottledException AWS Lambda was throttled by Amazon EC2 during Lambda function initialization * using the execution role provided for the Lambda function.
  • *
  • Ec2AccessDeniedException Need additional permissions to configure VPC settings.
  • *
  • InvalidSubnetIdException The Subnet ID provided in the Lambda function VPC configuration is invalid.
  • *
  • InvalidSecurityGroupIdException The Security Group ID provided in the Lambda function VPC * configuration is invalid.
  • *
  • InvalidZipFileException AWS Lambda could not unzip the deployment package.
  • *
  • KmsDisabledException Lambda was unable to decrypt the environment variables because the KMS key used * is disabled. Check the Lambda function's KMS key settings.
  • *
  • KmsInvalidStateException Lambda was unable to decrypt the environment variables because the KMS key * used is in an invalid state for Decrypt. Check the function's KMS key settings.
  • *
  • KmsAccessDeniedException Lambda was unable to decrypt the environment variables because KMS access * was denied. Check the Lambda function's KMS permissions.
  • *
  • KmsNotFoundException Lambda was unable to decrypt the environment variables because the KMS key was * not found. Check the function's KMS key settings.
  • *
  • InvalidRuntimeException The runtime or runtime version specified is not supported.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.Invoke * @see AWS API * Documentation */ @Override public CompletableFuture invoke(InvokeRequest invokeRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(false).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, InvokeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new InvokeRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(invokeRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns list of aliases created for a Lambda function. For each alias, the response includes information such as * the alias ARN, description, alias name, and the function version to which it points. For more information, see Introduction to AWS Lambda Aliases. *

*

* This requires permission for the lambda:ListAliases action. *

* * @param listAliasesRequest * @return A Java Future containing the result of the ListAliases operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.ListAliases * @see AWS API * Documentation */ @Override public CompletableFuture listAliases(ListAliasesRequest listAliasesRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListAliasesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new ListAliasesRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(listAliasesRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists event source mappings. Specify an EventSourceArn to only show event source mappings for a * single event source. *

* * @param listEventSourceMappingsRequest * @return A Java Future containing the result of the ListEventSourceMappings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.ListEventSourceMappings * @see AWS * API Documentation */ @Override public CompletableFuture listEventSourceMappings( ListEventSourceMappingsRequest listEventSourceMappingsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListEventSourceMappingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler .execute(new ClientExecutionParams() .withMarshaller(new ListEventSourceMappingsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(listEventSourceMappingsRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists event source mappings. Specify an EventSourceArn to only show event source mappings for a * single event source. *

*
*

* This is a variant of * {@link #listEventSourceMappings(software.amazon.awssdk.services.lambda.model.ListEventSourceMappingsRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.lambda.paginators.ListEventSourceMappingsPublisher publisher = client.listEventSourceMappingsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.lambda.paginators.ListEventSourceMappingsPublisher publisher = client.listEventSourceMappingsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.lambda.model.ListEventSourceMappingsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Note: If you prefer to have control on service calls, use the * {@link #listEventSourceMappings(software.amazon.awssdk.services.lambda.model.ListEventSourceMappingsRequest)} * operation. *

* * @param listEventSourceMappingsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.ListEventSourceMappings * @see AWS * API Documentation */ public ListEventSourceMappingsPublisher listEventSourceMappingsPaginator( ListEventSourceMappingsRequest listEventSourceMappingsRequest) { return new ListEventSourceMappingsPublisher(this, applyPaginatorUserAgent(listEventSourceMappingsRequest)); } /** *

* Returns a list of your Lambda functions. For each function, the response includes the function configuration * information. You must use GetFunction to retrieve the code for your function. *

*

* This operation requires permission for the lambda:ListFunctions action. *

*

* If you are using the versioning feature, you can list all of your functions or only $LATEST * versions. For information about the versioning feature, see AWS Lambda Function Versioning and * Aliases. *

* * @param listFunctionsRequest * @return A Java Future containing the result of the ListFunctions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.ListFunctions * @see AWS API * Documentation */ @Override public CompletableFuture listFunctions(ListFunctionsRequest listFunctionsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListFunctionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new ListFunctionsRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(listFunctionsRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of your Lambda functions. For each function, the response includes the function configuration * information. You must use GetFunction to retrieve the code for your function. *

*

* This operation requires permission for the lambda:ListFunctions action. *

*

* If you are using the versioning feature, you can list all of your functions or only $LATEST * versions. For information about the versioning feature, see AWS Lambda Function Versioning and * Aliases. *

*
*

* This is a variant of {@link #listFunctions(software.amazon.awssdk.services.lambda.model.ListFunctionsRequest)} * operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. * SDK will internally handle making service calls for you. *

*

* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet * and so there is no guarantee that the request is valid. If there are errors in your request, you will see the * failures only after you start streaming the data. The subscribe method should be called as a request to start * streaming data. For more info, see * {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe * method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the * starting request. *

* *

* The following are few ways to use the response class: *

* 1) Using the subscribe helper method * *
     * {@code
     * software.amazon.awssdk.services.lambda.paginators.ListFunctionsPublisher publisher = client.listFunctionsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.lambda.paginators.ListFunctionsPublisher publisher = client.listFunctionsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.lambda.model.ListFunctionsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Note: If you prefer to have control on service calls, use the * {@link #listFunctions(software.amazon.awssdk.services.lambda.model.ListFunctionsRequest)} operation. *

* * @param listFunctionsRequest * @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.ListFunctions * @see AWS API * Documentation */ public ListFunctionsPublisher listFunctionsPaginator(ListFunctionsRequest listFunctionsRequest) { return new ListFunctionsPublisher(this, applyPaginatorUserAgent(listFunctionsRequest)); } /** *

* Returns a list of tags assigned to a function when supplied the function ARN (Amazon Resource Name). For more * information on Tagging, see Tagging Lambda * Functions in the AWS Lambda Developer Guide. *

* * @param listTagsRequest * @return A Java Future containing the result of the ListTags operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.ListTags * @see AWS API * Documentation */ @Override public CompletableFuture listTags(ListTagsRequest listTagsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListTagsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new ListTagsRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(listTagsRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists all versions of a function. For information about versioning, see AWS Lambda Function Versioning and * Aliases. *

* * @param listVersionsByFunctionRequest * @return A Java Future containing the result of the ListVersionsByFunction operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.ListVersionsByFunction * @see AWS * API Documentation */ @Override public CompletableFuture listVersionsByFunction( ListVersionsByFunctionRequest listVersionsByFunctionRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListVersionsByFunctionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler .execute(new ClientExecutionParams() .withMarshaller(new ListVersionsByFunctionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(listVersionsByFunctionRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Publishes a version of your function from the current snapshot of $LATEST. That is, AWS Lambda takes a * snapshot of the function code and configuration information from $LATEST and publishes a new version. The code * and configuration cannot be modified after publication. For information about the versioning feature, see AWS Lambda Function Versioning and * Aliases. *

* * @param publishVersionRequest * @return A Java Future containing the result of the PublishVersion operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • CodeStorageExceededException You have exceeded your maximum total code size per account. Limits
  • *
  • PreconditionFailedException The RevisionId provided does not match the latest RevisionId for the * Lambda function or alias. Call the GetFunction or the GetAlias API to retrieve * the latest RevisionId for your resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.PublishVersion * @see AWS API * Documentation */ @Override public CompletableFuture publishVersion(PublishVersionRequest publishVersionRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, PublishVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new PublishVersionRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(publishVersionRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Sets a limit on the number of concurrent executions available to this function. It is a subset of your account's * total concurrent execution limit per region. Note that Lambda automatically reserves a buffer of 100 concurrent * executions for functions without any reserved concurrency limit. This means if your account limit is 1000, you * have a total of 900 available to allocate to individual functions. For more information, see Managing Concurrency. *

* * @param putFunctionConcurrencyRequest * @return A Java Future containing the result of the PutFunctionConcurrency operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.PutFunctionConcurrency * @see AWS * API Documentation */ @Override public CompletableFuture putFunctionConcurrency( PutFunctionConcurrencyRequest putFunctionConcurrencyRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, PutFunctionConcurrencyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler .execute(new ClientExecutionParams() .withMarshaller(new PutFunctionConcurrencyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(putFunctionConcurrencyRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Removes permissions from a function. You can remove individual permissions from an resource policy associated * with a Lambda function by providing a statement ID that you provided when you added the permission. When you * remove permissions, disable the event source mapping or trigger configuration first to avoid errors. *

*

* Permissions apply to the Amazon Resource Name (ARN) used to invoke the function, which can be unqualified (the * unpublished version of the function), or include a version or alias. If a client uses a version or alias to * invoke a function, use the Qualifier parameter to apply permissions to that ARN. For more * information about versioning, see AWS Lambda Function Versioning and * Aliases. *

*

* You need permission for the lambda:RemovePermission action. *

* * @param removePermissionRequest * @return A Java Future containing the result of the RemovePermission operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • PreconditionFailedException The RevisionId provided does not match the latest RevisionId for the * Lambda function or alias. Call the GetFunction or the GetAlias API to retrieve * the latest RevisionId for your resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.RemovePermission * @see AWS API * Documentation */ @Override public CompletableFuture removePermission(RemovePermissionRequest removePermissionRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RemovePermissionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new RemovePermissionRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(removePermissionRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a list of tags (key-value pairs) on the Lambda function. Requires the Lambda function ARN (Amazon * Resource Name). If a key is specified without a value, Lambda creates a tag with the specified key and a value of * null. For more information, see Tagging Lambda * Functions in the AWS Lambda Developer Guide. *

* * @param tagResourceRequest * @return A Java Future containing the result of the TagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.TagResource * @see AWS API * Documentation */ @Override public CompletableFuture tagResource(TagResourceRequest tagResourceRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, TagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new TagResourceRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(tagResourceRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Removes tags from a Lambda function. Requires the function ARN (Amazon Resource Name). For more information, see * Tagging Lambda Functions in the AWS * Lambda Developer Guide. *

* * @param untagResourceRequest * @return A Java Future containing the result of the UntagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.UntagResource * @see AWS API * Documentation */ @Override public CompletableFuture untagResource(UntagResourceRequest untagResourceRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UntagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(untagResourceRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Using this API you can update the function version to which the alias points and the alias description. For more * information, see Introduction to AWS * Lambda Aliases. *

*

* This requires permission for the lambda:UpdateAlias action. *

* * @param updateAliasRequest * @return A Java Future containing the result of the UpdateAlias operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • PreconditionFailedException The RevisionId provided does not match the latest RevisionId for the * Lambda function or alias. Call the GetFunction or the GetAlias API to retrieve * the latest RevisionId for your resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.UpdateAlias * @see AWS API * Documentation */ @Override public CompletableFuture updateAlias(UpdateAliasRequest updateAliasRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateAliasResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new UpdateAliasRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(updateAliasRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates an event source mapping. You can change the function that AWS Lambda invokes, or pause invocation and * resume later from the same location. *

* * @param updateEventSourceMappingRequest * @return A Java Future containing the result of the UpdateEventSourceMapping operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • ResourceConflictException The resource already exists.
  • *
  • ResourceInUseException The operation conflicts with the resource's availability. For example, you * attempted to update an EventSoure Mapping in CREATING, or tried to delete a EventSoure mapping currently * in the UPDATING state.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.UpdateEventSourceMapping * @see AWS API Documentation */ @Override public CompletableFuture updateEventSourceMapping( UpdateEventSourceMappingRequest updateEventSourceMappingRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateEventSourceMappingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler .execute(new ClientExecutionParams() .withMarshaller(new UpdateEventSourceMappingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(updateEventSourceMappingRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the code for the specified Lambda function. This operation must only be used on an existing Lambda * function and cannot be used to update the function configuration. *

*

* If you are using the versioning feature, note this API will always update the $LATEST version of your Lambda * function. For information about the versioning feature, see AWS Lambda Function Versioning and * Aliases. *

*

* This operation requires permission for the lambda:UpdateFunctionCode action. *

* * @param updateFunctionCodeRequest * @return A Java Future containing the result of the UpdateFunctionCode operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • CodeStorageExceededException You have exceeded your maximum total code size per account. Limits
  • *
  • PreconditionFailedException The RevisionId provided does not match the latest RevisionId for the * Lambda function or alias. Call the GetFunction or the GetAlias API to retrieve * the latest RevisionId for your resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.UpdateFunctionCode * @see AWS API * Documentation */ @Override public CompletableFuture updateFunctionCode(UpdateFunctionCodeRequest updateFunctionCodeRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateFunctionCodeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withMarshaller(new UpdateFunctionCodeRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(updateFunctionCodeRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the configuration parameters for the specified Lambda function by using the values provided in the * request. You provide only the parameters you want to change. This operation must only be used on an existing * Lambda function and cannot be used to update the function's code. *

*

* If you are using the versioning feature, note this API will always update the $LATEST version of your Lambda * function. For information about the versioning feature, see AWS Lambda Function Versioning and * Aliases. *

*

* This operation requires permission for the lambda:UpdateFunctionConfiguration action. *

* * @param updateFunctionConfigurationRequest * @return A Java Future containing the result of the UpdateFunctionConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ServiceException The AWS Lambda service encountered an internal error.
  • *
  • ResourceNotFoundException The resource (for example, a Lambda function or access policy statement) * specified in the request does not exist.
  • *
  • InvalidParameterValueException One of the parameters in the request is invalid. For example, if you * provided an IAM role for AWS Lambda to assume in the CreateFunction or the * UpdateFunctionConfiguration API, that AWS Lambda is unable to assume you will get this * exception.
  • *
  • TooManyRequestsException Request throughput limit exceeded
  • *
  • ResourceConflictException The resource already exists.
  • *
  • PreconditionFailedException The RevisionId provided does not match the latest RevisionId for the * Lambda function or alias. Call the GetFunction or the GetAlias API to retrieve * the latest RevisionId for your resource.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • LambdaException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample LambdaAsyncClient.UpdateFunctionConfiguration * @see AWS API Documentation */ @Override public CompletableFuture updateFunctionConfiguration( UpdateFunctionConfigurationRequest updateFunctionConfigurationRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateFunctionConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler .execute(new ClientExecutionParams() .withMarshaller(new UpdateFunctionConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(updateFunctionConfigurationRequest)); } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } @Override public void close() { clientHandler.close(); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(LambdaException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidParameterValueException") .exceptionBuilderSupplier(InvalidParameterValueException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("EC2AccessDeniedException") .exceptionBuilderSupplier(Ec2AccessDeniedException::builder).httpStatusCode(502).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceInUseException") .exceptionBuilderSupplier(ResourceInUseException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("KMSInvalidStateException") .exceptionBuilderSupplier(KmsInvalidStateException::builder).httpStatusCode(502).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("KMSNotFoundException") .exceptionBuilderSupplier(KmsNotFoundException::builder).httpStatusCode(502).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("PolicyLengthExceededException") .exceptionBuilderSupplier(PolicyLengthExceededException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceException") .exceptionBuilderSupplier(ServiceException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("SubnetIPAddressLimitReachedException") .exceptionBuilderSupplier(SubnetIpAddressLimitReachedException::builder).httpStatusCode(502) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidZipFileException") .exceptionBuilderSupplier(InvalidZipFileException::builder).httpStatusCode(502).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidRequestContentException") .exceptionBuilderSupplier(InvalidRequestContentException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidRuntimeException") .exceptionBuilderSupplier(InvalidRuntimeException::builder).httpStatusCode(502).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ENILimitReachedException") .exceptionBuilderSupplier(EniLimitReachedException::builder).httpStatusCode(502).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidSubnetIDException") .exceptionBuilderSupplier(InvalidSubnetIdException::builder).httpStatusCode(502).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceConflictException") .exceptionBuilderSupplier(ResourceConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("CodeStorageExceededException") .exceptionBuilderSupplier(CodeStorageExceededException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidSecurityGroupIDException") .exceptionBuilderSupplier(InvalidSecurityGroupIdException::builder).httpStatusCode(502).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("EC2ThrottledException") .exceptionBuilderSupplier(Ec2ThrottledException::builder).httpStatusCode(502).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("KMSAccessDeniedException") .exceptionBuilderSupplier(KmsAccessDeniedException::builder).httpStatusCode(502).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("KMSDisabledException") .exceptionBuilderSupplier(KmsDisabledException::builder).httpStatusCode(502).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("PreconditionFailedException") .exceptionBuilderSupplier(PreconditionFailedException::builder).httpStatusCode(412).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("EC2UnexpectedException") .exceptionBuilderSupplier(Ec2UnexpectedException::builder).httpStatusCode(502).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("RequestTooLargeException") .exceptionBuilderSupplier(RequestTooLargeException::builder).httpStatusCode(413).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TooManyRequestsException") .exceptionBuilderSupplier(TooManyRequestsException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UnsupportedMediaTypeException") .exceptionBuilderSupplier(UnsupportedMediaTypeException::builder).httpStatusCode(415).build()); } private T applyPaginatorUserAgent(T request) { Consumer userAgentApplier = b -> b.addApiName(ApiName.builder() .version(VersionInfo.SDK_VERSION).name("PAGINATED").build()); AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration() .map(c -> c.toBuilder().applyMutation(userAgentApplier).build()) .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build())); return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy