
software.amazon.awssdk.services.lambda.DefaultLambdaClient 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.function.Consumer;
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.AwsSyncClientHandler;
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.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
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.ListAliasesIterable;
import software.amazon.awssdk.services.lambda.paginators.ListCodeSigningConfigsIterable;
import software.amazon.awssdk.services.lambda.paginators.ListEventSourceMappingsIterable;
import software.amazon.awssdk.services.lambda.paginators.ListFunctionEventInvokeConfigsIterable;
import software.amazon.awssdk.services.lambda.paginators.ListFunctionsByCodeSigningConfigIterable;
import software.amazon.awssdk.services.lambda.paginators.ListFunctionsIterable;
import software.amazon.awssdk.services.lambda.paginators.ListLayerVersionsIterable;
import software.amazon.awssdk.services.lambda.paginators.ListLayersIterable;
import software.amazon.awssdk.services.lambda.paginators.ListProvisionedConcurrencyConfigsIterable;
import software.amazon.awssdk.services.lambda.paginators.ListVersionsByFunctionIterable;
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.LambdaWaiter;
import software.amazon.awssdk.utils.Logger;
/**
* Internal implementation of {@link LambdaClient}.
*
* @see LambdaClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultLambdaClient implements LambdaClient {
private static final Logger log = Logger.loggerFor(DefaultLambdaClient.class);
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultLambdaClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
/**
*
* Adds permissions to the resource-based policy of a version of an Lambda layer. Use this action
* to grant layer usage permission to other accounts. You can grant permission to a single account, all accounts in
* an organization, or all Amazon Web Services accounts.
*
*
* To revoke permission, call RemoveLayerVersionPermission with the statement ID that you specified when you
* added it.
*
*
* @param addLayerVersionPermissionRequest
* @return Result of the AddLayerVersionPermission operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws PolicyLengthExceededException
* The permissions policy for the resource is too large. Learn more
* @throws 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.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.AddLayerVersionPermission
* @see AWS API Documentation
*/
@Override
public AddLayerVersionPermissionResponse addLayerVersionPermission(
AddLayerVersionPermissionRequest addLayerVersionPermissionRequest) throws ServiceException,
ResourceNotFoundException, ResourceConflictException, TooManyRequestsException, InvalidParameterValueException,
PolicyLengthExceededException, PreconditionFailedException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AddLayerVersionPermissionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AddLayerVersionPermission").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(addLayerVersionPermissionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AddLayerVersionPermissionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Grants an Amazon Web Services 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 Amazon Web
* Services services, the principal is a domain-style identifier defined by the service, like
* s3.amazonaws.com
or sns.amazonaws.com
. For Amazon Web Services 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 Result of the AddPermission operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws PolicyLengthExceededException
* The permissions policy for the resource is too large. Learn more
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws 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.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.AddPermission
* @see AWS API
* Documentation
*/
@Override
public AddPermissionResponse addPermission(AddPermissionRequest addPermissionRequest) throws ServiceException,
ResourceNotFoundException, ResourceConflictException, InvalidParameterValueException, PolicyLengthExceededException,
TooManyRequestsException, PreconditionFailedException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AddPermissionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AddPermission").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(addPermissionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AddPermissionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CreateAlias operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.CreateAlias
* @see AWS API
* Documentation
*/
@Override
public CreateAliasResponse createAlias(CreateAliasRequest createAliasRequest) throws ServiceException,
ResourceNotFoundException, ResourceConflictException, InvalidParameterValueException, TooManyRequestsException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateAliasResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateAlias").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createAliasRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateAliasRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CreateCodeSigningConfig operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.CreateCodeSigningConfig
* @see AWS API Documentation
*/
@Override
public CreateCodeSigningConfigResponse createCodeSigningConfig(CreateCodeSigningConfigRequest createCodeSigningConfigRequest)
throws ServiceException, InvalidParameterValueException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateCodeSigningConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateCodeSigningConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createCodeSigningConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateCodeSigningConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a mapping between an event source and an Lambda function. Lambda reads items from the event source and
* triggers the function.
*
*
* For details about each event source type, see the following topics. In particular, each of the topics describes
* the required and optional parameters for the specific event source.
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
*
* -
*
* Configuring Self-Managed Apache Kafka as
* an event source
*
*
*
*
* 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 Result of the CreateEventSourceMapping operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.CreateEventSourceMapping
* @see AWS API Documentation
*/
@Override
public CreateEventSourceMappingResponse createEventSourceMapping(
CreateEventSourceMappingRequest createEventSourceMappingRequest) throws ServiceException,
InvalidParameterValueException, ResourceConflictException, TooManyRequestsException, ResourceNotFoundException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateEventSourceMappingResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateEventSourceMapping").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createEventSourceMappingRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateEventSourceMappingRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Amazon Web Services services, such as Amazon
* CloudWatch Logs for log streaming and X-Ray for request tracing.
*
*
* You set the package type to Image
if the deployment package is a container image. For a container
* image, the code property must include the URI of a container image in the Amazon ECR registry. You do not need to
* specify the handler and runtime properties.
*
*
* You set the package type to Zip
if the deployment package is a .zip
* file archive. For a .zip file archive, the code property specifies the location of the .zip file. You must
* also specify the handler and runtime properties.
*
*
* 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 Amazon Web Services 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
* Amazon Web Services 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 Result of the CreateFunction operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws CodeStorageExceededException
* You have exceeded your maximum total code size per account. Learn more
* @throws 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.
* @throws 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.
* @throws CodeSigningConfigNotFoundException
* The specified code signing configuration does not exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.CreateFunction
* @see AWS API
* Documentation
*/
@Override
public CreateFunctionResponse createFunction(CreateFunctionRequest createFunctionRequest) throws ServiceException,
InvalidParameterValueException, ResourceNotFoundException, ResourceConflictException, TooManyRequestsException,
CodeStorageExceededException, CodeVerificationFailedException, InvalidCodeSignatureException,
CodeSigningConfigNotFoundException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateFunctionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateFunction").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createFunctionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateFunctionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a Lambda function alias.
*
*
* @param deleteAliasRequest
* @return Result of the DeleteAlias operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.DeleteAlias
* @see AWS API
* Documentation
*/
@Override
public DeleteAliasResponse deleteAlias(DeleteAliasRequest deleteAliasRequest) throws ServiceException,
InvalidParameterValueException, ResourceConflictException, TooManyRequestsException, AwsServiceException,
SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteAliasResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteAlias").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteAliasRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteAliasRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the code signing configuration. You can delete the code signing configuration only if no function is
* using it.
*
*
* @param deleteCodeSigningConfigRequest
* @return Result of the DeleteCodeSigningConfig operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.DeleteCodeSigningConfig
* @see AWS API Documentation
*/
@Override
public DeleteCodeSigningConfigResponse deleteCodeSigningConfig(DeleteCodeSigningConfigRequest deleteCodeSigningConfigRequest)
throws ServiceException, InvalidParameterValueException, ResourceNotFoundException, ResourceConflictException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteCodeSigningConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteCodeSigningConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteCodeSigningConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteCodeSigningConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DeleteEventSourceMapping operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws 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.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.DeleteEventSourceMapping
* @see AWS API Documentation
*/
@Override
public DeleteEventSourceMappingResponse deleteEventSourceMapping(
DeleteEventSourceMappingRequest deleteEventSourceMappingRequest) throws ServiceException, ResourceNotFoundException,
InvalidParameterValueException, TooManyRequestsException, ResourceInUseException, AwsServiceException,
SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteEventSourceMappingResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteEventSourceMapping").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteEventSourceMappingRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteEventSourceMappingRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Amazon
* Web Services services and resources that invoke your function directly, delete the trigger in the service where
* you originally configured it.
*
*
* @param deleteFunctionRequest
* @return Result of the DeleteFunction operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.DeleteFunction
* @see AWS API
* Documentation
*/
@Override
public DeleteFunctionResponse deleteFunction(DeleteFunctionRequest deleteFunctionRequest) throws ServiceException,
ResourceNotFoundException, TooManyRequestsException, InvalidParameterValueException, ResourceConflictException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteFunctionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteFunction").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteFunctionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteFunctionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes the code signing configuration from the function.
*
*
* @param deleteFunctionCodeSigningConfigRequest
* @return Result of the DeleteFunctionCodeSigningConfig operation returned by the service.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws CodeSigningConfigNotFoundException
* The specified code signing configuration does not exist.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.DeleteFunctionCodeSigningConfig
* @see AWS API Documentation
*/
@Override
public DeleteFunctionCodeSigningConfigResponse deleteFunctionCodeSigningConfig(
DeleteFunctionCodeSigningConfigRequest deleteFunctionCodeSigningConfigRequest) throws InvalidParameterValueException,
CodeSigningConfigNotFoundException, ResourceNotFoundException, ServiceException, TooManyRequestsException,
ResourceConflictException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteFunctionCodeSigningConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteFunctionCodeSigningConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteFunctionCodeSigningConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteFunctionCodeSigningConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes a concurrent execution limit from a function.
*
*
* @param deleteFunctionConcurrencyRequest
* @return Result of the DeleteFunctionConcurrency operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.DeleteFunctionConcurrency
* @see AWS API Documentation
*/
@Override
public DeleteFunctionConcurrencyResponse deleteFunctionConcurrency(
DeleteFunctionConcurrencyRequest deleteFunctionConcurrencyRequest) throws ServiceException,
ResourceNotFoundException, TooManyRequestsException, InvalidParameterValueException, ResourceConflictException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteFunctionConcurrencyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteFunctionConcurrency").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteFunctionConcurrencyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteFunctionConcurrencyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the configuration for asynchronous invocation for a function, version, or alias.
*
*
* To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
*
*
* @param deleteFunctionEventInvokeConfigRequest
* @return Result of the DeleteFunctionEventInvokeConfig operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.DeleteFunctionEventInvokeConfig
* @see AWS API Documentation
*/
@Override
public DeleteFunctionEventInvokeConfigResponse deleteFunctionEventInvokeConfig(
DeleteFunctionEventInvokeConfigRequest deleteFunctionEventInvokeConfigRequest) throws ServiceException,
ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException, ResourceConflictException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteFunctionEventInvokeConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteFunctionEventInvokeConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteFunctionEventInvokeConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteFunctionEventInvokeConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a version of an 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 Result of the DeleteLayerVersion operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.DeleteLayerVersion
* @see AWS API
* Documentation
*/
@Override
public DeleteLayerVersionResponse deleteLayerVersion(DeleteLayerVersionRequest deleteLayerVersionRequest)
throws ServiceException, TooManyRequestsException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteLayerVersionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteLayerVersion").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteLayerVersionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteLayerVersionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the provisioned concurrency configuration for a function.
*
*
* @param deleteProvisionedConcurrencyConfigRequest
* @return Result of the DeleteProvisionedConcurrencyConfig operation returned by the service.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.DeleteProvisionedConcurrencyConfig
* @see AWS API Documentation
*/
@Override
public DeleteProvisionedConcurrencyConfigResponse deleteProvisionedConcurrencyConfig(
DeleteProvisionedConcurrencyConfigRequest deleteProvisionedConcurrencyConfigRequest)
throws InvalidParameterValueException, ResourceConflictException, ResourceNotFoundException,
TooManyRequestsException, ServiceException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteProvisionedConcurrencyConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteProvisionedConcurrencyConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteProvisionedConcurrencyConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteProvisionedConcurrencyConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves details about your account's limits and usage in an Amazon Web Services
* Region.
*
*
* @param getAccountSettingsRequest
* @return Result of the GetAccountSettings operation returned by the service.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.GetAccountSettings
* @see AWS API
* Documentation
*/
@Override
public GetAccountSettingsResponse getAccountSettings(GetAccountSettingsRequest getAccountSettingsRequest)
throws TooManyRequestsException, ServiceException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetAccountSettingsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetAccountSettings").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getAccountSettingsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetAccountSettingsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns details about a Lambda function alias.
*
*
* @param getAliasRequest
* @return Result of the GetAlias operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.GetAlias
* @see AWS API
* Documentation
*/
@Override
public GetAliasResponse getAlias(GetAliasRequest getAliasRequest) throws ServiceException, ResourceNotFoundException,
InvalidParameterValueException, TooManyRequestsException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetAliasResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetAlias").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getAliasRequest)
.withMetricCollector(apiCallMetricCollector).withMarshaller(new GetAliasRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns information about the specified code signing configuration.
*
*
* @param getCodeSigningConfigRequest
* @return Result of the GetCodeSigningConfig operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.GetCodeSigningConfig
* @see AWS
* API Documentation
*/
@Override
public GetCodeSigningConfigResponse getCodeSigningConfig(GetCodeSigningConfigRequest getCodeSigningConfigRequest)
throws ServiceException, InvalidParameterValueException, ResourceNotFoundException, AwsServiceException,
SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetCodeSigningConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetCodeSigningConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getCodeSigningConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetCodeSigningConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns details about an event source mapping. You can get the identifier of a mapping from the output of
* ListEventSourceMappings.
*
*
* @param getEventSourceMappingRequest
* @return Result of the GetEventSourceMapping operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.GetEventSourceMapping
* @see AWS
* API Documentation
*/
@Override
public GetEventSourceMappingResponse getEventSourceMapping(GetEventSourceMappingRequest getEventSourceMappingRequest)
throws ServiceException, ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetEventSourceMappingResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetEventSourceMapping").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getEventSourceMappingRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetEventSourceMappingRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the GetFunction operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.GetFunction
* @see AWS API
* Documentation
*/
@Override
public GetFunctionResponse getFunction(GetFunctionRequest getFunctionRequest) throws ServiceException,
ResourceNotFoundException, TooManyRequestsException, InvalidParameterValueException, AwsServiceException,
SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetFunctionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetFunction").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getFunctionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetFunctionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns the code signing configuration for the specified function.
*
*
* @param getFunctionCodeSigningConfigRequest
* @return Result of the GetFunctionCodeSigningConfig operation returned by the service.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.GetFunctionCodeSigningConfig
* @see AWS API Documentation
*/
@Override
public GetFunctionCodeSigningConfigResponse getFunctionCodeSigningConfig(
GetFunctionCodeSigningConfigRequest getFunctionCodeSigningConfigRequest) throws InvalidParameterValueException,
ResourceNotFoundException, ServiceException, TooManyRequestsException, AwsServiceException, SdkClientException,
LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetFunctionCodeSigningConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetFunctionCodeSigningConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getFunctionCodeSigningConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetFunctionCodeSigningConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns details about the reserved concurrency configuration for a function. To set a concurrency limit for a
* function, use PutFunctionConcurrency.
*
*
* @param getFunctionConcurrencyRequest
* @return Result of the GetFunctionConcurrency operation returned by the service.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.GetFunctionConcurrency
* @see AWS
* API Documentation
*/
@Override
public GetFunctionConcurrencyResponse getFunctionConcurrency(GetFunctionConcurrencyRequest getFunctionConcurrencyRequest)
throws InvalidParameterValueException, ResourceNotFoundException, TooManyRequestsException, ServiceException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetFunctionConcurrencyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetFunctionConcurrency").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getFunctionConcurrencyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetFunctionConcurrencyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the GetFunctionConfiguration operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.GetFunctionConfiguration
* @see AWS API Documentation
*/
@Override
public GetFunctionConfigurationResponse getFunctionConfiguration(
GetFunctionConfigurationRequest getFunctionConfigurationRequest) throws ServiceException, ResourceNotFoundException,
TooManyRequestsException, InvalidParameterValueException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetFunctionConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetFunctionConfiguration").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getFunctionConfigurationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetFunctionConfigurationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the configuration for asynchronous invocation for a function, version, or alias.
*
*
* To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
*
*
* @param getFunctionEventInvokeConfigRequest
* @return Result of the GetFunctionEventInvokeConfig operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.GetFunctionEventInvokeConfig
* @see AWS API Documentation
*/
@Override
public GetFunctionEventInvokeConfigResponse getFunctionEventInvokeConfig(
GetFunctionEventInvokeConfigRequest getFunctionEventInvokeConfigRequest) throws ServiceException,
ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException, AwsServiceException,
SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetFunctionEventInvokeConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetFunctionEventInvokeConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getFunctionEventInvokeConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetFunctionEventInvokeConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns information about a version of an Lambda layer, with a link to
* download the layer archive that's valid for 10 minutes.
*
*
* @param getLayerVersionRequest
* @return Result of the GetLayerVersion operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.GetLayerVersion
* @see AWS API
* Documentation
*/
@Override
public GetLayerVersionResponse getLayerVersion(GetLayerVersionRequest getLayerVersionRequest) throws ServiceException,
InvalidParameterValueException, TooManyRequestsException, ResourceNotFoundException, AwsServiceException,
SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetLayerVersionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetLayerVersion").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getLayerVersionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetLayerVersionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns information about a version of an Lambda layer, with a link to
* download the layer archive that's valid for 10 minutes.
*
*
* @param getLayerVersionByArnRequest
* @return Result of the GetLayerVersionByArn operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.GetLayerVersionByArn
* @see AWS
* API Documentation
*/
@Override
public GetLayerVersionByArnResponse getLayerVersionByArn(GetLayerVersionByArnRequest getLayerVersionByArnRequest)
throws ServiceException, InvalidParameterValueException, TooManyRequestsException, ResourceNotFoundException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetLayerVersionByArnResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetLayerVersionByArn").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getLayerVersionByArnRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetLayerVersionByArnRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns the permission policy for a version of an Lambda layer. For more
* information, see AddLayerVersionPermission.
*
*
* @param getLayerVersionPolicyRequest
* @return Result of the GetLayerVersionPolicy operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.GetLayerVersionPolicy
* @see AWS
* API Documentation
*/
@Override
public GetLayerVersionPolicyResponse getLayerVersionPolicy(GetLayerVersionPolicyRequest getLayerVersionPolicyRequest)
throws ServiceException, ResourceNotFoundException, TooManyRequestsException, InvalidParameterValueException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetLayerVersionPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetLayerVersionPolicy").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getLayerVersionPolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetLayerVersionPolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns the resource-based IAM
* policy for a function, version, or alias.
*
*
* @param getPolicyRequest
* @return Result of the GetPolicy operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.GetPolicy
* @see AWS API
* Documentation
*/
@Override
public GetPolicyResponse getPolicy(GetPolicyRequest getPolicyRequest) throws ServiceException, ResourceNotFoundException,
TooManyRequestsException, InvalidParameterValueException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetPolicy").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getPolicyRequest)
.withMetricCollector(apiCallMetricCollector).withMarshaller(new GetPolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the provisioned concurrency configuration for a function's alias or version.
*
*
* @param getProvisionedConcurrencyConfigRequest
* @return Result of the GetProvisionedConcurrencyConfig operation returned by the service.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ProvisionedConcurrencyConfigNotFoundException
* The specified configuration does not exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.GetProvisionedConcurrencyConfig
* @see AWS API Documentation
*/
@Override
public GetProvisionedConcurrencyConfigResponse getProvisionedConcurrencyConfig(
GetProvisionedConcurrencyConfigRequest getProvisionedConcurrencyConfigRequest) throws InvalidParameterValueException,
ResourceNotFoundException, TooManyRequestsException, ServiceException, ProvisionedConcurrencyConfigNotFoundException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetProvisionedConcurrencyConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetProvisionedConcurrencyConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getProvisionedConcurrencyConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetProvisionedConcurrencyConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the Invoke operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidRequestContentException
* The request body could not be parsed as JSON.
* @throws RequestTooLargeException
* The request payload exceeded the Invoke
request body JSON input limit. For more information,
* see Limits.
* @throws UnsupportedMediaTypeException
* The content type of the Invoke
request body is not JSON.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws Ec2UnexpectedException
* Lambda received an unexpected EC2 client exception while setting up for the Lambda function.
* @throws SubnetIpAddressLimitReachedException
* Lambda was not able to set up VPC access for the Lambda function because one or more configured subnets
* has no available IP addresses.
* @throws EniLimitReachedException
* 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.
* @throws EfsMountConnectivityException
* The function couldn't make a network connection to the configured file system.
* @throws EfsMountFailureException
* The function couldn't mount the configured file system due to a permission or configuration issue.
* @throws EfsMountTimeoutException
* The function was able to make a network connection to the configured file system, but the mount operation
* timed out.
* @throws EfsioException
* An error occured when reading from or writing to a connected file system.
* @throws Ec2ThrottledException
* Lambda was throttled by Amazon EC2 during Lambda function initialization using the execution role
* provided for the Lambda function.
* @throws Ec2AccessDeniedException
* Need additional permissions to configure VPC settings.
* @throws InvalidSubnetIdException
* The Subnet ID provided in the Lambda function VPC configuration is invalid.
* @throws InvalidSecurityGroupIdException
* The Security Group ID provided in the Lambda function VPC configuration is invalid.
* @throws InvalidZipFileException
* Lambda could not unzip the deployment package.
* @throws KmsDisabledException
* Lambda was unable to decrypt the environment variables because the KMS key used is disabled. Check the
* Lambda function's KMS key settings.
* @throws 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.
* @throws KmsAccessDeniedException
* Lambda was unable to decrypt the environment variables because KMS access was denied. Check the Lambda
* function's KMS permissions.
* @throws KmsNotFoundException
* Lambda was unable to decrypt the environment variables because the KMS key was not found. Check the
* function's KMS key settings.
* @throws InvalidRuntimeException
* The runtime or runtime version specified is not supported.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws ResourceNotReadyException
* The function is inactive and its VPC connection is no longer available. Wait for the VPC connection to
* reestablish and try again.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.Invoke
* @see AWS API
* Documentation
*/
@Override
public InvokeResponse invoke(InvokeRequest invokeRequest) throws ServiceException, ResourceNotFoundException,
InvalidRequestContentException, RequestTooLargeException, UnsupportedMediaTypeException, TooManyRequestsException,
InvalidParameterValueException, Ec2UnexpectedException, SubnetIpAddressLimitReachedException,
EniLimitReachedException, EfsMountConnectivityException, EfsMountFailureException, EfsMountTimeoutException,
EfsioException, Ec2ThrottledException, Ec2AccessDeniedException, InvalidSubnetIdException,
InvalidSecurityGroupIdException, InvalidZipFileException, KmsDisabledException, KmsInvalidStateException,
KmsAccessDeniedException, KmsNotFoundException, InvalidRuntimeException, ResourceConflictException,
ResourceNotReadyException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(false).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
InvokeResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams().withOperationName("Invoke")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler).withInput(invokeRequest)
.withMetricCollector(apiCallMetricCollector).withMarshaller(new InvokeRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of aliases for
* a Lambda function.
*
*
* @param listAliasesRequest
* @return Result of the ListAliases operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListAliases
* @see AWS API
* Documentation
*/
@Override
public ListAliasesResponse listAliases(ListAliasesRequest listAliasesRequest) throws ServiceException,
ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException, AwsServiceException,
SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListAliasesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListAliases").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listAliasesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListAliasesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListAliasesIterable responses = client.listAliasesPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.lambda.paginators.ListAliasesIterable responses = client.listAliasesPaginator(request);
* for (software.amazon.awssdk.services.lambda.model.ListAliasesResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListAliasesIterable responses = client.listAliasesPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* 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 iterable that can be used to iterate through all the response pages.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListAliases
* @see AWS API
* Documentation
*/
@Override
public ListAliasesIterable listAliasesPaginator(ListAliasesRequest listAliasesRequest) throws ServiceException,
ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException, AwsServiceException,
SdkClientException, LambdaException {
return new ListAliasesIterable(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 Result of the ListCodeSigningConfigs operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListCodeSigningConfigs
* @see AWS
* API Documentation
*/
@Override
public ListCodeSigningConfigsResponse listCodeSigningConfigs(ListCodeSigningConfigsRequest listCodeSigningConfigsRequest)
throws ServiceException, InvalidParameterValueException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListCodeSigningConfigsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListCodeSigningConfigs").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listCodeSigningConfigsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListCodeSigningConfigsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListCodeSigningConfigsIterable responses = client.listCodeSigningConfigsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.lambda.paginators.ListCodeSigningConfigsIterable responses = client
* .listCodeSigningConfigsPaginator(request);
* for (software.amazon.awssdk.services.lambda.model.ListCodeSigningConfigsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListCodeSigningConfigsIterable responses = client.listCodeSigningConfigsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* 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 iterable that can be used to iterate through all the response pages.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListCodeSigningConfigs
* @see AWS
* API Documentation
*/
@Override
public ListCodeSigningConfigsIterable listCodeSigningConfigsPaginator(
ListCodeSigningConfigsRequest listCodeSigningConfigsRequest) throws ServiceException, InvalidParameterValueException,
AwsServiceException, SdkClientException, LambdaException {
return new ListCodeSigningConfigsIterable(this, applyPaginatorUserAgent(listCodeSigningConfigsRequest));
}
/**
*
* Lists event source mappings. Specify an EventSourceArn
to only show event source mappings for a
* single event source.
*
*
* @param listEventSourceMappingsRequest
* @return Result of the ListEventSourceMappings operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListEventSourceMappings
* @see AWS API Documentation
*/
@Override
public ListEventSourceMappingsResponse listEventSourceMappings(ListEventSourceMappingsRequest listEventSourceMappingsRequest)
throws ServiceException, ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListEventSourceMappingsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListEventSourceMappings").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listEventSourceMappingsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListEventSourceMappingsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListEventSourceMappingsIterable responses = client.listEventSourceMappingsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.lambda.paginators.ListEventSourceMappingsIterable responses = client
* .listEventSourceMappingsPaginator(request);
* for (software.amazon.awssdk.services.lambda.model.ListEventSourceMappingsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListEventSourceMappingsIterable responses = client.listEventSourceMappingsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* 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 iterable that can be used to iterate through all the response pages.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListEventSourceMappings
* @see AWS API Documentation
*/
@Override
public ListEventSourceMappingsIterable listEventSourceMappingsPaginator(
ListEventSourceMappingsRequest listEventSourceMappingsRequest) throws ServiceException, ResourceNotFoundException,
InvalidParameterValueException, TooManyRequestsException, AwsServiceException, SdkClientException, LambdaException {
return new ListEventSourceMappingsIterable(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 Result of the ListFunctionEventInvokeConfigs operation returned by the service.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListFunctionEventInvokeConfigs
* @see AWS API Documentation
*/
@Override
public ListFunctionEventInvokeConfigsResponse listFunctionEventInvokeConfigs(
ListFunctionEventInvokeConfigsRequest listFunctionEventInvokeConfigsRequest) throws InvalidParameterValueException,
ResourceNotFoundException, TooManyRequestsException, ServiceException, AwsServiceException, SdkClientException,
LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListFunctionEventInvokeConfigsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListFunctionEventInvokeConfigs").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listFunctionEventInvokeConfigsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListFunctionEventInvokeConfigsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListFunctionEventInvokeConfigsIterable responses = client.listFunctionEventInvokeConfigsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.lambda.paginators.ListFunctionEventInvokeConfigsIterable responses = client
* .listFunctionEventInvokeConfigsPaginator(request);
* for (software.amazon.awssdk.services.lambda.model.ListFunctionEventInvokeConfigsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListFunctionEventInvokeConfigsIterable responses = client.listFunctionEventInvokeConfigsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* 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 iterable that can be used to iterate through all the response pages.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListFunctionEventInvokeConfigs
* @see AWS API Documentation
*/
@Override
public ListFunctionEventInvokeConfigsIterable listFunctionEventInvokeConfigsPaginator(
ListFunctionEventInvokeConfigsRequest listFunctionEventInvokeConfigsRequest) throws InvalidParameterValueException,
ResourceNotFoundException, TooManyRequestsException, ServiceException, AwsServiceException, SdkClientException,
LambdaException {
return new ListFunctionEventInvokeConfigsIterable(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.
*
*
*
* The ListFunctions
action returns a subset of the FunctionConfiguration fields. To get the
* additional fields (State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason,
* LastUpdateStatusReasonCode) for a function or version, use GetFunction.
*
*
*
* @param listFunctionsRequest
* @return Result of the ListFunctions operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListFunctions
* @see AWS API
* Documentation
*/
@Override
public ListFunctionsResponse listFunctions(ListFunctionsRequest listFunctionsRequest) throws ServiceException,
TooManyRequestsException, InvalidParameterValueException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListFunctionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListFunctions").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listFunctionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListFunctionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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.
*
*
*
* The ListFunctions
action returns a subset of the FunctionConfiguration fields. To get the
* additional fields (State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason,
* LastUpdateStatusReasonCode) for a function or version, use GetFunction.
*
*
*
* This is a variant of {@link #listFunctions(software.amazon.awssdk.services.lambda.model.ListFunctionsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListFunctionsIterable responses = client.listFunctionsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.lambda.paginators.ListFunctionsIterable responses = client.listFunctionsPaginator(request);
* for (software.amazon.awssdk.services.lambda.model.ListFunctionsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListFunctionsIterable responses = client.listFunctionsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* 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 #listFunctions(software.amazon.awssdk.services.lambda.model.ListFunctionsRequest)} operation.
*
*
* @param listFunctionsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListFunctions
* @see AWS API
* Documentation
*/
@Override
public ListFunctionsIterable listFunctionsPaginator(ListFunctionsRequest listFunctionsRequest) throws ServiceException,
TooManyRequestsException, InvalidParameterValueException, AwsServiceException, SdkClientException, LambdaException {
return new ListFunctionsIterable(this, applyPaginatorUserAgent(listFunctionsRequest));
}
/**
*
* 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 Result of the ListFunctionsByCodeSigningConfig operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListFunctionsByCodeSigningConfig
* @see AWS API Documentation
*/
@Override
public ListFunctionsByCodeSigningConfigResponse listFunctionsByCodeSigningConfig(
ListFunctionsByCodeSigningConfigRequest listFunctionsByCodeSigningConfigRequest) throws ServiceException,
InvalidParameterValueException, ResourceNotFoundException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListFunctionsByCodeSigningConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListFunctionsByCodeSigningConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listFunctionsByCodeSigningConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListFunctionsByCodeSigningConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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.
*
*
*
* This is a variant of
* {@link #listFunctionsByCodeSigningConfig(software.amazon.awssdk.services.lambda.model.ListFunctionsByCodeSigningConfigRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListFunctionsByCodeSigningConfigIterable responses = client.listFunctionsByCodeSigningConfigPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.lambda.paginators.ListFunctionsByCodeSigningConfigIterable responses = client
* .listFunctionsByCodeSigningConfigPaginator(request);
* for (software.amazon.awssdk.services.lambda.model.ListFunctionsByCodeSigningConfigResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListFunctionsByCodeSigningConfigIterable responses = client.listFunctionsByCodeSigningConfigPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* 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 #listFunctionsByCodeSigningConfig(software.amazon.awssdk.services.lambda.model.ListFunctionsByCodeSigningConfigRequest)}
* operation.
*
*
* @param listFunctionsByCodeSigningConfigRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListFunctionsByCodeSigningConfig
* @see AWS API Documentation
*/
@Override
public ListFunctionsByCodeSigningConfigIterable listFunctionsByCodeSigningConfigPaginator(
ListFunctionsByCodeSigningConfigRequest listFunctionsByCodeSigningConfigRequest) throws ServiceException,
InvalidParameterValueException, ResourceNotFoundException, AwsServiceException, SdkClientException, LambdaException {
return new ListFunctionsByCodeSigningConfigIterable(this,
applyPaginatorUserAgent(listFunctionsByCodeSigningConfigRequest));
}
/**
*
* Lists the versions of an Lambda
* layer. Versions that have been deleted aren't listed. Specify a runtime identifier to list only
* versions that indicate that they're compatible with that runtime.
*
*
* @param listLayerVersionsRequest
* @return Result of the ListLayerVersions operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListLayerVersions
* @see AWS API
* Documentation
*/
@Override
public ListLayerVersionsResponse listLayerVersions(ListLayerVersionsRequest listLayerVersionsRequest)
throws ServiceException, InvalidParameterValueException, ResourceNotFoundException, TooManyRequestsException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListLayerVersionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listLayerVersionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListLayerVersions");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListLayerVersions").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listLayerVersionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListLayerVersionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the versions of an Lambda
* layer. Versions that have been deleted aren't listed. Specify a runtime identifier to list only
* versions that indicate that they're compatible with that runtime.
*
*
*
* This is a variant of
* {@link #listLayerVersions(software.amazon.awssdk.services.lambda.model.ListLayerVersionsRequest)} operation. The
* return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle
* making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListLayerVersionsIterable responses = client.listLayerVersionsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.lambda.paginators.ListLayerVersionsIterable responses = client
* .listLayerVersionsPaginator(request);
* for (software.amazon.awssdk.services.lambda.model.ListLayerVersionsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListLayerVersionsIterable responses = client.listLayerVersionsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* 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 #listLayerVersions(software.amazon.awssdk.services.lambda.model.ListLayerVersionsRequest)} operation.
*
*
* @param listLayerVersionsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListLayerVersions
* @see AWS API
* Documentation
*/
@Override
public ListLayerVersionsIterable listLayerVersionsPaginator(ListLayerVersionsRequest listLayerVersionsRequest)
throws ServiceException, InvalidParameterValueException, ResourceNotFoundException, TooManyRequestsException,
AwsServiceException, SdkClientException, LambdaException {
return new ListLayerVersionsIterable(this, applyPaginatorUserAgent(listLayerVersionsRequest));
}
/**
*
* Lists Lambda layers and
* shows information about the latest version of each. Specify a runtime identifier to list only
* layers that indicate that they're compatible with that runtime.
*
*
* @param listLayersRequest
* @return Result of the ListLayers operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListLayers
* @see AWS API
* Documentation
*/
@Override
public ListLayersResponse listLayers(ListLayersRequest listLayersRequest) throws ServiceException,
InvalidParameterValueException, TooManyRequestsException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListLayersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listLayersRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListLayers");
return clientHandler
.execute(new ClientExecutionParams().withOperationName("ListLayers")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(listLayersRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListLayersRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists Lambda layers and
* shows information about the latest version of each. Specify a runtime identifier to list only
* layers that indicate that they're compatible with that runtime.
*
*
*
* This is a variant of {@link #listLayers(software.amazon.awssdk.services.lambda.model.ListLayersRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListLayersIterable responses = client.listLayersPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.lambda.paginators.ListLayersIterable responses = client.listLayersPaginator(request);
* for (software.amazon.awssdk.services.lambda.model.ListLayersResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListLayersIterable responses = client.listLayersPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* 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 #listLayers(software.amazon.awssdk.services.lambda.model.ListLayersRequest)} operation.
*
*
* @param listLayersRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListLayers
* @see AWS API
* Documentation
*/
@Override
public ListLayersIterable listLayersPaginator(ListLayersRequest listLayersRequest) throws ServiceException,
InvalidParameterValueException, TooManyRequestsException, AwsServiceException, SdkClientException, LambdaException {
return new ListLayersIterable(this, applyPaginatorUserAgent(listLayersRequest));
}
/**
*
* Retrieves a list of provisioned concurrency configurations for a function.
*
*
* @param listProvisionedConcurrencyConfigsRequest
* @return Result of the ListProvisionedConcurrencyConfigs operation returned by the service.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListProvisionedConcurrencyConfigs
* @see AWS API Documentation
*/
@Override
public ListProvisionedConcurrencyConfigsResponse listProvisionedConcurrencyConfigs(
ListProvisionedConcurrencyConfigsRequest listProvisionedConcurrencyConfigsRequest)
throws InvalidParameterValueException, ResourceNotFoundException, TooManyRequestsException, ServiceException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListProvisionedConcurrencyConfigsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listProvisionedConcurrencyConfigsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListProvisionedConcurrencyConfigs");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListProvisionedConcurrencyConfigs").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listProvisionedConcurrencyConfigsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListProvisionedConcurrencyConfigsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves a list of provisioned concurrency configurations for a function.
*
*
*
* This is a variant of
* {@link #listProvisionedConcurrencyConfigs(software.amazon.awssdk.services.lambda.model.ListProvisionedConcurrencyConfigsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListProvisionedConcurrencyConfigsIterable responses = client.listProvisionedConcurrencyConfigsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.lambda.paginators.ListProvisionedConcurrencyConfigsIterable responses = client
* .listProvisionedConcurrencyConfigsPaginator(request);
* for (software.amazon.awssdk.services.lambda.model.ListProvisionedConcurrencyConfigsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListProvisionedConcurrencyConfigsIterable responses = client.listProvisionedConcurrencyConfigsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* 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 #listProvisionedConcurrencyConfigs(software.amazon.awssdk.services.lambda.model.ListProvisionedConcurrencyConfigsRequest)}
* operation.
*
*
* @param listProvisionedConcurrencyConfigsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListProvisionedConcurrencyConfigs
* @see AWS API Documentation
*/
@Override
public ListProvisionedConcurrencyConfigsIterable listProvisionedConcurrencyConfigsPaginator(
ListProvisionedConcurrencyConfigsRequest listProvisionedConcurrencyConfigsRequest)
throws InvalidParameterValueException, ResourceNotFoundException, TooManyRequestsException, ServiceException,
AwsServiceException, SdkClientException, LambdaException {
return new ListProvisionedConcurrencyConfigsIterable(this,
applyPaginatorUserAgent(listProvisionedConcurrencyConfigsRequest));
}
/**
*
* Returns a function's tags. You can also
* view tags with GetFunction.
*
*
* @param listTagsRequest
* @return Result of the ListTags operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListTags
* @see AWS API
* Documentation
*/
@Override
public ListTagsResponse listTags(ListTagsRequest listTagsRequest) throws ServiceException, ResourceNotFoundException,
InvalidParameterValueException, TooManyRequestsException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListTagsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTags");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTags").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listTagsRequest)
.withMetricCollector(apiCallMetricCollector).withMarshaller(new ListTagsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of versions,
* with the version-specific configuration of each. Lambda returns up to 50 versions per call.
*
*
* @param listVersionsByFunctionRequest
* @return Result of the ListVersionsByFunction operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListVersionsByFunction
* @see AWS
* API Documentation
*/
@Override
public ListVersionsByFunctionResponse listVersionsByFunction(ListVersionsByFunctionRequest listVersionsByFunctionRequest)
throws ServiceException, ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListVersionsByFunctionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listVersionsByFunctionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListVersionsByFunction");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListVersionsByFunction").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listVersionsByFunctionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListVersionsByFunctionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of versions,
* with the version-specific configuration of each. Lambda returns up to 50 versions per call.
*
*
*
* This is a variant of
* {@link #listVersionsByFunction(software.amazon.awssdk.services.lambda.model.ListVersionsByFunctionRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListVersionsByFunctionIterable responses = client.listVersionsByFunctionPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.lambda.paginators.ListVersionsByFunctionIterable responses = client
* .listVersionsByFunctionPaginator(request);
* for (software.amazon.awssdk.services.lambda.model.ListVersionsByFunctionResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.lambda.paginators.ListVersionsByFunctionIterable responses = client.listVersionsByFunctionPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* 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 #listVersionsByFunction(software.amazon.awssdk.services.lambda.model.ListVersionsByFunctionRequest)}
* operation.
*
*
* @param listVersionsByFunctionRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.ListVersionsByFunction
* @see AWS
* API Documentation
*/
@Override
public ListVersionsByFunctionIterable listVersionsByFunctionPaginator(
ListVersionsByFunctionRequest listVersionsByFunctionRequest) throws ServiceException, ResourceNotFoundException,
InvalidParameterValueException, TooManyRequestsException, AwsServiceException, SdkClientException, LambdaException {
return new ListVersionsByFunctionIterable(this, applyPaginatorUserAgent(listVersionsByFunctionRequest));
}
/**
*
* Creates an Lambda layer from
* a ZIP archive. Each time you call PublishLayerVersion
with the same layer name, a new version is
* created.
*
*
* Add layers to your function with CreateFunction or UpdateFunctionConfiguration.
*
*
* @param publishLayerVersionRequest
* @return Result of the PublishLayerVersion operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws CodeStorageExceededException
* You have exceeded your maximum total code size per account. Learn more
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.PublishLayerVersion
* @see AWS
* API Documentation
*/
@Override
public PublishLayerVersionResponse publishLayerVersion(PublishLayerVersionRequest publishLayerVersionRequest)
throws ServiceException, ResourceNotFoundException, TooManyRequestsException, InvalidParameterValueException,
CodeStorageExceededException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PublishLayerVersionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, publishLayerVersionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PublishLayerVersion");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("PublishLayerVersion").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(publishLayerVersionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PublishLayerVersionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a version from the
* current code and configuration of a function. Use versions to create a snapshot of your function code and
* configuration that doesn't change.
*
*
* Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version.
* Use UpdateFunctionCode or UpdateFunctionConfiguration to update the function before publishing a
* version.
*
*
* Clients can invoke versions directly or with an alias. To create an alias, use CreateAlias.
*
*
* @param publishVersionRequest
* @return Result of the PublishVersion operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws CodeStorageExceededException
* You have exceeded your maximum total code size per account. Learn more
* @throws 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.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.PublishVersion
* @see AWS API
* Documentation
*/
@Override
public PublishVersionResponse publishVersion(PublishVersionRequest publishVersionRequest) throws ServiceException,
ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException, CodeStorageExceededException,
PreconditionFailedException, ResourceConflictException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
PublishVersionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, publishVersionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PublishVersion");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("PublishVersion").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(publishVersionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PublishVersionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Update the code signing configuration for the function. Changes to the code signing configuration take effect the
* next time a user tries to deploy a code package to the function.
*
*
* @param putFunctionCodeSigningConfigRequest
* @return Result of the PutFunctionCodeSigningConfig operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws CodeSigningConfigNotFoundException
* The specified code signing configuration does not exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.PutFunctionCodeSigningConfig
* @see AWS API Documentation
*/
@Override
public PutFunctionCodeSigningConfigResponse putFunctionCodeSigningConfig(
PutFunctionCodeSigningConfigRequest putFunctionCodeSigningConfigRequest) throws ServiceException,
InvalidParameterValueException, ResourceNotFoundException, TooManyRequestsException, ResourceConflictException,
CodeSigningConfigNotFoundException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutFunctionCodeSigningConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putFunctionCodeSigningConfigRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutFunctionCodeSigningConfig");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutFunctionCodeSigningConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(putFunctionCodeSigningConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutFunctionCodeSigningConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Sets the maximum number of simultaneous executions for a function, and reserves capacity for that concurrency
* level.
*
*
* Concurrency settings apply to the function as a whole, including all published versions and the unpublished
* version. Reserving concurrency both ensures that your function has capacity to process the specified number of
* events simultaneously, and prevents it from scaling beyond that level. Use GetFunction to see the current
* setting for a function.
*
*
* Use GetAccountSettings to see your Regional concurrency limit. You can reserve concurrency for as many
* functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that
* aren't configured with a per-function limit. For more information, see Managing Concurrency.
*
*
* @param putFunctionConcurrencyRequest
* @return Result of the PutFunctionConcurrency operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.PutFunctionConcurrency
* @see AWS
* API Documentation
*/
@Override
public PutFunctionConcurrencyResponse putFunctionConcurrency(PutFunctionConcurrencyRequest putFunctionConcurrencyRequest)
throws ServiceException, InvalidParameterValueException, ResourceNotFoundException, TooManyRequestsException,
ResourceConflictException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutFunctionConcurrencyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putFunctionConcurrencyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutFunctionConcurrency");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutFunctionConcurrency").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(putFunctionConcurrencyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutFunctionConcurrencyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Configures options for asynchronous
* invocation on a function, version, or alias. If a configuration already exists for a function, version, or
* alias, this operation overwrites it. If you exclude any settings, they are removed. To set one option without
* affecting existing settings for other options, use UpdateFunctionEventInvokeConfig.
*
*
* By default, Lambda retries an asynchronous invocation twice if the function returns an error. It retains events
* in a queue for up to six hours. When an event fails all processing attempts or stays in the asynchronous
* invocation queue for too long, Lambda discards it. To retain discarded events, configure a dead-letter queue with
* UpdateFunctionConfiguration.
*
*
* To send an invocation record to a queue, topic, function, or event bus, specify a destination. You can configure separate destinations for successful invocations (on-success) and events that
* fail all processing attempts (on-failure). You can configure destinations in addition to or instead of a
* dead-letter queue.
*
*
* @param putFunctionEventInvokeConfigRequest
* @return Result of the PutFunctionEventInvokeConfig operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.PutFunctionEventInvokeConfig
* @see AWS API Documentation
*/
@Override
public PutFunctionEventInvokeConfigResponse putFunctionEventInvokeConfig(
PutFunctionEventInvokeConfigRequest putFunctionEventInvokeConfigRequest) throws ServiceException,
ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException, ResourceConflictException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutFunctionEventInvokeConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putFunctionEventInvokeConfigRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutFunctionEventInvokeConfig");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutFunctionEventInvokeConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(putFunctionEventInvokeConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutFunctionEventInvokeConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds a provisioned concurrency configuration to a function's alias or version.
*
*
* @param putProvisionedConcurrencyConfigRequest
* @return Result of the PutProvisionedConcurrencyConfig operation returned by the service.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.PutProvisionedConcurrencyConfig
* @see AWS API Documentation
*/
@Override
public PutProvisionedConcurrencyConfigResponse putProvisionedConcurrencyConfig(
PutProvisionedConcurrencyConfigRequest putProvisionedConcurrencyConfigRequest) throws InvalidParameterValueException,
ResourceNotFoundException, ResourceConflictException, TooManyRequestsException, ServiceException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutProvisionedConcurrencyConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
putProvisionedConcurrencyConfigRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutProvisionedConcurrencyConfig");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutProvisionedConcurrencyConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(putProvisionedConcurrencyConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutProvisionedConcurrencyConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes a statement from the permissions policy for a version of an Lambda layer. For more
* information, see AddLayerVersionPermission.
*
*
* @param removeLayerVersionPermissionRequest
* @return Result of the RemoveLayerVersionPermission operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws 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.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.RemoveLayerVersionPermission
* @see AWS API Documentation
*/
@Override
public RemoveLayerVersionPermissionResponse removeLayerVersionPermission(
RemoveLayerVersionPermissionRequest removeLayerVersionPermissionRequest) throws ServiceException,
ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException, PreconditionFailedException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, RemoveLayerVersionPermissionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, removeLayerVersionPermissionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RemoveLayerVersionPermission");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("RemoveLayerVersionPermission").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(removeLayerVersionPermissionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new RemoveLayerVersionPermissionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Revokes function-use permission from an Amazon Web Services service or another account. You can get the ID of the
* statement from the output of GetPolicy.
*
*
* @param removePermissionRequest
* @return Result of the RemovePermission operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws 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.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.RemovePermission
* @see AWS API
* Documentation
*/
@Override
public RemovePermissionResponse removePermission(RemovePermissionRequest removePermissionRequest) throws ServiceException,
ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException, PreconditionFailedException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
RemovePermissionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, removePermissionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RemovePermission");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("RemovePermission").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(removePermissionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new RemovePermissionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds tags to a function.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.TagResource
* @see AWS API
* Documentation
*/
@Override
public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws ServiceException,
ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException, ResourceConflictException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
TagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("TagResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(tagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new TagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes tags from a function.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.UntagResource
* @see AWS API
* Documentation
*/
@Override
public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ServiceException,
ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException, ResourceConflictException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UntagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UntagResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(untagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the configuration of a Lambda function alias.
*
*
* @param updateAliasRequest
* @return Result of the UpdateAlias operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws 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.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.UpdateAlias
* @see AWS API
* Documentation
*/
@Override
public UpdateAliasResponse updateAlias(UpdateAliasRequest updateAliasRequest) throws ServiceException,
ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException, PreconditionFailedException,
ResourceConflictException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateAliasResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAliasRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAlias");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateAlias").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateAliasRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateAliasRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Update the code signing configuration. Changes to the code signing configuration take effect the next time a user
* tries to deploy a code package to the function.
*
*
* @param updateCodeSigningConfigRequest
* @return Result of the UpdateCodeSigningConfig operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.UpdateCodeSigningConfig
* @see AWS API Documentation
*/
@Override
public UpdateCodeSigningConfigResponse updateCodeSigningConfig(UpdateCodeSigningConfigRequest updateCodeSigningConfigRequest)
throws ServiceException, InvalidParameterValueException, ResourceNotFoundException, AwsServiceException,
SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateCodeSigningConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCodeSigningConfigRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCodeSigningConfig");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateCodeSigningConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateCodeSigningConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateCodeSigningConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates an event source mapping. You can change the function that Lambda invokes, or pause invocation and resume
* later from the same location.
*
*
* 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 updateEventSourceMappingRequest
* @return Result of the UpdateEventSourceMapping operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws 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.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.UpdateEventSourceMapping
* @see AWS API Documentation
*/
@Override
public UpdateEventSourceMappingResponse updateEventSourceMapping(
UpdateEventSourceMappingRequest updateEventSourceMappingRequest) throws ServiceException, ResourceNotFoundException,
InvalidParameterValueException, TooManyRequestsException, ResourceConflictException, ResourceInUseException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateEventSourceMappingResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateEventSourceMappingRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateEventSourceMapping");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateEventSourceMapping").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateEventSourceMappingRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateEventSourceMappingRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates a Lambda function's code. If code signing is enabled for the function, the code package must be signed by
* a trusted publisher. For more information, see Configuring code signing.
*
*
* The function's code is locked when you publish a version. You can't modify the code of a published version, only
* the unpublished version.
*
*
*
* For a function defined as a container image, Lambda resolves the image tag to an image digest. In Amazon ECR, if
* you update the image tag to a new image, Lambda does not automatically update the function.
*
*
*
* @param updateFunctionCodeRequest
* @return Result of the UpdateFunctionCode operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws CodeStorageExceededException
* You have exceeded your maximum total code size per account. Learn more
* @throws 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.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws 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.
* @throws 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.
* @throws CodeSigningConfigNotFoundException
* The specified code signing configuration does not exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.UpdateFunctionCode
* @see AWS API
* Documentation
*/
@Override
public UpdateFunctionCodeResponse updateFunctionCode(UpdateFunctionCodeRequest updateFunctionCodeRequest)
throws ServiceException, ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException,
CodeStorageExceededException, PreconditionFailedException, ResourceConflictException,
CodeVerificationFailedException, InvalidCodeSignatureException, CodeSigningConfigNotFoundException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateFunctionCodeResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateFunctionCodeRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateFunctionCode");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateFunctionCode").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateFunctionCodeRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateFunctionCodeRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Modify the version-specific settings of a Lambda function.
*
*
* When you update 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. During this time, you can't modify the function, but
* you can still invoke it. The LastUpdateStatus
, LastUpdateStatusReason
, and
* LastUpdateStatusReasonCode
fields in the response from GetFunctionConfiguration indicate when
* the update is complete and the function is processing events with the new configuration. For more information,
* see Function States.
*
*
* These settings can vary between versions of a function and are locked when you publish a version. You can't
* modify the configuration of a published version, only the unpublished version.
*
*
* To configure function concurrency, use PutFunctionConcurrency. To grant invoke permissions to an account
* or Amazon Web Services service, use AddPermission.
*
*
* @param updateFunctionConfigurationRequest
* @return Result of the UpdateFunctionConfiguration operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws 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.
* @throws 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.
* @throws 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.
* @throws CodeSigningConfigNotFoundException
* The specified code signing configuration does not exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.UpdateFunctionConfiguration
* @see AWS API Documentation
*/
@Override
public UpdateFunctionConfigurationResponse updateFunctionConfiguration(
UpdateFunctionConfigurationRequest updateFunctionConfigurationRequest) throws ServiceException,
ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException, ResourceConflictException,
PreconditionFailedException, CodeVerificationFailedException, InvalidCodeSignatureException,
CodeSigningConfigNotFoundException, AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateFunctionConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateFunctionConfigurationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateFunctionConfiguration");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateFunctionConfiguration").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateFunctionConfigurationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateFunctionConfigurationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the configuration for asynchronous invocation for a function, version, or alias.
*
*
* To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.
*
*
* @param updateFunctionEventInvokeConfigRequest
* @return Result of the UpdateFunctionEventInvokeConfig operation returned by the service.
* @throws ServiceException
* The Lambda service encountered an internal error.
* @throws ResourceNotFoundException
* The resource specified in the request does not exist.
* @throws InvalidParameterValueException
* One of the parameters in the request is invalid.
* @throws TooManyRequestsException
* The request throughput limit was exceeded.
* @throws ResourceConflictException
* The resource already exists, or another operation is in progress.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws LambdaException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample LambdaClient.UpdateFunctionEventInvokeConfig
* @see AWS API Documentation
*/
@Override
public UpdateFunctionEventInvokeConfigResponse updateFunctionEventInvokeConfig(
UpdateFunctionEventInvokeConfigRequest updateFunctionEventInvokeConfigRequest) throws ServiceException,
ResourceNotFoundException, InvalidParameterValueException, TooManyRequestsException, ResourceConflictException,
AwsServiceException, SdkClientException, LambdaException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateFunctionEventInvokeConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
updateFunctionEventInvokeConfigRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Lambda");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateFunctionEventInvokeConfig");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateFunctionEventInvokeConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateFunctionEventInvokeConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateFunctionEventInvokeConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration,
RequestOverrideConfiguration requestOverrideConfiguration) {
List publishers = null;
if (requestOverrideConfiguration != null) {
publishers = requestOverrideConfiguration.metricPublishers();
}
if (publishers == null || publishers.isEmpty()) {
publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS);
}
if (publishers == null) {
publishers = Collections.emptyList();
}
return publishers;
}
private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory,
JsonOperationMetadata operationMetadata) {
return protocolFactory.createErrorResponseHandler(operationMetadata);
}
private > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(LambdaException::builder)
.protocol(AwsJsonProtocol.REST_JSON)
.protocolVersion("1.1")
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceNotReadyException")
.exceptionBuilderSupplier(ResourceNotReadyException::builder).httpStatusCode(502).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("KMSInvalidStateException")
.exceptionBuilderSupplier(KmsInvalidStateException::builder).httpStatusCode(502).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("KMSNotFoundException")
.exceptionBuilderSupplier(KmsNotFoundException::builder).httpStatusCode(502).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("SubnetIPAddressLimitReachedException")
.exceptionBuilderSupplier(SubnetIpAddressLimitReachedException::builder).httpStatusCode(502)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidZipFileException")
.exceptionBuilderSupplier(InvalidZipFileException::builder).httpStatusCode(502).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidCodeSignatureException")
.exceptionBuilderSupplier(InvalidCodeSignatureException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidRuntimeException")
.exceptionBuilderSupplier(InvalidRuntimeException::builder).httpStatusCode(502).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("EFSMountFailureException")
.exceptionBuilderSupplier(EfsMountFailureException::builder).httpStatusCode(403).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ENILimitReachedException")
.exceptionBuilderSupplier(EniLimitReachedException::builder).httpStatusCode(502).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceNotFoundException")
.exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceConflictException")
.exceptionBuilderSupplier(ResourceConflictException::builder).httpStatusCode(409).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("EC2ThrottledException")
.exceptionBuilderSupplier(Ec2ThrottledException::builder).httpStatusCode(502).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("KMSAccessDeniedException")
.exceptionBuilderSupplier(KmsAccessDeniedException::builder).httpStatusCode(502).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("PreconditionFailedException")
.exceptionBuilderSupplier(PreconditionFailedException::builder).httpStatusCode(412).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("EFSMountTimeoutException")
.exceptionBuilderSupplier(EfsMountTimeoutException::builder).httpStatusCode(408).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("UnsupportedMediaTypeException")
.exceptionBuilderSupplier(UnsupportedMediaTypeException::builder).httpStatusCode(415).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidParameterValueException")
.exceptionBuilderSupplier(InvalidParameterValueException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("EC2AccessDeniedException")
.exceptionBuilderSupplier(Ec2AccessDeniedException::builder).httpStatusCode(502).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceInUseException")
.exceptionBuilderSupplier(ResourceInUseException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("PolicyLengthExceededException")
.exceptionBuilderSupplier(PolicyLengthExceededException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ServiceException")
.exceptionBuilderSupplier(ServiceException::builder).httpStatusCode(500).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidRequestContentException")
.exceptionBuilderSupplier(InvalidRequestContentException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("EFSMountConnectivityException")
.exceptionBuilderSupplier(EfsMountConnectivityException::builder).httpStatusCode(408).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("CodeSigningConfigNotFoundException")
.exceptionBuilderSupplier(CodeSigningConfigNotFoundException::builder).httpStatusCode(404)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ProvisionedConcurrencyConfigNotFoundException")
.exceptionBuilderSupplier(ProvisionedConcurrencyConfigNotFoundException::builder)
.httpStatusCode(404).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("EFSIOException").exceptionBuilderSupplier(EfsioException::builder)
.httpStatusCode(410).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidSubnetIDException")
.exceptionBuilderSupplier(InvalidSubnetIdException::builder).httpStatusCode(502).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("CodeStorageExceededException")
.exceptionBuilderSupplier(CodeStorageExceededException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidSecurityGroupIDException")
.exceptionBuilderSupplier(InvalidSecurityGroupIdException::builder).httpStatusCode(502).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("KMSDisabledException")
.exceptionBuilderSupplier(KmsDisabledException::builder).httpStatusCode(502).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("CodeVerificationFailedException")
.exceptionBuilderSupplier(CodeVerificationFailedException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("EC2UnexpectedException")
.exceptionBuilderSupplier(Ec2UnexpectedException::builder).httpStatusCode(502).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("RequestTooLargeException")
.exceptionBuilderSupplier(RequestTooLargeException::builder).httpStatusCode(413).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TooManyRequestsException")
.exceptionBuilderSupplier(TooManyRequestsException::builder).httpStatusCode(429).build());
}
@Override
public void close() {
clientHandler.close();
}
private T applyPaginatorUserAgent(T request) {
Consumer userAgentApplier = b -> b.addApiName(ApiName.builder()
.version(VersionInfo.SDK_VERSION).name("PAGINATED").build());
AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration()
.map(c -> c.toBuilder().applyMutation(userAgentApplier).build())
.orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build()));
return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
}
@Override
public LambdaWaiter waiter() {
return LambdaWaiter.builder().client(this).build();
}
}