
software.amazon.awssdk.services.lambda.DefaultLambdaAsyncClient Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.lambda;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ScheduledExecutorService;
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.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
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.metrics.CoreMetric;
import software.amazon.awssdk.core.util.VersionInfo;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.lambda.model.AddLayerVersionPermissionRequest;
import software.amazon.awssdk.services.lambda.model.AddLayerVersionPermissionResponse;
import software.amazon.awssdk.services.lambda.model.AddPermissionRequest;
import software.amazon.awssdk.services.lambda.model.AddPermissionResponse;
import software.amazon.awssdk.services.lambda.model.CodeSigningConfigNotFoundException;
import software.amazon.awssdk.services.lambda.model.CodeStorageExceededException;
import software.amazon.awssdk.services.lambda.model.CodeVerificationFailedException;
import software.amazon.awssdk.services.lambda.model.CreateAliasRequest;
import software.amazon.awssdk.services.lambda.model.CreateAliasResponse;
import software.amazon.awssdk.services.lambda.model.CreateCodeSigningConfigRequest;
import software.amazon.awssdk.services.lambda.model.CreateCodeSigningConfigResponse;
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.DeleteCodeSigningConfigRequest;
import software.amazon.awssdk.services.lambda.model.DeleteCodeSigningConfigResponse;
import software.amazon.awssdk.services.lambda.model.DeleteEventSourceMappingRequest;
import software.amazon.awssdk.services.lambda.model.DeleteEventSourceMappingResponse;
import software.amazon.awssdk.services.lambda.model.DeleteFunctionCodeSigningConfigRequest;
import software.amazon.awssdk.services.lambda.model.DeleteFunctionCodeSigningConfigResponse;
import software.amazon.awssdk.services.lambda.model.DeleteFunctionConcurrencyRequest;
import software.amazon.awssdk.services.lambda.model.DeleteFunctionConcurrencyResponse;
import software.amazon.awssdk.services.lambda.model.DeleteFunctionEventInvokeConfigRequest;
import software.amazon.awssdk.services.lambda.model.DeleteFunctionEventInvokeConfigResponse;
import software.amazon.awssdk.services.lambda.model.DeleteFunctionRequest;
import software.amazon.awssdk.services.lambda.model.DeleteFunctionResponse;
import software.amazon.awssdk.services.lambda.model.DeleteLayerVersionRequest;
import software.amazon.awssdk.services.lambda.model.DeleteLayerVersionResponse;
import software.amazon.awssdk.services.lambda.model.DeleteProvisionedConcurrencyConfigRequest;
import software.amazon.awssdk.services.lambda.model.DeleteProvisionedConcurrencyConfigResponse;
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.EfsMountConnectivityException;
import software.amazon.awssdk.services.lambda.model.EfsMountFailureException;
import software.amazon.awssdk.services.lambda.model.EfsMountTimeoutException;
import software.amazon.awssdk.services.lambda.model.EfsioException;
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.GetCodeSigningConfigRequest;
import software.amazon.awssdk.services.lambda.model.GetCodeSigningConfigResponse;
import software.amazon.awssdk.services.lambda.model.GetEventSourceMappingRequest;
import software.amazon.awssdk.services.lambda.model.GetEventSourceMappingResponse;
import software.amazon.awssdk.services.lambda.model.GetFunctionCodeSigningConfigRequest;
import software.amazon.awssdk.services.lambda.model.GetFunctionCodeSigningConfigResponse;
import software.amazon.awssdk.services.lambda.model.GetFunctionConcurrencyRequest;
import software.amazon.awssdk.services.lambda.model.GetFunctionConcurrencyResponse;
import software.amazon.awssdk.services.lambda.model.GetFunctionConfigurationRequest;
import software.amazon.awssdk.services.lambda.model.GetFunctionConfigurationResponse;
import software.amazon.awssdk.services.lambda.model.GetFunctionEventInvokeConfigRequest;
import software.amazon.awssdk.services.lambda.model.GetFunctionEventInvokeConfigResponse;
import software.amazon.awssdk.services.lambda.model.GetFunctionRequest;
import software.amazon.awssdk.services.lambda.model.GetFunctionResponse;
import software.amazon.awssdk.services.lambda.model.GetLayerVersionByArnRequest;
import software.amazon.awssdk.services.lambda.model.GetLayerVersionByArnResponse;
import software.amazon.awssdk.services.lambda.model.GetLayerVersionPolicyRequest;
import software.amazon.awssdk.services.lambda.model.GetLayerVersionPolicyResponse;
import software.amazon.awssdk.services.lambda.model.GetLayerVersionRequest;
import software.amazon.awssdk.services.lambda.model.GetLayerVersionResponse;
import software.amazon.awssdk.services.lambda.model.GetPolicyRequest;
import software.amazon.awssdk.services.lambda.model.GetPolicyResponse;
import software.amazon.awssdk.services.lambda.model.GetProvisionedConcurrencyConfigRequest;
import software.amazon.awssdk.services.lambda.model.GetProvisionedConcurrencyConfigResponse;
import software.amazon.awssdk.services.lambda.model.InvalidCodeSignatureException;
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.ListCodeSigningConfigsRequest;
import software.amazon.awssdk.services.lambda.model.ListCodeSigningConfigsResponse;
import software.amazon.awssdk.services.lambda.model.ListEventSourceMappingsRequest;
import software.amazon.awssdk.services.lambda.model.ListEventSourceMappingsResponse;
import software.amazon.awssdk.services.lambda.model.ListFunctionEventInvokeConfigsRequest;
import software.amazon.awssdk.services.lambda.model.ListFunctionEventInvokeConfigsResponse;
import software.amazon.awssdk.services.lambda.model.ListFunctionsByCodeSigningConfigRequest;
import software.amazon.awssdk.services.lambda.model.ListFunctionsByCodeSigningConfigResponse;
import software.amazon.awssdk.services.lambda.model.ListFunctionsRequest;
import software.amazon.awssdk.services.lambda.model.ListFunctionsResponse;
import software.amazon.awssdk.services.lambda.model.ListLayerVersionsRequest;
import software.amazon.awssdk.services.lambda.model.ListLayerVersionsResponse;
import software.amazon.awssdk.services.lambda.model.ListLayersRequest;
import software.amazon.awssdk.services.lambda.model.ListLayersResponse;
import software.amazon.awssdk.services.lambda.model.ListProvisionedConcurrencyConfigsRequest;
import software.amazon.awssdk.services.lambda.model.ListProvisionedConcurrencyConfigsResponse;
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.ProvisionedConcurrencyConfigNotFoundException;
import software.amazon.awssdk.services.lambda.model.PublishLayerVersionRequest;
import software.amazon.awssdk.services.lambda.model.PublishLayerVersionResponse;
import software.amazon.awssdk.services.lambda.model.PublishVersionRequest;
import software.amazon.awssdk.services.lambda.model.PublishVersionResponse;
import software.amazon.awssdk.services.lambda.model.PutFunctionCodeSigningConfigRequest;
import software.amazon.awssdk.services.lambda.model.PutFunctionCodeSigningConfigResponse;
import software.amazon.awssdk.services.lambda.model.PutFunctionConcurrencyRequest;
import software.amazon.awssdk.services.lambda.model.PutFunctionConcurrencyResponse;
import software.amazon.awssdk.services.lambda.model.PutFunctionEventInvokeConfigRequest;
import software.amazon.awssdk.services.lambda.model.PutFunctionEventInvokeConfigResponse;
import software.amazon.awssdk.services.lambda.model.PutProvisionedConcurrencyConfigRequest;
import software.amazon.awssdk.services.lambda.model.PutProvisionedConcurrencyConfigResponse;
import software.amazon.awssdk.services.lambda.model.RemoveLayerVersionPermissionRequest;
import software.amazon.awssdk.services.lambda.model.RemoveLayerVersionPermissionResponse;
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.ResourceNotReadyException;
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.UpdateCodeSigningConfigRequest;
import software.amazon.awssdk.services.lambda.model.UpdateCodeSigningConfigResponse;
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.model.UpdateFunctionEventInvokeConfigRequest;
import software.amazon.awssdk.services.lambda.model.UpdateFunctionEventInvokeConfigResponse;
import software.amazon.awssdk.services.lambda.paginators.ListAliasesPublisher;
import software.amazon.awssdk.services.lambda.paginators.ListCodeSigningConfigsPublisher;
import software.amazon.awssdk.services.lambda.paginators.ListEventSourceMappingsPublisher;
import software.amazon.awssdk.services.lambda.paginators.ListFunctionEventInvokeConfigsPublisher;
import software.amazon.awssdk.services.lambda.paginators.ListFunctionsByCodeSigningConfigPublisher;
import software.amazon.awssdk.services.lambda.paginators.ListFunctionsPublisher;
import software.amazon.awssdk.services.lambda.paginators.ListLayerVersionsPublisher;
import software.amazon.awssdk.services.lambda.paginators.ListLayersPublisher;
import software.amazon.awssdk.services.lambda.paginators.ListProvisionedConcurrencyConfigsPublisher;
import software.amazon.awssdk.services.lambda.paginators.ListVersionsByFunctionPublisher;
import software.amazon.awssdk.services.lambda.transform.AddLayerVersionPermissionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.AddPermissionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.CreateAliasRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.CreateCodeSigningConfigRequestMarshaller;
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.DeleteCodeSigningConfigRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.DeleteEventSourceMappingRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.DeleteFunctionCodeSigningConfigRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.DeleteFunctionConcurrencyRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.DeleteFunctionEventInvokeConfigRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.DeleteFunctionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.DeleteLayerVersionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.DeleteProvisionedConcurrencyConfigRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetAccountSettingsRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetAliasRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetCodeSigningConfigRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetEventSourceMappingRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetFunctionCodeSigningConfigRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetFunctionConcurrencyRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetFunctionConfigurationRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetFunctionEventInvokeConfigRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetFunctionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetLayerVersionByArnRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetLayerVersionPolicyRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetLayerVersionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetPolicyRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.GetProvisionedConcurrencyConfigRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.InvokeRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListAliasesRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListCodeSigningConfigsRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListEventSourceMappingsRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListFunctionEventInvokeConfigsRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListFunctionsByCodeSigningConfigRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListFunctionsRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListLayerVersionsRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListLayersRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListProvisionedConcurrencyConfigsRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListTagsRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.ListVersionsByFunctionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.PublishLayerVersionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.PublishVersionRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.PutFunctionCodeSigningConfigRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.PutFunctionConcurrencyRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.PutFunctionEventInvokeConfigRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.PutProvisionedConcurrencyConfigRequestMarshaller;
import software.amazon.awssdk.services.lambda.transform.RemoveLayerVersionPermissionRequestMarshaller;
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.UpdateCodeSigningConfigRequestMarshaller;
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.services.lambda.transform.UpdateFunctionEventInvokeConfigRequestMarshaller;
import software.amazon.awssdk.services.lambda.waiters.LambdaAsyncWaiter;
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;
private final ScheduledExecutorService executorService;
protected DefaultLambdaAsyncClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
this.executorService = clientConfiguration.option(SdkClientOption.SCHEDULED_EXECUTOR_SERVICE);
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
/**
*
* Adds permissions to the resource-based policy of a version of an AWS Lambda layer. Use this
* action to grant layer usage permission to other accounts. You can grant permission to a single account, all AWS
* accounts, or all accounts in an organization.
*
*
* To revoke permission, call RemoveLayerVersionPermission with the statement ID that you specified when you
* added it.
*
*
* @param addLayerVersionPermissionRequest
* @return A Java Future containing the result of the AddLayerVersionPermission 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 specified in the request does not exist.
* - ResourceConflictException The resource already exists, or another operation is in progress.
* - TooManyRequestsException The request throughput limit was exceeded.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - PolicyLengthExceededException The permissions policy for the resource is too large. Learn more
* - 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.AddLayerVersionPermission
* @see AWS API Documentation
*/
@Override
public CompletableFuture addLayerVersionPermission(
AddLayerVersionPermissionRequest addLayerVersionPermissionRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, addLayerVersionPermissionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AddLayerVersionPermission");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AddLayerVersionPermissionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AddLayerVersionPermission")
.withMarshaller(new AddLayerVersionPermissionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(addLayerVersionPermissionRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = addLayerVersionPermissionRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Grants an AWS service or another account permission to use a function. You can apply the policy at the function
* level, or specify a qualifier to restrict access to a single version or alias. If you use a qualifier, the
* invoker must use the full Amazon Resource Name (ARN) of that version or alias to invoke the function.
*
*
* To grant permission to another account, specify the account ID as the Principal
. For AWS services,
* the principal is a domain-style identifier defined by the service, like s3.amazonaws.com
or
* sns.amazonaws.com
. For AWS services, you can also specify the ARN of the associated resource as the
* SourceArn
. If you grant permission to a service principal without specifying the source, other
* accounts could potentially configure resources in their account to invoke your Lambda function.
*
*
* This action adds a statement to a resource-based permissions policy for the function. For more information about
* function policies, see Lambda Function
* Policies.
*
*
* @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 specified in the request does not exist.
* - ResourceConflictException The resource already exists, or another operation is in progress.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - PolicyLengthExceededException The permissions policy for the resource is too large. Learn more
* - TooManyRequestsException The request throughput limit was 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, addPermissionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AddPermission");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AddPermissionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AddPermission")
.withMarshaller(new AddPermissionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(addPermissionRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = addPermissionRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates an alias for a Lambda
* function version. Use aliases to provide clients with a function identifier that you can update to invoke a
* different version.
*
*
* You can also map an alias to split invocation requests between two versions. Use the RoutingConfig
* parameter to specify a second version and the percentage of invocation requests that it receives.
*
*
* @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 specified in the request does not exist.
* - ResourceConflictException The resource already exists, or another operation is in progress.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - TooManyRequestsException The request throughput limit was 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createAliasRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAlias");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateAliasResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateAlias").withMarshaller(new CreateAliasRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createAliasRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = createAliasRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a code signing configuration. A code signing configuration
* defines a list of allowed signing profiles and defines the code-signing validation policy (action to be taken if
* deployment validation checks fail).
*
*
* @param createCodeSigningConfigRequest
* @return A Java Future containing the result of the CreateCodeSigningConfig 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.
* - 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.CreateCodeSigningConfig
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createCodeSigningConfig(
CreateCodeSigningConfigRequest createCodeSigningConfigRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createCodeSigningConfigRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCodeSigningConfig");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateCodeSigningConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateCodeSigningConfig")
.withMarshaller(new CreateCodeSigningConfigRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createCodeSigningConfigRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = createCodeSigningConfigRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
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.
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
*
*
* The following error handling options are only available for stream sources (DynamoDB and Kinesis):
*
*
* -
*
* BisectBatchOnFunctionError
- If the function returns an error, split the batch in two and retry.
*
*
* -
*
* DestinationConfig
- Send discarded records to an Amazon SQS queue or Amazon SNS topic.
*
*
* -
*
* MaximumRecordAgeInSeconds
- Discard records older than the specified age. The default value is
* infinite (-1). When set to infinite (-1), failed records are retried until the record expires
*
*
* -
*
* MaximumRetryAttempts
- Discard records after the specified number of retries. The default value is
* infinite (-1). When set to infinite (-1), failed records are retried until the record expires.
*
*
* -
*
* ParallelizationFactor
- Process multiple batches from each shard concurrently.
*
*
*
*
* @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.
* - ResourceConflictException The resource already exists, or another operation is in progress.
* - TooManyRequestsException The request throughput limit was exceeded.
* - ResourceNotFoundException The resource 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createEventSourceMappingRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateEventSourceMapping");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateEventSourceMappingResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateEventSourceMapping")
.withMarshaller(new CreateEventSourceMappingRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createEventSourceMappingRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = createEventSourceMappingRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a Lambda function. To create a function, you need a deployment package and an
* execution role. The deployment package is a .zip file archive or container image that contains your function
* code. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for
* log streaming and AWS X-Ray for request tracing.
*
*
* When you create a function, Lambda provisions an instance of the function and its supporting resources. If your
* function connects to a VPC, this process can take a minute or so. During this time, you can't invoke or modify
* the function. The State
, StateReason
, and StateReasonCode
fields in the
* response from GetFunctionConfiguration indicate when the function is ready to invoke. For more
* information, see Function
* States.
*
*
* A function has an unpublished version, and can have published versions and aliases. The unpublished version
* changes when you update your function's code and configuration. A published version is a snapshot of your
* function code and configuration that can't be changed. An alias is a named resource that maps to a version, and
* can be changed to map to a different version. Use the Publish
parameter to create version
* 1
of your function from its initial configuration.
*
*
* The other parameters let you configure version-specific and function-level settings. You can modify
* version-specific settings later with UpdateFunctionConfiguration. Function-level settings apply to both
* the unpublished and published versions of the function, and include tags (TagResource) and per-function
* concurrency limits (PutFunctionConcurrency).
*
*
* You can use code signing if your deployment package is a .zip file archive. To enable code signing for this
* function, specify the ARN of a code-signing configuration. When a user attempts to deploy a code package with
* UpdateFunctionCode, Lambda checks that the code package has a valid signature from a trusted publisher.
* The code-signing configuration includes set set of signing profiles, which define the trusted publishers for this
* function.
*
*
* If another account or an AWS service invokes your function, use AddPermission to grant permission by
* creating a resource-based IAM policy. You can grant permissions at the function level, on a version, or on an
* alias.
*
*
* To invoke your function directly, use Invoke. To invoke your function in response to events in other AWS
* services, create an event source mapping (CreateEventSourceMapping), or configure a function trigger in
* the other service. For more information, see Invoking Functions.
*
*
* @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.
* - ResourceNotFoundException The resource specified in the request does not exist.
* - ResourceConflictException The resource already exists, or another operation is in progress.
* - TooManyRequestsException The request throughput limit was exceeded.
* - CodeStorageExceededException You have exceeded your maximum total code size per account. Learn more
* - CodeVerificationFailedException The code signature failed one or more of the validation checks for
* signature mismatch or expiry, and the code signing policy is set to ENFORCE. Lambda blocks the
* deployment.
* - InvalidCodeSignatureException The code signature failed the integrity check. Lambda always blocks
* deployment if the integrity check fails, even if code signing policy is set to WARN.
* - CodeSigningConfigNotFoundException The specified code signing configuration 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.CreateFunction
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createFunction(CreateFunctionRequest createFunctionRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createFunctionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateFunction");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateFunctionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateFunction")
.withMarshaller(new CreateFunctionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createFunctionRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = createFunctionRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a Lambda function alias.
*
*
* @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.
* - ResourceConflictException The resource already exists, or another operation is in progress.
* - TooManyRequestsException The request throughput limit was 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAliasRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAlias");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteAliasResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteAlias").withMarshaller(new DeleteAliasRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteAliasRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteAliasRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the code signing configuration. You can delete the code signing configuration only if no function is
* using it.
*
*
* @param deleteCodeSigningConfigRequest
* @return A Java Future containing the result of the DeleteCodeSigningConfig 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.
* - ResourceNotFoundException The resource specified in the request does not exist.
* - ResourceConflictException The resource already exists, or another operation is in progress.
* - 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.DeleteCodeSigningConfig
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteCodeSigningConfig(
DeleteCodeSigningConfigRequest deleteCodeSigningConfigRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCodeSigningConfigRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCodeSigningConfig");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteCodeSigningConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteCodeSigningConfig")
.withMarshaller(new DeleteCodeSigningConfigRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteCodeSigningConfigRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteCodeSigningConfigRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes an event source
* mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.
*
*
* When you delete an event source mapping, it enters a Deleting
state and might not be completely
* deleted for several seconds.
*
*
* @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 specified in the request does not exist.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - TooManyRequestsException The request throughput limit was exceeded.
* - ResourceInUseException The operation conflicts with the resource's availability. For example, you
* attempted to update an EventSource Mapping in CREATING, or tried to delete a EventSource 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteEventSourceMappingRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteEventSourceMapping");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteEventSourceMappingResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteEventSourceMapping")
.withMarshaller(new DeleteEventSourceMappingRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteEventSourceMappingRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteEventSourceMappingRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
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.
*
*
* To delete Lambda event source mappings that invoke a function, use DeleteEventSourceMapping. For AWS
* services and resources that invoke your function directly, delete the trigger in the service where you originally
* configured it.
*
*
* @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 specified in the request does not exist.
* - TooManyRequestsException The request throughput limit was exceeded.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - ResourceConflictException The resource already exists, or another operation is in progress.
* - 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFunctionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFunction");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteFunctionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteFunction")
.withMarshaller(new DeleteFunctionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteFunctionRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteFunctionRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Removes the code signing configuration from the function.
*
*
* @param deleteFunctionCodeSigningConfigRequest
* @return A Java Future containing the result of the DeleteFunctionCodeSigningConfig operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - CodeSigningConfigNotFoundException The specified code signing configuration does not exist.
* - ResourceNotFoundException The resource specified in the request does not exist.
* - ServiceException The AWS Lambda service encountered an internal error.
* - TooManyRequestsException The request throughput limit was exceeded.
* - ResourceConflictException The resource already exists, or another operation is in progress.
* - 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.DeleteFunctionCodeSigningConfig
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteFunctionCodeSigningConfig(
DeleteFunctionCodeSigningConfigRequest deleteFunctionCodeSigningConfigRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteFunctionCodeSigningConfigRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFunctionCodeSigningConfig");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteFunctionCodeSigningConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteFunctionCodeSigningConfig")
.withMarshaller(new DeleteFunctionCodeSigningConfigRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteFunctionCodeSigningConfigRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteFunctionCodeSigningConfigRequest
.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Removes a concurrent execution limit from a function.
*
*
* @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 specified in the request does not exist.
* - TooManyRequestsException The request throughput limit was exceeded.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - ResourceConflictException The resource already exists, or another operation is in progress.
* - 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFunctionConcurrencyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFunctionConcurrency");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteFunctionConcurrencyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteFunctionConcurrency")
.withMarshaller(new DeleteFunctionConcurrencyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteFunctionConcurrencyRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteFunctionConcurrencyRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the configuration for asynchronous invocation for a function, version, or alias.
*
*
* To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
*
*
* @param deleteFunctionEventInvokeConfigRequest
* @return A Java Future containing the result of the DeleteFunctionEventInvokeConfig 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 specified in the request does not exist.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - TooManyRequestsException The request throughput limit was 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.DeleteFunctionEventInvokeConfig
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteFunctionEventInvokeConfig(
DeleteFunctionEventInvokeConfigRequest deleteFunctionEventInvokeConfigRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteFunctionEventInvokeConfigRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFunctionEventInvokeConfig");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteFunctionEventInvokeConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteFunctionEventInvokeConfig")
.withMarshaller(new DeleteFunctionEventInvokeConfigRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteFunctionEventInvokeConfigRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteFunctionEventInvokeConfigRequest
.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a version of an AWS
* Lambda layer. Deleted versions can no longer be viewed or added to functions. To avoid breaking functions, a
* copy of the version remains in Lambda until no functions refer to it.
*
*
* @param deleteLayerVersionRequest
* @return A Java Future containing the result of the DeleteLayerVersion 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 The request throughput limit was 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.DeleteLayerVersion
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteLayerVersion(DeleteLayerVersionRequest deleteLayerVersionRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteLayerVersionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteLayerVersion");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteLayerVersionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteLayerVersion")
.withMarshaller(new DeleteLayerVersionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteLayerVersionRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteLayerVersionRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the provisioned concurrency configuration for a function.
*
*
* @param deleteProvisionedConcurrencyConfigRequest
* @return A Java Future containing the result of the DeleteProvisionedConcurrencyConfig operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - ResourceConflictException The resource already exists, or another operation is in progress.
* - ResourceNotFoundException The resource specified in the request does not exist.
* - TooManyRequestsException The request throughput limit was 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.DeleteProvisionedConcurrencyConfig
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteProvisionedConcurrencyConfig(
DeleteProvisionedConcurrencyConfigRequest deleteProvisionedConcurrencyConfigRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteProvisionedConcurrencyConfigRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteProvisionedConcurrencyConfig");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DeleteProvisionedConcurrencyConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteProvisionedConcurrencyConfig")
.withMarshaller(new DeleteProvisionedConcurrencyConfigRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteProvisionedConcurrencyConfigRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteProvisionedConcurrencyConfigRequest
.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves details about your account's limits and usage in an AWS 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 The request throughput limit was 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getAccountSettingsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAccountSettings");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetAccountSettingsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetAccountSettings")
.withMarshaller(new GetAccountSettingsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getAccountSettingsRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getAccountSettingsRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns details about a Lambda function alias.
*
*
* @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 specified in the request does not exist.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - TooManyRequestsException The request throughput limit was 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getAliasRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAlias");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetAliasResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("GetAlias")
.withMarshaller(new GetAliasRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector)
.withInput(getAliasRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getAliasRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns information about the specified code signing configuration.
*
*
* @param getCodeSigningConfigRequest
* @return A Java Future containing the result of the GetCodeSigningConfig 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.
* - ResourceNotFoundException The resource 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.GetCodeSigningConfig
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getCodeSigningConfig(
GetCodeSigningConfigRequest getCodeSigningConfigRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getCodeSigningConfigRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCodeSigningConfig");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetCodeSigningConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetCodeSigningConfig")
.withMarshaller(new GetCodeSigningConfigRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getCodeSigningConfigRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getCodeSigningConfigRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns details about an event source mapping. You can get the identifier of a mapping from the output of
* ListEventSourceMappings.
*
*
* @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 specified in the request does not exist.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - TooManyRequestsException The request throughput limit was 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getEventSourceMappingRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetEventSourceMapping");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetEventSourceMappingResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetEventSourceMapping")
.withMarshaller(new GetEventSourceMappingRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getEventSourceMappingRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getEventSourceMappingRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns information about the function or function version, with a link to download the deployment package that's
* valid for 10 minutes. If you specify a function version, only details that are specific to that version are
* returned.
*
*
* @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 specified in the request does not exist.
* - TooManyRequestsException The request throughput limit was exceeded.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getFunctionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetFunction");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetFunctionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetFunction").withMarshaller(new GetFunctionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getFunctionRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getFunctionRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the code signing configuration for the specified function.
*
*
* @param getFunctionCodeSigningConfigRequest
* @return A Java Future containing the result of the GetFunctionCodeSigningConfig operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - ResourceNotFoundException The resource specified in the request does not exist.
* - ServiceException The AWS Lambda service encountered an internal error.
* - TooManyRequestsException The request throughput limit was 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.GetFunctionCodeSigningConfig
* @see AWS API Documentation
*/
@Override
public CompletableFuture getFunctionCodeSigningConfig(
GetFunctionCodeSigningConfigRequest getFunctionCodeSigningConfigRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getFunctionCodeSigningConfigRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetFunctionCodeSigningConfig");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetFunctionCodeSigningConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetFunctionCodeSigningConfig")
.withMarshaller(new GetFunctionCodeSigningConfigRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getFunctionCodeSigningConfigRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getFunctionCodeSigningConfigRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns details about the reserved concurrency configuration for a function. To set a concurrency limit for a
* function, use PutFunctionConcurrency.
*
*
* @param getFunctionConcurrencyRequest
* @return A Java Future containing the result of the GetFunctionConcurrency operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - ResourceNotFoundException The resource specified in the request does not exist.
* - TooManyRequestsException The request throughput limit was 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.GetFunctionConcurrency
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getFunctionConcurrency(
GetFunctionConcurrencyRequest getFunctionConcurrencyRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getFunctionConcurrencyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetFunctionConcurrency");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetFunctionConcurrencyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetFunctionConcurrency")
.withMarshaller(new GetFunctionConcurrencyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getFunctionConcurrencyRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getFunctionConcurrencyRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the version-specific settings of a Lambda function or version. The output includes only options that can
* vary between versions of a function. To modify these settings, use UpdateFunctionConfiguration.
*
*
* To get all of a function's details, including function-level settings, use GetFunction.
*
*
* @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 specified in the request does not exist.
* - TooManyRequestsException The request throughput limit was exceeded.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getFunctionConfigurationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetFunctionConfiguration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetFunctionConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetFunctionConfiguration")
.withMarshaller(new GetFunctionConfigurationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getFunctionConfigurationRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getFunctionConfigurationRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves the configuration for asynchronous invocation for a function, version, or alias.
*
*
* To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
*
*
* @param getFunctionEventInvokeConfigRequest
* @return A Java Future containing the result of the GetFunctionEventInvokeConfig 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 specified in the request does not exist.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - TooManyRequestsException The request throughput limit was 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.GetFunctionEventInvokeConfig
* @see AWS API Documentation
*/
@Override
public CompletableFuture getFunctionEventInvokeConfig(
GetFunctionEventInvokeConfigRequest getFunctionEventInvokeConfigRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getFunctionEventInvokeConfigRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetFunctionEventInvokeConfig");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetFunctionEventInvokeConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetFunctionEventInvokeConfig")
.withMarshaller(new GetFunctionEventInvokeConfigRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getFunctionEventInvokeConfigRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getFunctionEventInvokeConfigRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns information about a version of an AWS Lambda layer, with a link
* to download the layer archive that's valid for 10 minutes.
*
*
* @param getLayerVersionRequest
* @return A Java Future containing the result of the GetLayerVersion 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.
* - TooManyRequestsException The request throughput limit was exceeded.
* - ResourceNotFoundException The resource 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.GetLayerVersion
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getLayerVersion(GetLayerVersionRequest getLayerVersionRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getLayerVersionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetLayerVersion");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetLayerVersionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetLayerVersion")
.withMarshaller(new GetLayerVersionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getLayerVersionRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getLayerVersionRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns information about a version of an AWS Lambda layer, with a link
* to download the layer archive that's valid for 10 minutes.
*
*
* @param getLayerVersionByArnRequest
* @return A Java Future containing the result of the GetLayerVersionByArn 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.
* - TooManyRequestsException The request throughput limit was exceeded.
* - ResourceNotFoundException The resource 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.GetLayerVersionByArn
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getLayerVersionByArn(
GetLayerVersionByArnRequest getLayerVersionByArnRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getLayerVersionByArnRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetLayerVersionByArn");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetLayerVersionByArnResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetLayerVersionByArn")
.withMarshaller(new GetLayerVersionByArnRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getLayerVersionByArnRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getLayerVersionByArnRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the permission policy for a version of an AWS Lambda layer. For more
* information, see AddLayerVersionPermission.
*
*
* @param getLayerVersionPolicyRequest
* @return A Java Future containing the result of the GetLayerVersionPolicy 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 specified in the request does not exist.
* - TooManyRequestsException The request throughput limit was exceeded.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - 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.GetLayerVersionPolicy
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getLayerVersionPolicy(
GetLayerVersionPolicyRequest getLayerVersionPolicyRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getLayerVersionPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetLayerVersionPolicy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetLayerVersionPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetLayerVersionPolicy")
.withMarshaller(new GetLayerVersionPolicyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getLayerVersionPolicyRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getLayerVersionPolicyRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the resource-based IAM
* policy for a function, version, or alias.
*
*
* @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 specified in the request does not exist.
* - TooManyRequestsException The request throughput limit was exceeded.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetPolicy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("GetPolicy")
.withMarshaller(new GetPolicyRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector)
.withInput(getPolicyRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getPolicyRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves the provisioned concurrency configuration for a function's alias or version.
*
*
* @param getProvisionedConcurrencyConfigRequest
* @return A Java Future containing the result of the GetProvisionedConcurrencyConfig operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - ResourceNotFoundException The resource specified in the request does not exist.
* - TooManyRequestsException The request throughput limit was exceeded.
* - ServiceException The AWS Lambda service encountered an internal error.
* - ProvisionedConcurrencyConfigNotFoundException The specified configuration 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.GetProvisionedConcurrencyConfig
* @see AWS API Documentation
*/
@Override
public CompletableFuture getProvisionedConcurrencyConfig(
GetProvisionedConcurrencyConfigRequest getProvisionedConcurrencyConfigRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getProvisionedConcurrencyConfigRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetProvisionedConcurrencyConfig");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetProvisionedConcurrencyConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetProvisionedConcurrencyConfig")
.withMarshaller(new GetProvisionedConcurrencyConfigRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getProvisionedConcurrencyConfigRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getProvisionedConcurrencyConfigRequest
.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Invokes a Lambda function. You can invoke a function synchronously (and wait for the response), or
* asynchronously. To invoke a function asynchronously, set InvocationType
to Event
.
*
*
* For synchronous invocation,
* details about the function response, including errors, are included in the response body and headers. For either
* invocation type, you can find more information in the execution log and trace.
*
*
* When an error occurs, your function may be invoked multiple times. Retry behavior varies by error type, client,
* event source, and invocation type. For example, if you invoke a function asynchronously and it returns an error,
* Lambda executes the function up to two more times. For more information, see Retry Behavior.
*
*
* For asynchronous invocation,
* Lambda adds events to a queue before sending them to your function. If your function does not have enough
* capacity to keep up with the queue, events may be lost. Occasionally, your function may receive the same event
* multiple times, even if no error occurs. To retain events that were not processed, configure your function with a
* dead-letter queue.
*
*
* The status code in the API response doesn't reflect function errors. Error codes are reserved for errors that
* prevent your function from executing, such as permissions errors, limit errors, or issues with your function's
* code and configuration. For example, Lambda returns TooManyRequestsException
if executing the
* function would cause you to exceed a concurrency limit at either the account level (
* ConcurrentInvocationLimitExceeded
) or function level (
* ReservedFunctionConcurrentInvocationLimitExceeded
).
*
*
* For functions with a long timeout, your client might 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.
*
*
* @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 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 The request throughput limit was exceeded.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - 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 in the VPC,
* specified as part of Lambda function configuration, because the limit for network interfaces has been
* reached.
* - EfsMountConnectivityException The function couldn't make a network connection to the configured file
* system.
* - EfsMountFailureException The function couldn't mount the configured file system due to a permission
* or configuration issue.
* - EfsMountTimeoutException The function was able to make a network connection to the configured file
* system, but the mount operation timed out.
* - EfsioException An error occured when reading from or writing to a connected file system.
* - 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.
* - ResourceConflictException The resource already exists, or another operation is in progress.
* - ResourceNotReadyException The function is inactive and its VPC connection is no longer available.
* Wait for the VPC connection to reestablish and try again.
* - 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, invokeRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "Invoke");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(false).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
InvokeResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("Invoke")
.withMarshaller(new InvokeRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector)
.withInput(invokeRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = invokeRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns a list of aliases for
* a Lambda function.
*
*
* @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 specified in the request does not exist.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - TooManyRequestsException The request throughput limit was 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listAliasesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAliases");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListAliasesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListAliases").withMarshaller(new ListAliasesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listAliasesRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listAliasesRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns a list of aliases for
* a Lambda function.
*
*
*
* This is a variant of {@link #listAliases(software.amazon.awssdk.services.lambda.model.ListAliasesRequest)}
* 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.ListAliasesPublisher publisher = client.listAliasesPaginator(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.ListAliasesPublisher publisher = client.listAliasesPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.lambda.model.ListAliasesResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of MaxItems won't limit the number of results you get with the paginator.
* It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listAliases(software.amazon.awssdk.services.lambda.model.ListAliasesRequest)} operation.
*
*
* @param listAliasesRequest
* @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 specified in the request does not exist.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - TooManyRequestsException The request throughput limit was 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
*/
public ListAliasesPublisher listAliasesPaginator(ListAliasesRequest listAliasesRequest) {
return new ListAliasesPublisher(this, applyPaginatorUserAgent(listAliasesRequest));
}
/**
*
* Returns a list of code
* signing configurations. A request returns up to 10,000 configurations per call. You can use the
* MaxItems
parameter to return fewer configurations per call.
*
*
* @param listCodeSigningConfigsRequest
* @return A Java Future containing the result of the ListCodeSigningConfigs 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.
* - 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.ListCodeSigningConfigs
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listCodeSigningConfigs(
ListCodeSigningConfigsRequest listCodeSigningConfigsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listCodeSigningConfigsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCodeSigningConfigs");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListCodeSigningConfigsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListCodeSigningConfigs")
.withMarshaller(new ListCodeSigningConfigsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listCodeSigningConfigsRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listCodeSigningConfigsRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns a list of code
* signing configurations. A request returns up to 10,000 configurations per call. You can use the
* MaxItems
parameter to return fewer configurations per call.
*
*
*
* This is a variant of
* {@link #listCodeSigningConfigs(software.amazon.awssdk.services.lambda.model.ListCodeSigningConfigsRequest)}
* 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.ListCodeSigningConfigsPublisher publisher = client.listCodeSigningConfigsPaginator(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.ListCodeSigningConfigsPublisher publisher = client.listCodeSigningConfigsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.lambda.model.ListCodeSigningConfigsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of MaxItems won't limit the number of results you get with the paginator.
* It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listCodeSigningConfigs(software.amazon.awssdk.services.lambda.model.ListCodeSigningConfigsRequest)}
* operation.
*
*
* @param listCodeSigningConfigsRequest
* @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.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - 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.ListCodeSigningConfigs
* @see AWS
* API Documentation
*/
public ListCodeSigningConfigsPublisher listCodeSigningConfigsPaginator(
ListCodeSigningConfigsRequest listCodeSigningConfigsRequest) {
return new ListCodeSigningConfigsPublisher(this, applyPaginatorUserAgent(listCodeSigningConfigsRequest));
}
/**
*
* 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 specified in the request does not exist.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - TooManyRequestsException The request throughput limit was 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listEventSourceMappingsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListEventSourceMappings");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListEventSourceMappingsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListEventSourceMappings")
.withMarshaller(new ListEventSourceMappingsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listEventSourceMappingsRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listEventSourceMappingsRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
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.
*
* Please notice that the configuration of MaxItems won't limit the number of results you get with the paginator.
* It only limits the number of results in each page.
*
*
* 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 specified in the request does not exist.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - TooManyRequestsException The request throughput limit was 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));
}
/**
*
* Retrieves a list of configurations for asynchronous invocation for a function.
*
*
* To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
*
*
* @param listFunctionEventInvokeConfigsRequest
* @return A Java Future containing the result of the ListFunctionEventInvokeConfigs operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - ResourceNotFoundException The resource specified in the request does not exist.
* - TooManyRequestsException The request throughput limit was 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.ListFunctionEventInvokeConfigs
* @see AWS API Documentation
*/
@Override
public CompletableFuture listFunctionEventInvokeConfigs(
ListFunctionEventInvokeConfigsRequest listFunctionEventInvokeConfigsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listFunctionEventInvokeConfigsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListFunctionEventInvokeConfigs");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListFunctionEventInvokeConfigsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListFunctionEventInvokeConfigs")
.withMarshaller(new ListFunctionEventInvokeConfigsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listFunctionEventInvokeConfigsRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listFunctionEventInvokeConfigsRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves a list of configurations for asynchronous invocation for a function.
*
*
* To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
*
*
*
* This is a variant of
* {@link #listFunctionEventInvokeConfigs(software.amazon.awssdk.services.lambda.model.ListFunctionEventInvokeConfigsRequest)}
* 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.ListFunctionEventInvokeConfigsPublisher publisher = client.listFunctionEventInvokeConfigsPaginator(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.ListFunctionEventInvokeConfigsPublisher publisher = client.listFunctionEventInvokeConfigsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.lambda.model.ListFunctionEventInvokeConfigsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of MaxItems won't limit the number of results you get with the paginator.
* It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listFunctionEventInvokeConfigs(software.amazon.awssdk.services.lambda.model.ListFunctionEventInvokeConfigsRequest)}
* operation.
*
*
* @param listFunctionEventInvokeConfigsRequest
* @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.
*
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - ResourceNotFoundException The resource specified in the request does not exist.
* - TooManyRequestsException The request throughput limit was 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.ListFunctionEventInvokeConfigs
* @see AWS API Documentation
*/
public ListFunctionEventInvokeConfigsPublisher listFunctionEventInvokeConfigsPaginator(
ListFunctionEventInvokeConfigsRequest listFunctionEventInvokeConfigsRequest) {
return new ListFunctionEventInvokeConfigsPublisher(this, applyPaginatorUserAgent(listFunctionEventInvokeConfigsRequest));
}
/**
*
* Returns a list of Lambda functions, with the version-specific configuration of each. Lambda returns up to 50
* functions per call.
*
*
* Set FunctionVersion
to ALL
to include all published versions of each function in
* addition to the unpublished version. To get more information about a function or version, use GetFunction.
*
*
* @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 The request throughput limit was exceeded.
* - InvalidParameterValueException One of the parameters in the request is invalid.
* - 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) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listFunctionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListFunctions");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListFunctionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListFunctions")
.withMarshaller(new ListFunctionsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listFunctionsRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listFunctionsRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* List the functions that use the specified code signing configuration. You can use this method prior to deleting a
* code signing configuration, to verify that no functions are using it.
*
*
* @param listFunctionsByCodeSigningConfigRequest
* @return A Java Future containing the result of the ListFunctionsByCodeSigningConfig 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.
* - ResourceNotFoundException The resource 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.ListFunctionsByCodeSigningConfig
* @see AWS API Documentation
*/
@Override
public CompletableFuture listFunctionsByCodeSigningConfig(
ListFunctionsByCodeSigningConfigRequest listFunctionsByCodeSigningConfigRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listFunctionsByCodeSigningConfigRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListFunctionsByCodeSigningConfig");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, ListFunctionsByCodeSigningConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams