text:
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: lambda

using AWS.Compat
using AWS.UUIDs
"""
    AddLayerVersionPermission()

Adds permissions to the resource-based policy of a version of an AWS Lambda layer. Use this action to grant layer usage permission to other accounts. You can grant permission to a single account, all AWS accounts, or all accounts in an organization. To revoke permission, call RemoveLayerVersionPermission with the statement ID that you specified when you added it.

# Required Parameters
- `Action`: The API action that grants access to the layer. For example, lambda:GetLayerVersion.
- `LayerName`: The name or Amazon Resource Name (ARN) of the layer.
- `Principal`: An account ID, or * to grant permission to all AWS accounts.
- `StatementId`: An identifier that distinguishes the policy from others on the same layer version.
- `VersionNumber`: The version number.

# Optional Parameters
- `OrganizationId`: With the principal set to *, grant permission to all accounts in the specified organization.
- `RevisionId`: Only update the policy if the revision ID matches the ID specified. Use this option to avoid modifying a policy that has changed since you last read it.
"""

add_layer_version_permission(Action, LayerName, Principal, StatementId, VersionNumber; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2018-10-31/layers/$(LayerName)/versions/$(VersionNumber)/policy", Dict{String, Any}("Action"=>Action, "Principal"=>Principal, "StatementId"=>StatementId); aws_config=aws_config)
add_layer_version_permission(Action, LayerName, Principal, StatementId, VersionNumber, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2018-10-31/layers/$(LayerName)/versions/$(VersionNumber)/policy", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Action"=>Action, "Principal"=>Principal, "StatementId"=>StatementId), args)); aws_config=aws_config)

"""
    AddPermission()

Grants an AWS service or another account permission to use a function. You can apply the policy at the function level, or specify a qualifier to restrict access to a single version or alias. If you use a qualifier, the invoker must use the full Amazon Resource Name (ARN) of that version or alias to invoke the function. To grant permission to another account, specify the account ID as the Principal. For AWS services, the principal is a domain-style identifier defined by the service, like s3.amazonaws.com or sns.amazonaws.com. For AWS services, you can also specify the ARN of the associated resource as the SourceArn. If you grant permission to a service principal without specifying the source, other accounts could potentially configure resources in their account to invoke your Lambda function. This action adds a statement to a resource-based permissions policy for the function. For more information about function policies, see Lambda Function Policies.

# Required Parameters
- `Action`: The action that the principal can use on the function. For example, lambda:InvokeFunction or lambda:GetFunction.
- `FunctionName`: The name of the Lambda function, version, or alias.  Name formats     Function name - my-function (name-only), my-function:v1 (with alias).    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- `Principal`: The AWS service or account that invokes the function. If you specify a service, use SourceArn or SourceAccount to limit who can invoke the function through that service.
- `StatementId`: A statement identifier that differentiates the statement from others in the same policy.

# Optional Parameters
- `EventSourceToken`: For Alexa Smart Home functions, a token that must be supplied by the invoker.
- `Qualifier`: Specify a version or alias to add permissions to a published version of the function.
- `RevisionId`: Only update the policy if the revision ID matches the ID that's specified. Use this option to avoid modifying a policy that has changed since you last read it.
- `SourceAccount`: For Amazon S3, the ID of the account that owns the resource. Use this together with SourceArn to ensure that the resource is owned by the specified account. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account.
- `SourceArn`: For AWS services, the ARN of the AWS resource that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic.
"""

add_permission(Action, FunctionName, Principal, StatementId; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2015-03-31/functions/$(FunctionName)/policy", Dict{String, Any}("Action"=>Action, "Principal"=>Principal, "StatementId"=>StatementId); aws_config=aws_config)
add_permission(Action, FunctionName, Principal, StatementId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2015-03-31/functions/$(FunctionName)/policy", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Action"=>Action, "Principal"=>Principal, "StatementId"=>StatementId), args)); aws_config=aws_config)

"""
    CreateAlias()

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.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - MyFunction.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.    Partial ARN - 123456789012:function:MyFunction.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- `FunctionVersion`: The function version that the alias invokes.
- `Name`: The name of the alias.

# Optional Parameters
- `Description`: A description of the alias.
- `RoutingConfig`: The routing configuration of the alias.
"""

create_alias(FunctionName, FunctionVersion, Name; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2015-03-31/functions/$(FunctionName)/aliases", Dict{String, Any}("FunctionVersion"=>FunctionVersion, "Name"=>Name); aws_config=aws_config)
create_alias(FunctionName, FunctionVersion, Name, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2015-03-31/functions/$(FunctionName)/aliases", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("FunctionVersion"=>FunctionVersion, "Name"=>Name), args)); aws_config=aws_config)

"""
    CreateEventSourceMapping()

Creates a mapping between an event source and an AWS Lambda function. Lambda reads items from the event source and triggers the function. For details about each event source type, see the following topics.    Using AWS Lambda with Amazon DynamoDB     Using AWS Lambda with Amazon Kinesis     Using AWS Lambda with Amazon SQS     Using AWS Lambda with Amazon MSK    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. Default -1 (infinite). Minimum 60. Maximum 604800.    MaximumRetryAttempts - Discard records after the specified number of retries. Default -1 (infinite). Minimum 0. Maximum 10000. When infinite, failed records will be retried until the record expires.    ParallelizationFactor - Process multiple batches from each shard concurrently.

# Required Parameters
- `EventSourceArn`: The Amazon Resource Name (ARN) of the event source.    Amazon Kinesis - The ARN of the data stream or a stream consumer.    Amazon DynamoDB Streams - The ARN of the stream.    Amazon Simple Queue Service - The ARN of the queue.    Amazon Managed Streaming for Apache Kafka - The ARN of the cluster.
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - MyFunction.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.    Version or Alias ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD.    Partial ARN - 123456789012:function:MyFunction.   The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.

# Optional Parameters
- `BatchSize`: The maximum number of items to retrieve in a single batch.    Amazon Kinesis - Default 100. Max 10,000.    Amazon DynamoDB Streams - Default 100. Max 1,000.    Amazon Simple Queue Service - Default 10. Max 10.    Amazon Managed Streaming for Apache Kafka - Default 100. Max 10,000.
- `BisectBatchOnFunctionError`: (Streams) If the function returns an error, split the batch in two and retry.
- `DestinationConfig`: (Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
- `Enabled`: If true, the event source mapping is active. Set to false to pause polling and invocation.
- `MaximumBatchingWindowInSeconds`: (Streams) The maximum amount of time to gather records before invoking the function, in seconds.
- `MaximumRecordAgeInSeconds`: (Streams) Discard records older than the specified age. The default value is infinite (-1).
- `MaximumRetryAttempts`: (Streams) Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records will be retried until the record expires.
- `ParallelizationFactor`: (Streams) The number of batches to process from each shard concurrently.
- `StartingPosition`: The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources. AT_TIMESTAMP is only supported for Amazon Kinesis streams.
- `StartingPositionTimestamp`: With StartingPosition set to AT_TIMESTAMP, the time from which to start reading.
- `Topics`:  (MSK) The name of the Kafka topic.
"""

create_event_source_mapping(EventSourceArn, FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2015-03-31/event-source-mappings/", Dict{String, Any}("EventSourceArn"=>EventSourceArn, "FunctionName"=>FunctionName); aws_config=aws_config)
create_event_source_mapping(EventSourceArn, FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2015-03-31/event-source-mappings/", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("EventSourceArn"=>EventSourceArn, "FunctionName"=>FunctionName), args)); aws_config=aws_config)

"""
    CreateFunction()

Creates a Lambda function. To create a function, you need a deployment package and an execution role. The deployment package contains your function code. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X-Ray for request tracing. When you create a function, Lambda provisions an instance of the function and its supporting resources. If your function connects to a VPC, this process can take a minute or so. During this time, you can't invoke or modify the function. The State, StateReason, and StateReasonCode fields in the response from GetFunctionConfiguration indicate when the function is ready to invoke. For more information, see Function States. A function has an unpublished version, and can have published versions and aliases. The unpublished version changes when you update your function's code and configuration. A published version is a snapshot of your function code and configuration that can't be changed. An alias is a named resource that maps to a version, and can be changed to map to a different version. Use the Publish parameter to create version 1 of your function from its initial configuration. The other parameters let you configure version-specific and function-level settings. You can modify version-specific settings later with UpdateFunctionConfiguration. Function-level settings apply to both the unpublished and published versions of the function, and include tags (TagResource) and per-function concurrency limits (PutFunctionConcurrency). If another account or an AWS service invokes your function, use AddPermission to grant permission by creating a resource-based IAM policy. You can grant permissions at the function level, on a version, or on an alias. To invoke your function directly, use Invoke. To invoke your function in response to events in other AWS services, create an event source mapping (CreateEventSourceMapping), or configure a function trigger in the other service. For more information, see Invoking Functions.

# Required Parameters
- `Code`: The code for the function.
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - my-function.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- `Handler`: The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Programming Model.
- `Role`: The Amazon Resource Name (ARN) of the function's execution role.
- `Runtime`: The identifier of the function's runtime.

# Optional Parameters
- `DeadLetterConfig`: A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see Dead Letter Queues.
- `Description`: A description of the function.
- `Environment`: Environment variables that are accessible from function code during execution.
- `FileSystemConfigs`: Connection settings for an Amazon EFS file system.
- `KMSKeyArn`: The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.
- `Layers`: A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.
- `MemorySize`: The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. The default value is 128 MB. The value must be a multiple of 64 MB.
- `Publish`: Set to true to publish the first version of the function during creation.
- `Tags`: A list of tags to apply to the function.
- `Timeout`: The amount of time that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds.
- `TracingConfig`: Set Mode to Active to sample and trace a subset of incoming requests with AWS X-Ray.
- `VpcConfig`: For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can only access resources and the internet through that VPC. For more information, see VPC Settings.
"""

create_function(Code, FunctionName, Handler, Role, Runtime; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2015-03-31/functions", Dict{String, Any}("Code"=>Code, "FunctionName"=>FunctionName, "Handler"=>Handler, "Role"=>Role, "Runtime"=>Runtime); aws_config=aws_config)
create_function(Code, FunctionName, Handler, Role, Runtime, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2015-03-31/functions", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Code"=>Code, "FunctionName"=>FunctionName, "Handler"=>Handler, "Role"=>Role, "Runtime"=>Runtime), args)); aws_config=aws_config)

"""
    DeleteAlias()

Deletes a Lambda function alias.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - MyFunction.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.    Partial ARN - 123456789012:function:MyFunction.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- `Name`: The name of the alias.

"""

delete_alias(FunctionName, Name; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2015-03-31/functions/$(FunctionName)/aliases/$(Name)"; aws_config=aws_config)
delete_alias(FunctionName, Name, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2015-03-31/functions/$(FunctionName)/aliases/$(Name)", args; aws_config=aws_config)

"""
    DeleteEventSourceMapping()

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.

# Required Parameters
- `UUID`: The identifier of the event source mapping.

"""

delete_event_source_mapping(UUID; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2015-03-31/event-source-mappings/$(UUID)"; aws_config=aws_config)
delete_event_source_mapping(UUID, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2015-03-31/event-source-mappings/$(UUID)", args; aws_config=aws_config)

"""
    DeleteFunction()

Deletes a Lambda function. To delete a specific function version, use the Qualifier parameter. Otherwise, all versions and aliases are deleted. To delete Lambda event source mappings that invoke a function, use DeleteEventSourceMapping. For AWS services and resources that invoke your function directly, delete the trigger in the service where you originally configured it.

# Required Parameters
- `FunctionName`: The name of the Lambda function or version.  Name formats     Function name - my-function (name-only), my-function:1 (with version).    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `Qualifier`: Specify a version to delete. You can't delete a version that's referenced by an alias.
"""

delete_function(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2015-03-31/functions/$(FunctionName)"; aws_config=aws_config)
delete_function(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2015-03-31/functions/$(FunctionName)", args; aws_config=aws_config)

"""
    DeleteFunctionConcurrency()

Removes a concurrent execution limit from a function.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - my-function.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

"""

delete_function_concurrency(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2017-10-31/functions/$(FunctionName)/concurrency"; aws_config=aws_config)
delete_function_concurrency(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2017-10-31/functions/$(FunctionName)/concurrency", args; aws_config=aws_config)

"""
    DeleteFunctionEventInvokeConfig()

Deletes the configuration for asynchronous invocation for a function, version, or alias. To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

# Required Parameters
- `FunctionName`: The name of the Lambda function, version, or alias.  Name formats     Function name - my-function (name-only), my-function:v1 (with alias).    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `Qualifier`: A version number or alias name.
"""

delete_function_event_invoke_config(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2019-09-25/functions/$(FunctionName)/event-invoke-config"; aws_config=aws_config)
delete_function_event_invoke_config(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2019-09-25/functions/$(FunctionName)/event-invoke-config", args; aws_config=aws_config)

"""
    DeleteLayerVersion()

Deletes a version of an AWS Lambda layer. Deleted versions can no longer be viewed or added to functions. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it.

# Required Parameters
- `LayerName`: The name or Amazon Resource Name (ARN) of the layer.
- `VersionNumber`: The version number.

"""

delete_layer_version(LayerName, VersionNumber; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2018-10-31/layers/$(LayerName)/versions/$(VersionNumber)"; aws_config=aws_config)
delete_layer_version(LayerName, VersionNumber, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2018-10-31/layers/$(LayerName)/versions/$(VersionNumber)", args; aws_config=aws_config)

"""
    DeleteProvisionedConcurrencyConfig()

Deletes the provisioned concurrency configuration for a function.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - my-function.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- `Qualifier`: The version number or alias name.

"""

delete_provisioned_concurrency_config(FunctionName, Qualifier; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2019-09-30/functions/$(FunctionName)/provisioned-concurrency", Dict{String, Any}("Qualifier"=>Qualifier); aws_config=aws_config)
delete_provisioned_concurrency_config(FunctionName, Qualifier, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2019-09-30/functions/$(FunctionName)/provisioned-concurrency", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Qualifier"=>Qualifier), args)); aws_config=aws_config)

"""
    GetAccountSettings()

Retrieves details about your account's limits and usage in an AWS Region.

"""

get_account_settings(; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2016-08-19/account-settings/"; aws_config=aws_config)
get_account_settings(args::AbstractDict{String, Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2016-08-19/account-settings/", args; aws_config=aws_config)

"""
    GetAlias()

Returns details about a Lambda function alias.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - MyFunction.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.    Partial ARN - 123456789012:function:MyFunction.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- `Name`: The name of the alias.

"""

get_alias(FunctionName, Name; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/functions/$(FunctionName)/aliases/$(Name)"; aws_config=aws_config)
get_alias(FunctionName, Name, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/functions/$(FunctionName)/aliases/$(Name)", args; aws_config=aws_config)

"""
    GetEventSourceMapping()

Returns details about an event source mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.

# Required Parameters
- `UUID`: The identifier of the event source mapping.

"""

get_event_source_mapping(UUID; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/event-source-mappings/$(UUID)"; aws_config=aws_config)
get_event_source_mapping(UUID, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/event-source-mappings/$(UUID)", args; aws_config=aws_config)

"""
    GetFunction()

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.

# Required Parameters
- `FunctionName`: The name of the Lambda function, version, or alias.  Name formats     Function name - my-function (name-only), my-function:v1 (with alias).    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `Qualifier`: Specify a version or alias to get details about a published version of the function.
"""

get_function(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/functions/$(FunctionName)"; aws_config=aws_config)
get_function(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/functions/$(FunctionName)", args; aws_config=aws_config)

"""
    GetFunctionConcurrency()

Returns details about the reserved concurrency configuration for a function. To set a concurrency limit for a function, use PutFunctionConcurrency.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - my-function.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

"""

get_function_concurrency(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2019-09-30/functions/$(FunctionName)/concurrency"; aws_config=aws_config)
get_function_concurrency(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2019-09-30/functions/$(FunctionName)/concurrency", args; aws_config=aws_config)

"""
    GetFunctionConfiguration()

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.

# Required Parameters
- `FunctionName`: The name of the Lambda function, version, or alias.  Name formats     Function name - my-function (name-only), my-function:v1 (with alias).    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `Qualifier`: Specify a version or alias to get details about a published version of the function.
"""

get_function_configuration(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/functions/$(FunctionName)/configuration"; aws_config=aws_config)
get_function_configuration(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/functions/$(FunctionName)/configuration", args; aws_config=aws_config)

"""
    GetFunctionEventInvokeConfig()

Retrieves the configuration for asynchronous invocation for a function, version, or alias. To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

# Required Parameters
- `FunctionName`: The name of the Lambda function, version, or alias.  Name formats     Function name - my-function (name-only), my-function:v1 (with alias).    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `Qualifier`: A version number or alias name.
"""

get_function_event_invoke_config(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2019-09-25/functions/$(FunctionName)/event-invoke-config"; aws_config=aws_config)
get_function_event_invoke_config(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2019-09-25/functions/$(FunctionName)/event-invoke-config", args; aws_config=aws_config)

"""
    GetLayerVersion()

Returns information about a version of an AWS Lambda layer, with a link to download the layer archive that's valid for 10 minutes.

# Required Parameters
- `LayerName`: The name or Amazon Resource Name (ARN) of the layer.
- `VersionNumber`: The version number.

"""

get_layer_version(LayerName, VersionNumber; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2018-10-31/layers/$(LayerName)/versions/$(VersionNumber)"; aws_config=aws_config)
get_layer_version(LayerName, VersionNumber, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2018-10-31/layers/$(LayerName)/versions/$(VersionNumber)", args; aws_config=aws_config)

"""
    GetLayerVersionByArn()

Returns information about a version of an AWS Lambda layer, with a link to download the layer archive that's valid for 10 minutes.

# Required Parameters
- `Arn`: The ARN of the layer version.

"""

get_layer_version_by_arn(Arn; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2018-10-31/layers?find=LayerVersion", Dict{String, Any}("Arn"=>Arn); aws_config=aws_config)
get_layer_version_by_arn(Arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2018-10-31/layers?find=LayerVersion", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Arn"=>Arn), args)); aws_config=aws_config)

"""
    GetLayerVersionPolicy()

Returns the permission policy for a version of an AWS Lambda layer. For more information, see AddLayerVersionPermission.

# Required Parameters
- `LayerName`: The name or Amazon Resource Name (ARN) of the layer.
- `VersionNumber`: The version number.

"""

get_layer_version_policy(LayerName, VersionNumber; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2018-10-31/layers/$(LayerName)/versions/$(VersionNumber)/policy"; aws_config=aws_config)
get_layer_version_policy(LayerName, VersionNumber, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2018-10-31/layers/$(LayerName)/versions/$(VersionNumber)/policy", args; aws_config=aws_config)

"""
    GetPolicy()

Returns the resource-based IAM policy for a function, version, or alias.

# Required Parameters
- `FunctionName`: The name of the Lambda function, version, or alias.  Name formats     Function name - my-function (name-only), my-function:v1 (with alias).    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `Qualifier`: Specify a version or alias to get the policy for that resource.
"""

get_policy(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/functions/$(FunctionName)/policy"; aws_config=aws_config)
get_policy(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/functions/$(FunctionName)/policy", args; aws_config=aws_config)

"""
    GetProvisionedConcurrencyConfig()

Retrieves the provisioned concurrency configuration for a function's alias or version.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - my-function.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- `Qualifier`: The version number or alias name.

"""

get_provisioned_concurrency_config(FunctionName, Qualifier; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2019-09-30/functions/$(FunctionName)/provisioned-concurrency", Dict{String, Any}("Qualifier"=>Qualifier); aws_config=aws_config)
get_provisioned_concurrency_config(FunctionName, Qualifier, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2019-09-30/functions/$(FunctionName)/provisioned-concurrency", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Qualifier"=>Qualifier), args)); aws_config=aws_config)

"""
    Invoke()

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.

# Required Parameters
- `FunctionName`: The name of the Lambda function, version, or alias.  Name formats     Function name - my-function (name-only), my-function:v1 (with alias).    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `Payload`: The JSON that you want to provide to your Lambda function as input.
- `Qualifier`: Specify a version or alias to invoke a published version of the function.
- `X-Amz-Client-Context`: Up to 3583 bytes of base64-encoded data about the invoking client to pass to the function in the context object.
- `X-Amz-Invocation-Type`: Choose from the following options.    RequestResponse (default) - Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data.    Event - Invoke the function asynchronously. Send events that fail multiple times to the function's dead-letter queue (if it's configured). The API response only includes a status code.    DryRun - Validate parameter values and verify that the user or role has permission to invoke the function.
- `X-Amz-Log-Type`: Set to Tail to include the execution log in the response.
"""

invoke(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2015-03-31/functions/$(FunctionName)/invocations"; aws_config=aws_config)
invoke(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2015-03-31/functions/$(FunctionName)/invocations", args; aws_config=aws_config)

"""
    InvokeAsync()

 For asynchronous function invocation, use Invoke.  Invokes a function asynchronously.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - my-function.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- `InvokeArgs`: The JSON that you want to provide to your Lambda function as input.

"""

invoke_async(FunctionName, InvokeArgs; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2014-11-13/functions/$(FunctionName)/invoke-async/", Dict{String, Any}("InvokeArgs"=>InvokeArgs); aws_config=aws_config)
invoke_async(FunctionName, InvokeArgs, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2014-11-13/functions/$(FunctionName)/invoke-async/", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("InvokeArgs"=>InvokeArgs), args)); aws_config=aws_config)

"""
    ListAliases()

Returns a list of aliases for a Lambda function.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - MyFunction.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.    Partial ARN - 123456789012:function:MyFunction.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `FunctionVersion`: Specify a function version to only list aliases that invoke that version.
- `Marker`: Specify the pagination token that's returned by a previous request to retrieve the next page of results.
- `MaxItems`: Limit the number of aliases returned.
"""

list_aliases(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/functions/$(FunctionName)/aliases"; aws_config=aws_config)
list_aliases(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/functions/$(FunctionName)/aliases", args; aws_config=aws_config)

"""
    ListEventSourceMappings()

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

# Optional Parameters
- `EventSourceArn`: The Amazon Resource Name (ARN) of the event source.    Amazon Kinesis - The ARN of the data stream or a stream consumer.    Amazon DynamoDB Streams - The ARN of the stream.    Amazon Simple Queue Service - The ARN of the queue.    Amazon Managed Streaming for Apache Kafka - The ARN of the cluster.
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - MyFunction.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.    Version or Alias ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD.    Partial ARN - 123456789012:function:MyFunction.   The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.
- `Marker`: A pagination token returned by a previous call.
- `MaxItems`: The maximum number of event source mappings to return.
"""

list_event_source_mappings(; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/event-source-mappings/"; aws_config=aws_config)
list_event_source_mappings(args::AbstractDict{String, Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/event-source-mappings/", args; aws_config=aws_config)

"""
    ListFunctionEventInvokeConfigs()

Retrieves a list of configurations for asynchronous invocation for a function. To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - my-function.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `Marker`: Specify the pagination token that's returned by a previous request to retrieve the next page of results.
- `MaxItems`: The maximum number of configurations to return.
"""

list_function_event_invoke_configs(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2019-09-25/functions/$(FunctionName)/event-invoke-config/list"; aws_config=aws_config)
list_function_event_invoke_configs(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2019-09-25/functions/$(FunctionName)/event-invoke-config/list", args; aws_config=aws_config)

"""
    ListFunctions()

Returns a list of Lambda functions, with the version-specific configuration of each. Lambda returns up to 50 functions per call. Set FunctionVersion to ALL to include all published versions of each function in addition to the unpublished version. To get more information about a function or version, use GetFunction.

# Optional Parameters
- `FunctionVersion`: Set to ALL to include entries for all published versions of each function.
- `Marker`: Specify the pagination token that's returned by a previous request to retrieve the next page of results.
- `MasterRegion`: For Lambda@Edge functions, the AWS Region of the master function. For example, us-east-1 filters the list of functions to only include Lambda@Edge functions replicated from a master function in US East (N. Virginia). If specified, you must set FunctionVersion to ALL.
- `MaxItems`: The maximum number of functions to return.
"""

list_functions(; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/functions/"; aws_config=aws_config)
list_functions(args::AbstractDict{String, Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/functions/", args; aws_config=aws_config)

"""
    ListLayerVersions()

Lists the versions of an AWS 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.

# Required Parameters
- `LayerName`: The name or Amazon Resource Name (ARN) of the layer.

# Optional Parameters
- `CompatibleRuntime`: A runtime identifier. For example, go1.x.
- `Marker`: A pagination token returned by a previous call.
- `MaxItems`: The maximum number of versions to return.
"""

list_layer_versions(LayerName; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2018-10-31/layers/$(LayerName)/versions"; aws_config=aws_config)
list_layer_versions(LayerName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2018-10-31/layers/$(LayerName)/versions", args; aws_config=aws_config)

"""
    ListLayers()

Lists AWS 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.

# Optional Parameters
- `CompatibleRuntime`: A runtime identifier. For example, go1.x.
- `Marker`: A pagination token returned by a previous call.
- `MaxItems`: The maximum number of layers to return.
"""

list_layers(; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2018-10-31/layers"; aws_config=aws_config)
list_layers(args::AbstractDict{String, Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2018-10-31/layers", args; aws_config=aws_config)

"""
    ListProvisionedConcurrencyConfigs()

Retrieves a list of provisioned concurrency configurations for a function.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - my-function.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `Marker`: Specify the pagination token that's returned by a previous request to retrieve the next page of results.
- `MaxItems`: Specify a number to limit the number of configurations returned.
"""

list_provisioned_concurrency_configs(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2019-09-30/functions/$(FunctionName)/provisioned-concurrency?List=ALL"; aws_config=aws_config)
list_provisioned_concurrency_configs(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2019-09-30/functions/$(FunctionName)/provisioned-concurrency?List=ALL", args; aws_config=aws_config)

"""
    ListTags()

Returns a function's tags. You can also view tags with GetFunction.

# Required Parameters
- `ARN`: The function's Amazon Resource Name (ARN).

"""

list_tags(ARN; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2017-03-31/tags/$(ARN)"; aws_config=aws_config)
list_tags(ARN, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2017-03-31/tags/$(ARN)", args; aws_config=aws_config)

"""
    ListVersionsByFunction()

Returns a list of versions, with the version-specific configuration of each. Lambda returns up to 50 versions per call.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - MyFunction.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.    Partial ARN - 123456789012:function:MyFunction.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `Marker`: Specify the pagination token that's returned by a previous request to retrieve the next page of results.
- `MaxItems`: The maximum number of versions to return.
"""

list_versions_by_function(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/functions/$(FunctionName)/versions"; aws_config=aws_config)
list_versions_by_function(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("GET", "/2015-03-31/functions/$(FunctionName)/versions", args; aws_config=aws_config)

"""
    PublishLayerVersion()

Creates an AWS 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.

# Required Parameters
- `Content`: The function layer archive.
- `LayerName`: The name or Amazon Resource Name (ARN) of the layer.

# Optional Parameters
- `CompatibleRuntimes`: A list of compatible function runtimes. Used for filtering with ListLayers and ListLayerVersions.
- `Description`: The description of the version.
- `LicenseInfo`: The layer's software license. It can be any of the following:   An SPDX license identifier. For example, MIT.   The URL of a license hosted on the internet. For example, https://opensource.org/licenses/MIT.   The full text of the license.
"""

publish_layer_version(Content, LayerName; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2018-10-31/layers/$(LayerName)/versions", Dict{String, Any}("Content"=>Content); aws_config=aws_config)
publish_layer_version(Content, LayerName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2018-10-31/layers/$(LayerName)/versions", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Content"=>Content), args)); aws_config=aws_config)

"""
    PublishVersion()

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

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - MyFunction.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.    Partial ARN - 123456789012:function:MyFunction.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `CodeSha256`: Only publish a version if the hash value matches the value that's specified. Use this option to avoid publishing a version if the function code has changed since you last updated it. You can get the hash for the version that you uploaded from the output of UpdateFunctionCode.
- `Description`: A description for the version to override the description in the function configuration.
- `RevisionId`: Only update the function if the revision ID matches the ID that's specified. Use this option to avoid publishing a version if the function configuration has changed since you last updated it.
"""

publish_version(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2015-03-31/functions/$(FunctionName)/versions"; aws_config=aws_config)
publish_version(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2015-03-31/functions/$(FunctionName)/versions", args; aws_config=aws_config)

"""
    PutFunctionConcurrency()

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.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - my-function.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- `ReservedConcurrentExecutions`: The number of simultaneous executions to reserve for the function.

"""

put_function_concurrency(FunctionName, ReservedConcurrentExecutions; aws_config::AWSConfig=global_aws_config()) = lambda("PUT", "/2017-10-31/functions/$(FunctionName)/concurrency", Dict{String, Any}("ReservedConcurrentExecutions"=>ReservedConcurrentExecutions); aws_config=aws_config)
put_function_concurrency(FunctionName, ReservedConcurrentExecutions, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("PUT", "/2017-10-31/functions/$(FunctionName)/concurrency", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ReservedConcurrentExecutions"=>ReservedConcurrentExecutions), args)); aws_config=aws_config)

"""
    PutFunctionEventInvokeConfig()

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.

# Required Parameters
- `FunctionName`: The name of the Lambda function, version, or alias.  Name formats     Function name - my-function (name-only), my-function:v1 (with alias).    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `DestinationConfig`: A destination for events after they have been sent to a function for processing.  Destinations     Function - The Amazon Resource Name (ARN) of a Lambda function.    Queue - The ARN of an SQS queue.    Topic - The ARN of an SNS topic.    Event Bus - The ARN of an Amazon EventBridge event bus.
- `MaximumEventAgeInSeconds`: The maximum age of a request that Lambda sends to a function for processing.
- `MaximumRetryAttempts`: The maximum number of times to retry when the function returns an error.
- `Qualifier`: A version number or alias name.
"""

put_function_event_invoke_config(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("PUT", "/2019-09-25/functions/$(FunctionName)/event-invoke-config"; aws_config=aws_config)
put_function_event_invoke_config(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("PUT", "/2019-09-25/functions/$(FunctionName)/event-invoke-config", args; aws_config=aws_config)

"""
    PutProvisionedConcurrencyConfig()

Adds a provisioned concurrency configuration to a function's alias or version.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - my-function.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- `ProvisionedConcurrentExecutions`: The amount of provisioned concurrency to allocate for the version or alias.
- `Qualifier`: The version number or alias name.

"""

put_provisioned_concurrency_config(FunctionName, ProvisionedConcurrentExecutions, Qualifier; aws_config::AWSConfig=global_aws_config()) = lambda("PUT", "/2019-09-30/functions/$(FunctionName)/provisioned-concurrency", Dict{String, Any}("ProvisionedConcurrentExecutions"=>ProvisionedConcurrentExecutions, "Qualifier"=>Qualifier); aws_config=aws_config)
put_provisioned_concurrency_config(FunctionName, ProvisionedConcurrentExecutions, Qualifier, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("PUT", "/2019-09-30/functions/$(FunctionName)/provisioned-concurrency", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ProvisionedConcurrentExecutions"=>ProvisionedConcurrentExecutions, "Qualifier"=>Qualifier), args)); aws_config=aws_config)

"""
    RemoveLayerVersionPermission()

Removes a statement from the permissions policy for a version of an AWS Lambda layer. For more information, see AddLayerVersionPermission.

# Required Parameters
- `LayerName`: The name or Amazon Resource Name (ARN) of the layer.
- `StatementId`: The identifier that was specified when the statement was added.
- `VersionNumber`: The version number.

# Optional Parameters
- `RevisionId`: Only update the policy if the revision ID matches the ID specified. Use this option to avoid modifying a policy that has changed since you last read it.
"""

remove_layer_version_permission(LayerName, StatementId, VersionNumber; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2018-10-31/layers/$(LayerName)/versions/$(VersionNumber)/policy/$(StatementId)"; aws_config=aws_config)
remove_layer_version_permission(LayerName, StatementId, VersionNumber, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2018-10-31/layers/$(LayerName)/versions/$(VersionNumber)/policy/$(StatementId)", args; aws_config=aws_config)

"""
    RemovePermission()

Revokes function-use permission from an AWS service or another account. You can get the ID of the statement from the output of GetPolicy.

# Required Parameters
- `FunctionName`: The name of the Lambda function, version, or alias.  Name formats     Function name - my-function (name-only), my-function:v1 (with alias).    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- `StatementId`: Statement ID of the permission to remove.

# Optional Parameters
- `Qualifier`: Specify a version or alias to remove permissions from a published version of the function.
- `RevisionId`: Only update the policy if the revision ID matches the ID that's specified. Use this option to avoid modifying a policy that has changed since you last read it.
"""

remove_permission(FunctionName, StatementId; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2015-03-31/functions/$(FunctionName)/policy/$(StatementId)"; aws_config=aws_config)
remove_permission(FunctionName, StatementId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2015-03-31/functions/$(FunctionName)/policy/$(StatementId)", args; aws_config=aws_config)

"""
    TagResource()

Adds tags to a function.

# Required Parameters
- `ARN`: The function's Amazon Resource Name (ARN).
- `Tags`: A list of tags to apply to the function.

"""

tag_resource(ARN, Tags; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2017-03-31/tags/$(ARN)", Dict{String, Any}("Tags"=>Tags); aws_config=aws_config)
tag_resource(ARN, Tags, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2017-03-31/tags/$(ARN)", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Tags"=>Tags), args)); aws_config=aws_config)

"""
    UntagResource()

Removes tags from a function.

# Required Parameters
- `ARN`: The function's Amazon Resource Name (ARN).
- `tagKeys`: A list of tag keys to remove from the function.

"""

untag_resource(ARN, tagKeys; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2017-03-31/tags/$(ARN)", Dict{String, Any}("tagKeys"=>tagKeys); aws_config=aws_config)
untag_resource(ARN, tagKeys, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("DELETE", "/2017-03-31/tags/$(ARN)", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("tagKeys"=>tagKeys), args)); aws_config=aws_config)

"""
    UpdateAlias()

Updates the configuration of a Lambda function alias.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - MyFunction.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.    Partial ARN - 123456789012:function:MyFunction.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- `Name`: The name of the alias.

# Optional Parameters
- `Description`: A description of the alias.
- `FunctionVersion`: The function version that the alias invokes.
- `RevisionId`: Only update the alias if the revision ID matches the ID that's specified. Use this option to avoid modifying an alias that has changed since you last read it.
- `RoutingConfig`: The routing configuration of the alias.
"""

update_alias(FunctionName, Name; aws_config::AWSConfig=global_aws_config()) = lambda("PUT", "/2015-03-31/functions/$(FunctionName)/aliases/$(Name)"; aws_config=aws_config)
update_alias(FunctionName, Name, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("PUT", "/2015-03-31/functions/$(FunctionName)/aliases/$(Name)", args; aws_config=aws_config)

"""
    UpdateEventSourceMapping()

Updates an event source mapping. You can change the function that AWS 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. Default -1 (infinite). Minimum 60. Maximum 604800.    MaximumRetryAttempts - Discard records after the specified number of retries. Default -1 (infinite). Minimum 0. Maximum 10000. When infinite, failed records will be retried until the record expires.    ParallelizationFactor - Process multiple batches from each shard concurrently.

# Required Parameters
- `UUID`: The identifier of the event source mapping.

# Optional Parameters
- `BatchSize`: The maximum number of items to retrieve in a single batch.    Amazon Kinesis - Default 100. Max 10,000.    Amazon DynamoDB Streams - Default 100. Max 1,000.    Amazon Simple Queue Service - Default 10. Max 10.    Amazon Managed Streaming for Apache Kafka - Default 100. Max 10,000.
- `BisectBatchOnFunctionError`: (Streams) If the function returns an error, split the batch in two and retry.
- `DestinationConfig`: (Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
- `Enabled`: If true, the event source mapping is active. Set to false to pause polling and invocation.
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - MyFunction.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.    Version or Alias ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD.    Partial ARN - 123456789012:function:MyFunction.   The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.
- `MaximumBatchingWindowInSeconds`: (Streams) The maximum amount of time to gather records before invoking the function, in seconds.
- `MaximumRecordAgeInSeconds`: (Streams) Discard records older than the specified age. The default value is infinite (-1).
- `MaximumRetryAttempts`: (Streams) Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records will be retried until the record expires.
- `ParallelizationFactor`: (Streams) The number of batches to process from each shard concurrently.
"""

update_event_source_mapping(UUID; aws_config::AWSConfig=global_aws_config()) = lambda("PUT", "/2015-03-31/event-source-mappings/$(UUID)"; aws_config=aws_config)
update_event_source_mapping(UUID, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("PUT", "/2015-03-31/event-source-mappings/$(UUID)", args; aws_config=aws_config)

"""
    UpdateFunctionCode()

Updates a Lambda function's code. 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.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - my-function.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `DryRun`: Set to true to validate the request parameters and access permissions without modifying the function code.
- `Publish`: Set to true to publish a new version of the function after updating the code. This has the same effect as calling PublishVersion separately.
- `RevisionId`: Only update the function if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it.
- `S3Bucket`: An Amazon S3 bucket in the same AWS Region as your function. The bucket can be in a different AWS account.
- `S3Key`: The Amazon S3 key of the deployment package.
- `S3ObjectVersion`: For versioned objects, the version of the deployment package object to use.
- `ZipFile`: The base64-encoded contents of the deployment package. AWS SDK and AWS CLI clients handle the encoding for you.
"""

update_function_code(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("PUT", "/2015-03-31/functions/$(FunctionName)/code"; aws_config=aws_config)
update_function_code(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("PUT", "/2015-03-31/functions/$(FunctionName)/code", args; aws_config=aws_config)

"""
    UpdateFunctionConfiguration()

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 AWS service, use AddPermission.

# Required Parameters
- `FunctionName`: The name of the Lambda function.  Name formats     Function name - my-function.    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `DeadLetterConfig`: A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see Dead Letter Queues.
- `Description`: A description of the function.
- `Environment`: Environment variables that are accessible from function code during execution.
- `FileSystemConfigs`: Connection settings for an Amazon EFS file system.
- `Handler`: The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Programming Model.
- `KMSKeyArn`: The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.
- `Layers`: A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.
- `MemorySize`: The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. The default value is 128 MB. The value must be a multiple of 64 MB.
- `RevisionId`: Only update the function if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it.
- `Role`: The Amazon Resource Name (ARN) of the function's execution role.
- `Runtime`: The identifier of the function's runtime.
- `Timeout`: The amount of time that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds.
- `TracingConfig`: Set Mode to Active to sample and trace a subset of incoming requests with AWS X-Ray.
- `VpcConfig`: For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can only access resources and the internet through that VPC. For more information, see VPC Settings.
"""

update_function_configuration(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("PUT", "/2015-03-31/functions/$(FunctionName)/configuration"; aws_config=aws_config)
update_function_configuration(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("PUT", "/2015-03-31/functions/$(FunctionName)/configuration", args; aws_config=aws_config)

"""
    UpdateFunctionEventInvokeConfig()

Updates the configuration for asynchronous invocation for a function, version, or alias. To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

# Required Parameters
- `FunctionName`: The name of the Lambda function, version, or alias.  Name formats     Function name - my-function (name-only), my-function:v1 (with alias).    Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.    Partial ARN - 123456789012:function:my-function.   You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

# Optional Parameters
- `DestinationConfig`: A destination for events after they have been sent to a function for processing.  Destinations     Function - The Amazon Resource Name (ARN) of a Lambda function.    Queue - The ARN of an SQS queue.    Topic - The ARN of an SNS topic.    Event Bus - The ARN of an Amazon EventBridge event bus.
- `MaximumEventAgeInSeconds`: The maximum age of a request that Lambda sends to a function for processing.
- `MaximumRetryAttempts`: The maximum number of times to retry when the function returns an error.
- `Qualifier`: A version number or alias name.
"""

update_function_event_invoke_config(FunctionName; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2019-09-25/functions/$(FunctionName)/event-invoke-config"; aws_config=aws_config)
update_function_event_invoke_config(FunctionName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = lambda("POST", "/2019-09-25/functions/$(FunctionName)/event-invoke-config", args; aws_config=aws_config)


text:
#===============================================================================

The minimum number of cubes to cover every visible face on a cuboid measuring 3 x 2 x 1 is twenty-two.

If we then add a second layer to this solid it would require forty-six cubes to
cover every visible face, the third layer would require seventy-eight cubes, and
the fourth layer would require one-hundred and eighteen cubes to cover every
visible face.

However, the first layer on a cuboid measuring 5 x 1 x 1 also requires
twenty-two cubes; similarly the first layer on cuboids measuring 5 x 3 x 1, 7 x
2 x 1, and 11 x 1 x 1 all contain forty-six cubes.

We shall define C(n) to represent the number of cuboids that contain n cubes in
one of its layers. So C(22) = 2, C(46) = 4, C(78) = 5, and C(118) = 8.

It turns out that 154 is the least value of n for which C(n) = 10.

Find the least value of n for which C(n) = 1000.

--------------------------------------------------------------------------------

Let's first compute the number of cube a layer is composed of given an initial
rectangular parallelepiped of sides a, b and c along 1x, 1y and 1z.

Let chose a slice of size 1 along the plane 1xy, and consider the successive
layers. The figure below represent the initial cut with 0 (here for a=3 and
b=2), and three successive layers grown around it:

        3333
       322223
      32111123
     3210000123
     3210000123
      32111123
       322223
        3333

If P=2*(a+b) is the perimeter, then we see that the number of cubes is:
    Layer 1: P
    Layer 2: P+4
    Layer 3: P+8
    => For the layer n, the number of cubes is P+4(n-1). This is valid for all
slices of length 1, so it comes that the number of cubes in the layer N for all
slices is c(P+4(n-1)).

Doing so, we have covered the faces that are parallel to 1xz and 1yz, but we
still have to cover the two faces parallel to 1xy. Looking again that the
figure, it comes that the number of Cube to cover that face is
    Layer 1: A = ab, the initial area of that face
    Layer 2: Layer 1 + size(border Layer 1) = A + P
    Layer 3: Layer 2 + size(border Layer 2) = A + P + P + 4
    Layer 4: Layer 3 + size(border Layer 3) = A + P + P + 4 + P + 8

=> Layer n = A + (n-1) P + 4 (1+n-2)(n-2)/2
           = A + (n-1) (P + 2 (n-2))

Of course there is a front face and a back face.

So, all put together, it comes that the number of cubes composing the layer n
is N(n) = c(P+4(n-1)) + 2ab + 2(n-1) (P + 2 (n-2)). Replacing P by 2(a+b) and
simplifying, it comes:

    N(n) = 2(ab+bc+ac) + 4(n-1)(a+b+c+n-2)

The formula is obviously symmetric in a, b and c.

===============================================================================#

# Let check it the formula for N(n)

include("Euler.jl")
using Base.Test

n_cubes(n, a, b, c) = 2*(a*b+b*c+a*c) + 4*(n-1)*(a+b+c+n-2)

@test n_cubes(1, 1, 2, 3) ==  22
@test n_cubes(2, 1, 2, 3) ==  46
@test n_cubes(3, 1, 2, 3) ==  78
@test n_cubes(4, 1, 2, 3) == 118

function euler(threshold::Int)

    for half_nc in Euler.naturals(3)
        # nc is the number of cubes in a layer; half_nc is just the half of it

        # Assuming 1 ≤ a ≤ b ≤ c, we have to determine the number of solutions
        # of the equation nc == n_cubes(n, a , b, c).

        nbr_sol = 0

        for n in Euler.naturals(1)
            3 + 2*(n^2-1) ≤ half_nc || break

            for a in Euler.naturals(1)
                3a^2 + 2*(n-1)*(3a+n-2) ≤ half_nc || break

                for b in Euler.naturals(a)
                    b*(2a+b) + 2(n-1)*(a + 2b + n - 2) ≤ half_nc || break

                    num_c = half_nc - a*b -2*(n-1)*(a+b+n-2)
                    den_c = a + b + 2(n-1)

                    if rem(num_c, den_c) == 0
                        nbr_sol += 1
                    end
                end
            end
        end

        if nbr_sol == threshold
            return 2*half_nc
        end
    end
end

@test euler(10) == 154

@time println("Euler 126: $(euler(1000))")

ext: jl

max_stars_repo_name: dpieroux/euler

max_issues_repo_name: dpieroux/euler

max_forks_repo_name: dpieroux/euler


text:
# GPUArrays has a testsuite that isn't part of the main package.
# Include it directly.
import GPUArrays
gpuarrays = pathof(GPUArrays)
gpuarrays_root = dirname(dirname(gpuarrays))
include(joinpath(gpuarrays_root, "test", "testsuite.jl"))
testf(f, xs...; kwargs...) = TestSuite.compare(f, VEArray, xs...; kwargs...)

const eltypes = [Int32, Int64,
                 Complex{Int16}, Complex{Int32}, Complex{Int64},
                 Float32,
                 ComplexF32,
                 Float64, ComplexF64]

TestSuite.supported_eltypes(::Type{<:VEArray}) = eltypes

# helper function for sinking a value to prevent the callee from getting optimized away
@inline sink(i::Int32) =
    Base.llvmcall("""%slot = alloca i32
                     store volatile i32 %0, i32* %slot
                     %value = load volatile i32, i32* %slot
                     ret i32 %value""", Int32, Tuple{Int32}, i)
@inline sink(i::Int64) =
    Base.llvmcall("""%slot = alloca i64
                     store volatile i64 %0, i64* %slot
                     %value = load volatile i64, i64* %slot
                     ret i64 %value""", Int64, Tuple{Int64}, i)

## auxiliary stuff

# NOTE: based on test/pkg.jl::capture_stdout, but doesn't discard exceptions
# This does not work for redirecting output generated by the VE because that
# is happening in a forked+execed child process using a copy of the original
# stdout descriptors.
macro grab_output(ex)
    quote
        mktemp() do fname, fout
            ret = nothing
            open(fname, "w") do fout
                redirect_stdout(fout) do
                    ret = $(esc(ex))
                    synchronize()
                end
            end
            ret, read(fname, String)
        end
    end
end

# @test_throw, peeking into the load error for testing macro errors
macro test_throws_macro(ty, ex)
    return quote
        Test.@test_throws $(esc(ty)) try
            $(esc(ex))
        catch err
            if VERSION < v"1.7-"
                @test err isa LoadError
                @test err.file === $(string(__source__.file))
                @test err.line === $(__source__.line + 1)
                rethrow(err.error)
            else
                rethrow(err)
            end
        end
    end
end

# Run some code on-device
macro on_device(ex...)
    code = ex[end]
    kwargs = ex[1:end-1]

    @gensym kernel
    esc(quote
        let
            function $kernel()
                $code
                return
            end

            VectorEngine.@sync @veda $(kwargs...) $kernel()
        end
    end)
end