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

"""
    AbortEnvironmentUpdate()

Cancels in-progress environment configuration update or application version deployment.

# Optional Parameters
- `EnvironmentId`: This specifies the ID of the environment with the in-progress update that you want to cancel.
- `EnvironmentName`: This specifies the name of the environment with the in-progress update that you want to cancel.
"""
abort_environment_update(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("AbortEnvironmentUpdate"; aws_config=aws_config)
abort_environment_update(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("AbortEnvironmentUpdate", args; aws_config=aws_config)

"""
    ApplyEnvironmentManagedAction()

Applies a scheduled managed action immediately. A managed action can be applied only if its status is Scheduled. Get the status and action ID of a managed action with DescribeEnvironmentManagedActions.

# Required Parameters
- `ActionId`: The action ID of the scheduled managed action to execute.

# Optional Parameters
- `EnvironmentId`: The environment ID of the target environment.
- `EnvironmentName`: The name of the target environment.
"""
apply_environment_managed_action(ActionId; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("ApplyEnvironmentManagedAction", Dict{String, Any}("ActionId"=>ActionId); aws_config=aws_config)
apply_environment_managed_action(ActionId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("ApplyEnvironmentManagedAction", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ActionId"=>ActionId), args)); aws_config=aws_config)

"""
    AssociateEnvironmentOperationsRole()

Add or change the operations role used by an environment. After this call is made, Elastic Beanstalk uses the associated operations role for permissions to downstream services during subsequent calls acting on this environment. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide.

# Required Parameters
- `EnvironmentName`: The name of the environment to which to set the operations role.
- `OperationsRole`: The Amazon Resource Name (ARN) of an existing IAM role to be used as the environment's operations role.

"""
associate_environment_operations_role(EnvironmentName, OperationsRole; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("AssociateEnvironmentOperationsRole", Dict{String, Any}("EnvironmentName"=>EnvironmentName, "OperationsRole"=>OperationsRole); aws_config=aws_config)
associate_environment_operations_role(EnvironmentName, OperationsRole, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("AssociateEnvironmentOperationsRole", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("EnvironmentName"=>EnvironmentName, "OperationsRole"=>OperationsRole), args)); aws_config=aws_config)

"""
    CheckDNSAvailability()

Checks if the specified CNAME is available.

# Required Parameters
- `CNAMEPrefix`: The prefix used when this CNAME is reserved.

"""
check_dnsavailability(CNAMEPrefix; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("CheckDNSAvailability", Dict{String, Any}("CNAMEPrefix"=>CNAMEPrefix); aws_config=aws_config)
check_dnsavailability(CNAMEPrefix, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("CheckDNSAvailability", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("CNAMEPrefix"=>CNAMEPrefix), args)); aws_config=aws_config)

"""
    ComposeEnvironments()

Create or update a group of environments that each run a separate component of a single application. Takes a list of version labels that specify application source bundles for each of the environments to create or update. The name of each environment and other required information must be included in the source bundles in an environment manifest named env.yaml. See Compose Environments for details.

# Optional Parameters
- `ApplicationName`: The name of the application to which the specified source bundles belong.
- `GroupName`: The name of the group to which the target environments belong. Specify a group name only if the environment name defined in each target environment's manifest ends with a + (plus) character. See Environment Manifest (env.yaml) for details.
- `VersionLabels`: A list of version labels, specifying one or more application source bundles that belong to the target application. Each source bundle must include an environment manifest that specifies the name of the environment and the name of the solution stack to use, and optionally can specify environment links to create.
"""
compose_environments(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("ComposeEnvironments"; aws_config=aws_config)
compose_environments(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("ComposeEnvironments", args; aws_config=aws_config)

"""
    CreateApplication()

Creates an application that has one configuration template named default and no application versions.

# Required Parameters
- `ApplicationName`: The name of the application. Must be unique within your account.

# Optional Parameters
- `Description`: Your description of the application.
- `ResourceLifecycleConfig`: Specifies an application resource lifecycle configuration to prevent your application from accumulating too many versions.
- `Tags`: Specifies the tags applied to the application. Elastic Beanstalk applies these tags only to the application. Environments that you create in the application don't inherit the tags.
"""
create_application(ApplicationName; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("CreateApplication", Dict{String, Any}("ApplicationName"=>ApplicationName); aws_config=aws_config)
create_application(ApplicationName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("CreateApplication", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName), args)); aws_config=aws_config)

"""
    CreateApplicationVersion()

Creates an application version for the specified application. You can create an application version from a source bundle in Amazon S3, a commit in AWS CodeCommit, or the output of an AWS CodeBuild build as follows: Specify a commit in an AWS CodeCommit repository with SourceBuildInformation. Specify a build in an AWS CodeBuild with SourceBuildInformation and BuildConfiguration. Specify a source bundle in S3 with SourceBundle  Omit both SourceBuildInformation and SourceBundle to use the default sample application.  After you create an application version with a specified Amazon S3 bucket and key location, you can't change that Amazon S3 location. If you change the Amazon S3 location, you receive an exception when you attempt to launch an environment from the application version.

# Required Parameters
- `ApplicationName`:  The name of the application. If no application is found with this name, and AutoCreateApplication is false, returns an InvalidParameterValue error.
- `VersionLabel`: A label identifying this version. Constraint: Must be unique per application. If an application version already exists with this label for the specified application, AWS Elastic Beanstalk returns an InvalidParameterValue error.

# Optional Parameters
- `AutoCreateApplication`: Set to true to create an application with the specified name if it doesn't already exist.
- `BuildConfiguration`: Settings for an AWS CodeBuild build.
- `Description`: A description of this application version.
- `Process`: Pre-processes and validates the environment manifest (env.yaml) and configuration files (*.config files in the .ebextensions folder) in the source bundle. Validating configuration files can identify issues prior to deploying the application version to an environment. You must turn processing on for application versions that you create using AWS CodeBuild or AWS CodeCommit. For application versions built from a source bundle in Amazon S3, processing is optional.  The Process option validates Elastic Beanstalk configuration files. It doesn't validate your application's configuration files, like proxy server or Docker configuration.
- `SourceBuildInformation`: Specify a commit in an AWS CodeCommit Git repository to use as the source code for the application version.
- `SourceBundle`: The Amazon S3 bucket and key that identify the location of the source bundle for this version.  The Amazon S3 bucket must be in the same region as the environment.  Specify a source bundle in S3 or a commit in an AWS CodeCommit repository (with SourceBuildInformation), but not both. If neither SourceBundle nor SourceBuildInformation are provided, Elastic Beanstalk uses a sample application.
- `Tags`: Specifies the tags applied to the application version. Elastic Beanstalk applies these tags only to the application version. Environments that use the application version don't inherit the tags.
"""
create_application_version(ApplicationName, VersionLabel; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("CreateApplicationVersion", Dict{String, Any}("ApplicationName"=>ApplicationName, "VersionLabel"=>VersionLabel); aws_config=aws_config)
create_application_version(ApplicationName, VersionLabel, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("CreateApplicationVersion", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "VersionLabel"=>VersionLabel), args)); aws_config=aws_config)

"""
    CreateConfigurationTemplate()

Creates an AWS Elastic Beanstalk configuration template, associated with a specific Elastic Beanstalk application. You define application configuration settings in a configuration template. You can then use the configuration template to deploy different versions of the application with the same configuration settings. Templates aren't associated with any environment. The EnvironmentName response element is always null. Related Topics    DescribeConfigurationOptions     DescribeConfigurationSettings     ListAvailableSolutionStacks

# Required Parameters
- `ApplicationName`: The name of the Elastic Beanstalk application to associate with this configuration template.
- `TemplateName`: The name of the configuration template. Constraint: This name must be unique per application.

# Optional Parameters
- `Description`: An optional description for this configuration.
- `EnvironmentId`: The ID of an environment whose settings you want to use to create the configuration template. You must specify EnvironmentId if you don't specify PlatformArn, SolutionStackName, or SourceConfiguration.
- `OptionSettings`: Option values for the Elastic Beanstalk configuration, such as the instance type. If specified, these values override the values obtained from the solution stack or the source configuration template. For a complete list of Elastic Beanstalk configuration options, see Option Values in the AWS Elastic Beanstalk Developer Guide.
- `PlatformArn`: The Amazon Resource Name (ARN) of the custom platform. For more information, see  Custom Platforms in the AWS Elastic Beanstalk Developer Guide.  If you specify PlatformArn, then don't specify SolutionStackName.
- `SolutionStackName`: The name of an Elastic Beanstalk solution stack (platform version) that this configuration uses. For example, 64bit Amazon Linux 2013.09 running Tomcat 7 Java 7. A solution stack specifies the operating system, runtime, and application server for a configuration template. It also determines the set of configuration options as well as the possible and default values. For more information, see Supported Platforms in the AWS Elastic Beanstalk Developer Guide. You must specify SolutionStackName if you don't specify PlatformArn, EnvironmentId, or SourceConfiguration. Use the  ListAvailableSolutionStacks  API to obtain a list of available solution stacks.
- `SourceConfiguration`: An Elastic Beanstalk configuration template to base this one on. If specified, Elastic Beanstalk uses the configuration values from the specified configuration template to create a new configuration. Values specified in OptionSettings override any values obtained from the SourceConfiguration. You must specify SourceConfiguration if you don't specify PlatformArn, EnvironmentId, or SolutionStackName. Constraint: If both solution stack name and source configuration are specified, the solution stack of the source configuration template must match the specified solution stack name.
- `Tags`: Specifies the tags applied to the configuration template.
"""
create_configuration_template(ApplicationName, TemplateName; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("CreateConfigurationTemplate", Dict{String, Any}("ApplicationName"=>ApplicationName, "TemplateName"=>TemplateName); aws_config=aws_config)
create_configuration_template(ApplicationName, TemplateName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("CreateConfigurationTemplate", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "TemplateName"=>TemplateName), args)); aws_config=aws_config)

"""
    CreateEnvironment()

Launches an AWS Elastic Beanstalk environment for the specified application using the specified configuration.

# Required Parameters
- `ApplicationName`: The name of the application that is associated with this environment.

# Optional Parameters
- `CNAMEPrefix`: If specified, the environment attempts to use this value as the prefix for the CNAME in your Elastic Beanstalk environment URL. If not specified, the CNAME is generated automatically by appending a random alphanumeric string to the environment name.
- `Description`: Your description for this environment.
- `EnvironmentName`: A unique name for the environment. Constraint: Must be from 4 to 40 characters in length. The name can contain only letters, numbers, and hyphens. It can't start or end with a hyphen. This name must be unique within a region in your account. If the specified name already exists in the region, Elastic Beanstalk returns an InvalidParameterValue error.  If you don't specify the CNAMEPrefix parameter, the environment name becomes part of the CNAME, and therefore part of the visible URL for your application.
- `GroupName`: The name of the group to which the target environment belongs. Specify a group name only if the environment's name is specified in an environment manifest and not with the environment name parameter. See Environment Manifest (env.yaml) for details.
- `OperationsRole`: The Amazon Resource Name (ARN) of an existing IAM role to be used as the environment's operations role. If specified, Elastic Beanstalk uses the operations role for permissions to downstream services during this call and during subsequent calls acting on this environment. To specify an operations role, you must have the iam:PassRole permission for the role. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide.
- `OptionSettings`: If specified, AWS Elastic Beanstalk sets the specified configuration options to the requested value in the configuration set for the new environment. These override the values obtained from the solution stack or the configuration template.
- `OptionsToRemove`: A list of custom user-defined configuration options to remove from the configuration set for this new environment.
- `PlatformArn`: The Amazon Resource Name (ARN) of the custom platform to use with the environment. For more information, see Custom Platforms in the AWS Elastic Beanstalk Developer Guide.  If you specify PlatformArn, don't specify SolutionStackName.
- `SolutionStackName`: The name of an Elastic Beanstalk solution stack (platform version) to use with the environment. If specified, Elastic Beanstalk sets the configuration values to the default values associated with the specified solution stack. For a list of current solution stacks, see Elastic Beanstalk Supported Platforms in the AWS Elastic Beanstalk Platforms guide.  If you specify SolutionStackName, don't specify PlatformArn or TemplateName.
- `Tags`: Specifies the tags applied to resources in the environment.
- `TemplateName`: The name of the Elastic Beanstalk configuration template to use with the environment.  If you specify TemplateName, then don't specify SolutionStackName.
- `Tier`: Specifies the tier to use in creating this environment. The environment tier that you choose determines whether Elastic Beanstalk provisions resources to support a web application that handles HTTP(S) requests or a web application that handles background-processing tasks.
- `VersionLabel`: The name of the application version to deploy. Default: If not specified, Elastic Beanstalk attempts to deploy the sample application.
"""
create_environment(ApplicationName; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("CreateEnvironment", Dict{String, Any}("ApplicationName"=>ApplicationName); aws_config=aws_config)
create_environment(ApplicationName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("CreateEnvironment", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName), args)); aws_config=aws_config)

"""
    CreatePlatformVersion()

Create a new version of your custom platform.

# Required Parameters
- `PlatformDefinitionBundle`: The location of the platform definition archive in Amazon S3.
- `PlatformName`: The name of your custom platform.
- `PlatformVersion`: The number, such as 1.0.2, for the new platform version.

# Optional Parameters
- `EnvironmentName`: The name of the builder environment.
- `OptionSettings`: The configuration option settings to apply to the builder environment.
- `Tags`: Specifies the tags applied to the new platform version. Elastic Beanstalk applies these tags only to the platform version. Environments that you create using the platform version don't inherit the tags.
"""
create_platform_version(PlatformDefinitionBundle, PlatformName, PlatformVersion; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("CreatePlatformVersion", Dict{String, Any}("PlatformDefinitionBundle"=>PlatformDefinitionBundle, "PlatformName"=>PlatformName, "PlatformVersion"=>PlatformVersion); aws_config=aws_config)
create_platform_version(PlatformDefinitionBundle, PlatformName, PlatformVersion, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("CreatePlatformVersion", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("PlatformDefinitionBundle"=>PlatformDefinitionBundle, "PlatformName"=>PlatformName, "PlatformVersion"=>PlatformVersion), args)); aws_config=aws_config)

"""
    CreateStorageLocation()

Creates a bucket in Amazon S3 to store application versions, logs, and other files used by Elastic Beanstalk environments. The Elastic Beanstalk console and EB CLI call this API the first time you create an environment in a region. If the storage location already exists, CreateStorageLocation still returns the bucket name but does not create a new bucket.

"""
create_storage_location(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("CreateStorageLocation"; aws_config=aws_config)
create_storage_location(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("CreateStorageLocation", args; aws_config=aws_config)

"""
    DeleteApplication()

Deletes the specified application along with all associated versions and configurations. The application versions will not be deleted from your Amazon S3 bucket.  You cannot delete an application that has a running environment.

# Required Parameters
- `ApplicationName`: The name of the application to delete.

# Optional Parameters
- `TerminateEnvByForce`: When set to true, running environments will be terminated before deleting the application.
"""
delete_application(ApplicationName; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DeleteApplication", Dict{String, Any}("ApplicationName"=>ApplicationName); aws_config=aws_config)
delete_application(ApplicationName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DeleteApplication", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName), args)); aws_config=aws_config)

"""
    DeleteApplicationVersion()

Deletes the specified version from the specified application.  You cannot delete an application version that is associated with a running environment.

# Required Parameters
- `ApplicationName`: The name of the application to which the version belongs.
- `VersionLabel`: The label of the version to delete.

# Optional Parameters
- `DeleteSourceBundle`: Set to true to delete the source bundle from your storage bucket. Otherwise, the application version is deleted only from Elastic Beanstalk and the source bundle remains in Amazon S3.
"""
delete_application_version(ApplicationName, VersionLabel; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DeleteApplicationVersion", Dict{String, Any}("ApplicationName"=>ApplicationName, "VersionLabel"=>VersionLabel); aws_config=aws_config)
delete_application_version(ApplicationName, VersionLabel, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DeleteApplicationVersion", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "VersionLabel"=>VersionLabel), args)); aws_config=aws_config)

"""
    DeleteConfigurationTemplate()

Deletes the specified configuration template.  When you launch an environment using a configuration template, the environment gets a copy of the template. You can delete or modify the environment's copy of the template without affecting the running environment.

# Required Parameters
- `ApplicationName`: The name of the application to delete the configuration template from.
- `TemplateName`: The name of the configuration template to delete.

"""
delete_configuration_template(ApplicationName, TemplateName; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DeleteConfigurationTemplate", Dict{String, Any}("ApplicationName"=>ApplicationName, "TemplateName"=>TemplateName); aws_config=aws_config)
delete_configuration_template(ApplicationName, TemplateName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DeleteConfigurationTemplate", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "TemplateName"=>TemplateName), args)); aws_config=aws_config)

"""
    DeleteEnvironmentConfiguration()

Deletes the draft configuration associated with the running environment. Updating a running environment with any configuration changes creates a draft configuration set. You can get the draft configuration using DescribeConfigurationSettings while the update is in progress or if the update fails. The DeploymentStatus for the draft configuration indicates whether the deployment is in process or has failed. The draft configuration remains in existence until it is deleted with this action.

# Required Parameters
- `ApplicationName`: The name of the application the environment is associated with.
- `EnvironmentName`: The name of the environment to delete the draft configuration from.

"""
delete_environment_configuration(ApplicationName, EnvironmentName; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DeleteEnvironmentConfiguration", Dict{String, Any}("ApplicationName"=>ApplicationName, "EnvironmentName"=>EnvironmentName); aws_config=aws_config)
delete_environment_configuration(ApplicationName, EnvironmentName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DeleteEnvironmentConfiguration", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "EnvironmentName"=>EnvironmentName), args)); aws_config=aws_config)

"""
    DeletePlatformVersion()

Deletes the specified version of a custom platform.

# Optional Parameters
- `PlatformArn`: The ARN of the version of the custom platform.
"""
delete_platform_version(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DeletePlatformVersion"; aws_config=aws_config)
delete_platform_version(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DeletePlatformVersion", args; aws_config=aws_config)

"""
    DescribeAccountAttributes()

Returns attributes related to AWS Elastic Beanstalk that are associated with the calling AWS account. The result currently has one set of attributes—resource quotas.

"""
describe_account_attributes(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeAccountAttributes"; aws_config=aws_config)
describe_account_attributes(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeAccountAttributes", args; aws_config=aws_config)

"""
    DescribeApplicationVersions()

Retrieve a list of application versions.

# Optional Parameters
- `ApplicationName`: Specify an application name to show only application versions for that application.
- `MaxRecords`: For a paginated request. Specify a maximum number of application versions to include in each response. If no MaxRecords is specified, all available application versions are retrieved in a single response.
- `NextToken`: For a paginated request. Specify a token from a previous response page to retrieve the next response page. All other parameter values must be identical to the ones specified in the initial request. If no NextToken is specified, the first page is retrieved.
- `VersionLabels`: Specify a version label to show a specific application version.
"""
describe_application_versions(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeApplicationVersions"; aws_config=aws_config)
describe_application_versions(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeApplicationVersions", args; aws_config=aws_config)

"""
    DescribeApplications()

Returns the descriptions of existing applications.

# Optional Parameters
- `ApplicationNames`: If specified, AWS Elastic Beanstalk restricts the returned descriptions to only include those with the specified names.
"""
describe_applications(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeApplications"; aws_config=aws_config)
describe_applications(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeApplications", args; aws_config=aws_config)

"""
    DescribeConfigurationOptions()

Describes the configuration options that are used in a particular configuration template or environment, or that a specified solution stack defines. The description includes the values the options, their default values, and an indication of the required action on a running environment if an option value is changed.

# Optional Parameters
- `ApplicationName`: The name of the application associated with the configuration template or environment. Only needed if you want to describe the configuration options associated with either the configuration template or environment.
- `EnvironmentName`: The name of the environment whose configuration options you want to describe.
- `Options`: If specified, restricts the descriptions to only the specified options.
- `PlatformArn`: The ARN of the custom platform.
- `SolutionStackName`: The name of the solution stack whose configuration options you want to describe.
- `TemplateName`: The name of the configuration template whose configuration options you want to describe.
"""
describe_configuration_options(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeConfigurationOptions"; aws_config=aws_config)
describe_configuration_options(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeConfigurationOptions", args; aws_config=aws_config)

"""
    DescribeConfigurationSettings()

Returns a description of the settings for the specified configuration set, that is, either a configuration template or the configuration set associated with a running environment. When describing the settings for the configuration set associated with a running environment, it is possible to receive two sets of setting descriptions. One is the deployed configuration set, and the other is a draft configuration of an environment that is either in the process of deployment or that failed to deploy. Related Topics    DeleteEnvironmentConfiguration

# Required Parameters
- `ApplicationName`: The application for the environment or configuration template.

# Optional Parameters
- `EnvironmentName`: The name of the environment to describe.  Condition: You must specify either this or a TemplateName, but not both. If you specify both, AWS Elastic Beanstalk returns an InvalidParameterCombination error. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
- `TemplateName`: The name of the configuration template to describe.  Conditional: You must specify either this parameter or an EnvironmentName, but not both. If you specify both, AWS Elastic Beanstalk returns an InvalidParameterCombination error. If you do not specify either, AWS Elastic Beanstalk returns a MissingRequiredParameter error.
"""
describe_configuration_settings(ApplicationName; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeConfigurationSettings", Dict{String, Any}("ApplicationName"=>ApplicationName); aws_config=aws_config)
describe_configuration_settings(ApplicationName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeConfigurationSettings", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName), args)); aws_config=aws_config)

"""
    DescribeEnvironmentHealth()

Returns information about the overall health of the specified environment. The DescribeEnvironmentHealth operation is only available with AWS Elastic Beanstalk Enhanced Health.

# Optional Parameters
- `AttributeNames`: Specify the response elements to return. To retrieve all attributes, set to All. If no attribute names are specified, returns the name of the environment.
- `EnvironmentId`: Specify the environment by ID. You must specify either this or an EnvironmentName, or both.
- `EnvironmentName`: Specify the environment by name. You must specify either this or an EnvironmentName, or both.
"""
describe_environment_health(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentHealth"; aws_config=aws_config)
describe_environment_health(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentHealth", args; aws_config=aws_config)

"""
    DescribeEnvironmentManagedActionHistory()

Lists an environment's completed and failed managed actions.

# Optional Parameters
- `EnvironmentId`: The environment ID of the target environment.
- `EnvironmentName`: The name of the target environment.
- `MaxItems`: The maximum number of items to return for a single request.
- `NextToken`: The pagination token returned by a previous request.
"""
describe_environment_managed_action_history(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentManagedActionHistory"; aws_config=aws_config)
describe_environment_managed_action_history(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentManagedActionHistory", args; aws_config=aws_config)

"""
    DescribeEnvironmentManagedActions()

Lists an environment's upcoming and in-progress managed actions.

# Optional Parameters
- `EnvironmentId`: The environment ID of the target environment.
- `EnvironmentName`: The name of the target environment.
- `Status`: To show only actions with a particular status, specify a status.
"""
describe_environment_managed_actions(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentManagedActions"; aws_config=aws_config)
describe_environment_managed_actions(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentManagedActions", args; aws_config=aws_config)

"""
    DescribeEnvironmentResources()

Returns AWS resources for this environment.

# Optional Parameters
- `EnvironmentId`: The ID of the environment to retrieve AWS resource usage data.  Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
- `EnvironmentName`: The name of the environment to retrieve AWS resource usage data.  Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
"""
describe_environment_resources(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentResources"; aws_config=aws_config)
describe_environment_resources(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentResources", args; aws_config=aws_config)

"""
    DescribeEnvironments()

Returns descriptions for existing environments.

# Optional Parameters
- `ApplicationName`: If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that are associated with this application.
- `EnvironmentIds`: If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that have the specified IDs.
- `EnvironmentNames`: If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that have the specified names.
- `IncludeDeleted`: Indicates whether to include deleted environments:  true: Environments that have been deleted after IncludedDeletedBackTo are displayed.  false: Do not include deleted environments.
- `IncludedDeletedBackTo`:  If specified when IncludeDeleted is set to true, then environments deleted after this date are displayed.
- `MaxRecords`: For a paginated request. Specify a maximum number of environments to include in each response. If no MaxRecords is specified, all available environments are retrieved in a single response.
- `NextToken`: For a paginated request. Specify a token from a previous response page to retrieve the next response page. All other parameter values must be identical to the ones specified in the initial request. If no NextToken is specified, the first page is retrieved.
- `VersionLabel`: If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that are associated with this application version.
"""
describe_environments(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironments"; aws_config=aws_config)
describe_environments(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironments", args; aws_config=aws_config)

"""
    DescribeEvents()

Returns list of event descriptions matching criteria up to the last 6 weeks.  This action returns the most recent 1,000 events from the specified NextToken.

# Optional Parameters
- `ApplicationName`: If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those associated with this application.
- `EndTime`:  If specified, AWS Elastic Beanstalk restricts the returned descriptions to those that occur up to, but not including, the EndTime.
- `EnvironmentId`: If specified, AWS Elastic Beanstalk restricts the returned descriptions to those associated with this environment.
- `EnvironmentName`: If specified, AWS Elastic Beanstalk restricts the returned descriptions to those associated with this environment.
- `MaxRecords`: Specifies the maximum number of events that can be returned, beginning with the most recent event.
- `NextToken`: Pagination token. If specified, the events return the next batch of results.
- `PlatformArn`: The ARN of a custom platform version. If specified, AWS Elastic Beanstalk restricts the returned descriptions to those associated with this custom platform version.
- `RequestId`: If specified, AWS Elastic Beanstalk restricts the described events to include only those associated with this request ID.
- `Severity`: If specified, limits the events returned from this call to include only those with the specified severity or higher.
- `StartTime`: If specified, AWS Elastic Beanstalk restricts the returned descriptions to those that occur on or after this time.
- `TemplateName`: If specified, AWS Elastic Beanstalk restricts the returned descriptions to those that are associated with this environment configuration.
- `VersionLabel`: If specified, AWS Elastic Beanstalk restricts the returned descriptions to those associated with this application version.
"""
describe_events(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEvents"; aws_config=aws_config)
describe_events(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEvents", args; aws_config=aws_config)

"""
    DescribeInstancesHealth()

Retrieves detailed information about the health of instances in your AWS Elastic Beanstalk. This operation requires enhanced health reporting.

# Optional Parameters
- `AttributeNames`: Specifies the response elements you wish to receive. To retrieve all attributes, set to All. If no attribute names are specified, returns a list of instances.
- `EnvironmentId`: Specify the AWS Elastic Beanstalk environment by ID.
- `EnvironmentName`: Specify the AWS Elastic Beanstalk environment by name.
- `NextToken`: Specify the pagination token returned by a previous call.
"""
describe_instances_health(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeInstancesHealth"; aws_config=aws_config)
describe_instances_health(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribeInstancesHealth", args; aws_config=aws_config)

"""
    DescribePlatformVersion()

Describes a platform version. Provides full details. Compare to ListPlatformVersions, which provides summary information about a list of platform versions. For definitions of platform version and other platform-related terms, see AWS Elastic Beanstalk Platforms Glossary.

# Optional Parameters
- `PlatformArn`: The ARN of the platform version.
"""
describe_platform_version(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribePlatformVersion"; aws_config=aws_config)
describe_platform_version(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DescribePlatformVersion", args; aws_config=aws_config)

"""
    DisassociateEnvironmentOperationsRole()

Disassociate the operations role from an environment. After this call is made, Elastic Beanstalk uses the caller's permissions for permissions to downstream services during subsequent calls acting on this environment. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide.

# Required Parameters
- `EnvironmentName`: The name of the environment from which to disassociate the operations role.

"""
disassociate_environment_operations_role(EnvironmentName; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DisassociateEnvironmentOperationsRole", Dict{String, Any}("EnvironmentName"=>EnvironmentName); aws_config=aws_config)
disassociate_environment_operations_role(EnvironmentName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("DisassociateEnvironmentOperationsRole", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("EnvironmentName"=>EnvironmentName), args)); aws_config=aws_config)

"""
    ListAvailableSolutionStacks()

Returns a list of the available solution stack names, with the public version first and then in reverse chronological order.

"""
list_available_solution_stacks(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("ListAvailableSolutionStacks"; aws_config=aws_config)
list_available_solution_stacks(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("ListAvailableSolutionStacks", args; aws_config=aws_config)

"""
    ListPlatformBranches()

Lists the platform branches available for your account in an AWS Region. Provides summary information about each platform branch. For definitions of platform branch and other platform-related terms, see AWS Elastic Beanstalk Platforms Glossary.

# Optional Parameters
- `Filters`: Criteria for restricting the resulting list of platform branches. The filter is evaluated as a logical conjunction (AND) of the separate SearchFilter terms. The following list shows valid attribute values for each of the SearchFilter terms. Most operators take a single value. The in and not_in operators can take multiple values.    Attribute = BranchName:    Operator: = | != | begins_with | ends_with | contains | in | not_in       Attribute = LifecycleState:    Operator: = | != | in | not_in     Values: beta | supported | deprecated | retired       Attribute = PlatformName:    Operator: = | != | begins_with | ends_with | contains | in | not_in       Attribute = TierType:    Operator: = | !=     Values: WebServer/Standard | Worker/SQS/HTTP      Array size: limited to 10 SearchFilter objects. Within each SearchFilter item, the Values array is limited to 10 items.
- `MaxRecords`: The maximum number of platform branch values returned in one call.
- `NextToken`: For a paginated request. Specify a token from a previous response page to retrieve the next response page. All other parameter values must be identical to the ones specified in the initial request. If no NextToken is specified, the first page is retrieved.
"""
list_platform_branches(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("ListPlatformBranches"; aws_config=aws_config)
list_platform_branches(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("ListPlatformBranches", args; aws_config=aws_config)

"""
    ListPlatformVersions()

Lists the platform versions available for your account in an AWS Region. Provides summary information about each platform version. Compare to DescribePlatformVersion, which provides full details about a single platform version. For definitions of platform version and other platform-related terms, see AWS Elastic Beanstalk Platforms Glossary.

# Optional Parameters
- `Filters`: Criteria for restricting the resulting list of platform versions. The filter is interpreted as a logical conjunction (AND) of the separate PlatformFilter terms.
- `MaxRecords`: The maximum number of platform version values returned in one call.
- `NextToken`: For a paginated request. Specify a token from a previous response page to retrieve the next response page. All other parameter values must be identical to the ones specified in the initial request. If no NextToken is specified, the first page is retrieved.
"""
list_platform_versions(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("ListPlatformVersions"; aws_config=aws_config)
list_platform_versions(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("ListPlatformVersions", args; aws_config=aws_config)

"""
    ListTagsForResource()

Return the tags applied to an AWS Elastic Beanstalk resource. The response contains a list of tag key-value pairs. Elastic Beanstalk supports tagging of all of its resources. For details about resource tagging, see Tagging Application Resources.

# Required Parameters
- `ResourceArn`: The Amazon Resource Name (ARN) of the resouce for which a tag list is requested. Must be the ARN of an Elastic Beanstalk resource.

"""
list_tags_for_resource(ResourceArn; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("ListTagsForResource", Dict{String, Any}("ResourceArn"=>ResourceArn); aws_config=aws_config)
list_tags_for_resource(ResourceArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("ListTagsForResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResourceArn"=>ResourceArn), args)); aws_config=aws_config)

"""
    RebuildEnvironment()

Deletes and recreates all of the AWS resources (for example: the Auto Scaling group, load balancer, etc.) for a specified environment and forces a restart.

# Optional Parameters
- `EnvironmentId`: The ID of the environment to rebuild.  Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
- `EnvironmentName`: The name of the environment to rebuild.  Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
"""
rebuild_environment(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("RebuildEnvironment"; aws_config=aws_config)
rebuild_environment(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("RebuildEnvironment", args; aws_config=aws_config)

"""
    RequestEnvironmentInfo()

Initiates a request to compile the specified type of information of the deployed environment.  Setting the InfoType to tail compiles the last lines from the application server log files of every Amazon EC2 instance in your environment.   Setting the InfoType to bundle compresses the application server log files for every Amazon EC2 instance into a .zip file. Legacy and .NET containers do not support bundle logs.   Use RetrieveEnvironmentInfo to obtain the set of logs.  Related Topics    RetrieveEnvironmentInfo

# Required Parameters
- `InfoType`: The type of information to request.

# Optional Parameters
- `EnvironmentId`: The ID of the environment of the requested data. If no such environment is found, RequestEnvironmentInfo returns an InvalidParameterValue error.  Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
- `EnvironmentName`: The name of the environment of the requested data. If no such environment is found, RequestEnvironmentInfo returns an InvalidParameterValue error.  Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
"""
request_environment_info(InfoType; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("RequestEnvironmentInfo", Dict{String, Any}("InfoType"=>InfoType); aws_config=aws_config)
request_environment_info(InfoType, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("RequestEnvironmentInfo", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("InfoType"=>InfoType), args)); aws_config=aws_config)

"""
    RestartAppServer()

Causes the environment to restart the application container server running on each Amazon EC2 instance.

# Optional Parameters
- `EnvironmentId`: The ID of the environment to restart the server for.  Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
- `EnvironmentName`: The name of the environment to restart the server for.  Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
"""
restart_app_server(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("RestartAppServer"; aws_config=aws_config)
restart_app_server(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("RestartAppServer", args; aws_config=aws_config)

"""
    RetrieveEnvironmentInfo()

Retrieves the compiled information from a RequestEnvironmentInfo request. Related Topics    RequestEnvironmentInfo

# Required Parameters
- `InfoType`: The type of information to retrieve.

# Optional Parameters
- `EnvironmentId`: The ID of the data's environment. If no such environment is found, returns an InvalidParameterValue error. Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
- `EnvironmentName`: The name of the data's environment.  If no such environment is found, returns an InvalidParameterValue error.   Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
"""
retrieve_environment_info(InfoType; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("RetrieveEnvironmentInfo", Dict{String, Any}("InfoType"=>InfoType); aws_config=aws_config)
retrieve_environment_info(InfoType, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("RetrieveEnvironmentInfo", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("InfoType"=>InfoType), args)); aws_config=aws_config)

"""
    SwapEnvironmentCNAMEs()

Swaps the CNAMEs of two environments.

# Optional Parameters
- `DestinationEnvironmentId`: The ID of the destination environment.  Condition: You must specify at least the DestinationEnvironmentID or the DestinationEnvironmentName. You may also specify both. You must specify the SourceEnvironmentId with the DestinationEnvironmentId.
- `DestinationEnvironmentName`: The name of the destination environment.  Condition: You must specify at least the DestinationEnvironmentID or the DestinationEnvironmentName. You may also specify both. You must specify the SourceEnvironmentName with the DestinationEnvironmentName.
- `SourceEnvironmentId`: The ID of the source environment.  Condition: You must specify at least the SourceEnvironmentID or the SourceEnvironmentName. You may also specify both. If you specify the SourceEnvironmentId, you must specify the DestinationEnvironmentId.
- `SourceEnvironmentName`: The name of the source environment.  Condition: You must specify at least the SourceEnvironmentID or the SourceEnvironmentName. You may also specify both. If you specify the SourceEnvironmentName, you must specify the DestinationEnvironmentName.
"""
swap_environment_cnames(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("SwapEnvironmentCNAMEs"; aws_config=aws_config)
swap_environment_cnames(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("SwapEnvironmentCNAMEs", args; aws_config=aws_config)

"""
    TerminateEnvironment()

Terminates the specified environment.

# Optional Parameters
- `EnvironmentId`: The ID of the environment to terminate.  Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
- `EnvironmentName`: The name of the environment to terminate.  Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
- `ForceTerminate`: Terminates the target environment even if another environment in the same group is dependent on it.
- `TerminateResources`: Indicates whether the associated AWS resources should shut down when the environment is terminated:    true: The specified environment as well as the associated AWS resources, such as Auto Scaling group and LoadBalancer, are terminated.    false: AWS Elastic Beanstalk resource management is removed from the environment, but the AWS resources continue to operate.    For more information, see the  AWS Elastic Beanstalk User Guide.    Default: true   Valid Values: true | false
"""
terminate_environment(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("TerminateEnvironment"; aws_config=aws_config)
terminate_environment(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("TerminateEnvironment", args; aws_config=aws_config)

"""
    UpdateApplication()

Updates the specified application to have the specified properties.  If a property (for example, description) is not provided, the value remains unchanged. To clear these properties, specify an empty string.

# Required Parameters
- `ApplicationName`: The name of the application to update. If no such application is found, UpdateApplication returns an InvalidParameterValue error.

# Optional Parameters
- `Description`: A new description for the application. Default: If not specified, AWS Elastic Beanstalk does not update the description.
"""
update_application(ApplicationName; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("UpdateApplication", Dict{String, Any}("ApplicationName"=>ApplicationName); aws_config=aws_config)
update_application(ApplicationName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("UpdateApplication", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName), args)); aws_config=aws_config)

"""
    UpdateApplicationResourceLifecycle()

Modifies lifecycle settings for an application.

# Required Parameters
- `ApplicationName`: The name of the application.
- `ResourceLifecycleConfig`: The lifecycle configuration.

"""
update_application_resource_lifecycle(ApplicationName, ResourceLifecycleConfig; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("UpdateApplicationResourceLifecycle", Dict{String, Any}("ApplicationName"=>ApplicationName, "ResourceLifecycleConfig"=>ResourceLifecycleConfig); aws_config=aws_config)
update_application_resource_lifecycle(ApplicationName, ResourceLifecycleConfig, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("UpdateApplicationResourceLifecycle", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "ResourceLifecycleConfig"=>ResourceLifecycleConfig), args)); aws_config=aws_config)

"""
    UpdateApplicationVersion()

Updates the specified application version to have the specified properties.  If a property (for example, description) is not provided, the value remains unchanged. To clear properties, specify an empty string.

# Required Parameters
- `ApplicationName`: The name of the application associated with this version.  If no application is found with this name, UpdateApplication returns an InvalidParameterValue error.
- `VersionLabel`: The name of the version to update. If no application version is found with this label, UpdateApplication returns an InvalidParameterValue error.

# Optional Parameters
- `Description`: A new description for this version.
"""
update_application_version(ApplicationName, VersionLabel; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("UpdateApplicationVersion", Dict{String, Any}("ApplicationName"=>ApplicationName, "VersionLabel"=>VersionLabel); aws_config=aws_config)
update_application_version(ApplicationName, VersionLabel, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("UpdateApplicationVersion", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "VersionLabel"=>VersionLabel), args)); aws_config=aws_config)

"""
    UpdateConfigurationTemplate()

Updates the specified configuration template to have the specified properties or configuration option values.  If a property (for example, ApplicationName) is not provided, its value remains unchanged. To clear such properties, specify an empty string.  Related Topics    DescribeConfigurationOptions

# Required Parameters
- `ApplicationName`: The name of the application associated with the configuration template to update.  If no application is found with this name, UpdateConfigurationTemplate returns an InvalidParameterValue error.
- `TemplateName`: The name of the configuration template to update.  If no configuration template is found with this name, UpdateConfigurationTemplate returns an InvalidParameterValue error.

# Optional Parameters
- `Description`: A new description for the configuration.
- `OptionSettings`: A list of configuration option settings to update with the new specified option value.
- `OptionsToRemove`: A list of configuration options to remove from the configuration set.  Constraint: You can remove only UserDefined configuration options.
"""
update_configuration_template(ApplicationName, TemplateName; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("UpdateConfigurationTemplate", Dict{String, Any}("ApplicationName"=>ApplicationName, "TemplateName"=>TemplateName); aws_config=aws_config)
update_configuration_template(ApplicationName, TemplateName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("UpdateConfigurationTemplate", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "TemplateName"=>TemplateName), args)); aws_config=aws_config)

"""
    UpdateEnvironment()

Updates the environment description, deploys a new application version, updates the configuration settings to an entirely new configuration template, or updates select configuration option values in the running environment.  Attempting to update both the release and configuration is not allowed and AWS Elastic Beanstalk returns an InvalidParameterCombination error.   When updating the configuration settings to a new template or individual settings, a draft configuration is created and DescribeConfigurationSettings for this environment returns two setting descriptions with different DeploymentStatus values.

# Optional Parameters
- `ApplicationName`: The name of the application with which the environment is associated.
- `Description`: If this parameter is specified, AWS Elastic Beanstalk updates the description of this environment.
- `EnvironmentId`: The ID of the environment to update. If no environment with this ID exists, AWS Elastic Beanstalk returns an InvalidParameterValue error. Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
- `EnvironmentName`: The name of the environment to update. If no environment with this name exists, AWS Elastic Beanstalk returns an InvalidParameterValue error.  Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.
- `GroupName`: The name of the group to which the target environment belongs. Specify a group name only if the environment's name is specified in an environment manifest and not with the environment name or environment ID parameters. See Environment Manifest (env.yaml) for details.
- `OptionSettings`: If specified, AWS Elastic Beanstalk updates the configuration set associated with the running environment and sets the specified configuration options to the requested value.
- `OptionsToRemove`: A list of custom user-defined configuration options to remove from the configuration set for this environment.
- `PlatformArn`: The ARN of the platform, if used.
- `SolutionStackName`: This specifies the platform version that the environment will run after the environment is updated.
- `TemplateName`: If this parameter is specified, AWS Elastic Beanstalk deploys this configuration template to the environment. If no such configuration template is found, AWS Elastic Beanstalk returns an InvalidParameterValue error.
- `Tier`: This specifies the tier to use to update the environment. Condition: At this time, if you change the tier version, name, or type, AWS Elastic Beanstalk returns InvalidParameterValue error.
- `VersionLabel`: If this parameter is specified, AWS Elastic Beanstalk deploys the named application version to the environment. If no such application version is found, returns an InvalidParameterValue error.
"""
update_environment(; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("UpdateEnvironment"; aws_config=aws_config)
update_environment(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("UpdateEnvironment", args; aws_config=aws_config)

"""
    UpdateTagsForResource()

Update the list of tags applied to an AWS Elastic Beanstalk resource. Two lists can be passed: TagsToAdd for tags to add or update, and TagsToRemove. Elastic Beanstalk supports tagging of all of its resources. For details about resource tagging, see Tagging Application Resources. If you create a custom IAM user policy to control permission to this operation, specify one of the following two virtual actions (or both) instead of the API operation name:  elasticbeanstalk:AddTags  Controls permission to call UpdateTagsForResource and pass a list of tags to add in the TagsToAdd parameter.  elasticbeanstalk:RemoveTags  Controls permission to call UpdateTagsForResource and pass a list of tag keys to remove in the TagsToRemove parameter.   For details about creating a custom user policy, see Creating a Custom User Policy.

# Required Parameters
- `ResourceArn`: The Amazon Resource Name (ARN) of the resouce to be updated. Must be the ARN of an Elastic Beanstalk resource.

# Optional Parameters
- `TagsToAdd`: A list of tags to add or update. If a key of an existing tag is added, the tag's value is updated. Specify at least one of these parameters: TagsToAdd, TagsToRemove.
- `TagsToRemove`: A list of tag keys to remove. If a tag key doesn't exist, it is silently ignored. Specify at least one of these parameters: TagsToAdd, TagsToRemove.
"""
update_tags_for_resource(ResourceArn; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("UpdateTagsForResource", Dict{String, Any}("ResourceArn"=>ResourceArn); aws_config=aws_config)
update_tags_for_resource(ResourceArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("UpdateTagsForResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResourceArn"=>ResourceArn), args)); aws_config=aws_config)

"""
    ValidateConfigurationSettings()

Takes a set of configuration settings and either a configuration template or environment, and determines whether those values are valid. This action returns a list of messages indicating any errors or warnings associated with the selection of option values.

# Required Parameters
- `ApplicationName`: The name of the application that the configuration template or environment belongs to.
- `OptionSettings`: A list of the options and desired values to evaluate.

# Optional Parameters
- `EnvironmentName`: The name of the environment to validate the settings against. Condition: You cannot specify both this and a configuration template name.
- `TemplateName`: The name of the configuration template to validate the settings against. Condition: You cannot specify both this and an environment name.
"""
validate_configuration_settings(ApplicationName, OptionSettings; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("ValidateConfigurationSettings", Dict{String, Any}("ApplicationName"=>ApplicationName, "OptionSettings"=>OptionSettings); aws_config=aws_config)
validate_configuration_settings(ApplicationName, OptionSettings, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = elastic_beanstalk("ValidateConfigurationSettings", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "OptionSettings"=>OptionSettings), args)); aws_config=aws_config)


text:
using YaoBlocks
using ZXCalculus
import YaoBlocks: mat

function toqbir(qc::QCircuit)
    n = ZXCalculus.nqubits(qc)
    c = chain(n)
    for g in gates(qc)
        gg = parse_block(g)
        gg !== nothing && push!(c, gg)
    end
    return c
end

function toqbir(zxd::ZXDiagram)
    return toqbir(QCircuit(zxd))
end

function parse_block(g::QGate)
    if g.name == :X
        put(g.loc => X)
    elseif g.name == :H
        put(g.loc => H)
    elseif g.name == :Z
        put(g.loc => Z)
    elseif g.name == :S
        put(g.loc => ConstGate.S)
    elseif g.name == :Sdag
        put(g.loc => ConstGate.Sdag)
    elseif g.name == :T
        put(g.loc => T)
    elseif g.name == :Tdag
        put(g.loc => ConstGate.Tdag)
    elseif g.name == :Rx
        put(g.loc => Rx(g.param))
    elseif g.name == :Rz
        put(g.loc => Rz(g.param))
    elseif g.name == :shift
        put(g.loc => shift(g.param))
    elseif g.name == :CNOT
        control(g.ctrl, g.loc => X)
    elseif g.name == :CZ
        control(g.ctrl, g.loc => Z)
    end
end

mat(qc::QCircuit) = mat(toqbir(qc))
mat(zxd::ZXDiagram) = mat(QCircuit(zxd))

ext: jl


text:
module Photosynthesis

using DocStringExtensions: TYPEDFIELDS
using PkgUtility: GAS_R, RT_25, T_25, lower_quadratic
using UnPack: @unpack
using WaterPhysics: saturation_vapor_pressure

# export public types
export AirLayer, C3ParaSet, C4ParaSet, GCO₂Mode, Leaf, PCO₂Mode

# export parasets
export C3Bernacchi, C3CLM, C4CLM

# export functions
export leaf_fluorescence!, leaf_photosynthesis!, leaf_temperature_dependence!

include("types/environment.jl" )
include("types/fluorescence.jl")
include("types/leaf.jl"        )
include("types/mode.jl"        )
include("types/temperature.jl" )
include("types/photomodel.jl"  )
include("types/parasets.jl"    )

include("temperature/correction.jl")
include("temperature/dependency.jl")

include("photosynthesis/etr.jl"           )
include("photosynthesis/lightlimited.jl"  )
include("photosynthesis/productlimited.jl")
include("photosynthesis/rubiscolimited.jl")
include("photosynthesis/model.jl"         )

include("fluorescence/fluorescence.jl")

end # module


text:
# simple example of method of simulated moments estimated by
# NUTS MCMC

# load packages
using DelimitedFiles, TransformVariables, LogDensityProblems, DynamicHMC, MCMCDiagnostics,
    Parameters, Statistics, Distributions, ForwardDiff, LinearAlgebra

include("SVlib.jl")

# Define a structure for the problem
# Should hold the data and  the parameters of prior distributions.
struct MSM_Problem{Tm <: Vector{Float64}, Tn <: Int, Tshocks_u <: Array{Float64,2}, Tshocks_e <: Array{Float64,2}}
    "statistic"
    m::Tm
    "sample size"
    n::Tn
    "shocks"
    shocks_u::Tshocks_u
    shocks_e::Tshocks_e

end

# Make the type callable with the parameters *as a single argument*.
function (problem::MSM_Problem)(θ)
    @unpack m, n, shocks_u, shocks_e = problem   # extract the data
    @unpack σe, ρ, σu = θ         # extract parameters (only one here)
    S = size(shocks_u,2)
    k = size(m,1)
    ms = zeros(eltype(SVmodel(σe, ρ, σu, n, shocks_u[:,1], shocks_e[:,1])), S, k)
    Threads.@threads for s = 1:S
        ms[s,:] = SVmodel(σe, ρ, σu, n, shocks_u[:,s], shocks_e[:,s])
    end
    mbar = mean(ms,dims=1)[:]
    Σ = cov(ms)
    x = (m .- mbar)
    logL = try
        logL = -0.5*log(det(Σ)) - 0.5*x'*inv(Σ)*x
    catch
        logL = -Inf
    end
end
function main()
# generate data
σe = exp(-0.736/2.0)
ρ = 0.9
σu = 0.363
n = 1000 # sample size
burnin = 100
S = 100 # number of simulations
shocks_u = randn(n+burnin,1)
shocks_e = randn(n+burnin,1)
# load the example data
y = readdlm("../svdata.txt")
m =  sqrt(n)*aux_stat(y) # statistic
m = m[:]
# or use a new draw
#m = SVmodel(σe, ρ, σu, n, shocks_u, shocks_e)
shocks_u = randn(n+burnin,S) # fixed shocks for simulations
shocks_e = randn(n+burnin,S) # fixed shocks for simulations
# original problem, without transformation of parameters
p = MSM_Problem(m, n, shocks_u, shocks_e)
# define the transformation of parameters (in this case, priors are uniform on segments of real line)
# σu ~ U(0,3), ρ ~U(0,1), σe ~ U(0,3)
problem_transformation(p::MSM_Problem) =
        as((σe=as(Real, 0.0, 3.0), ρ=as(Real, 0.0, 1.0) ,σu=as(Real,0.0,3.0)))
# Wrap the problem with the transformation
t = problem_transformation(p)
P = TransformedLogDensity(t, p)
# use AD for the gradient
∇P = ADgradient(:ForwardDiff, P)
# Sample from the posterior. `chain` holds the chain (positions and
# diagnostic information), while the second returned value is the tuned sampler
# which would allow continuation of sampling.
n = dimension(problem_transformation(p))
chain, NUTS_tuned = NUTS_init_tune_mcmc(∇P, 1000)
# We use the transformation to obtain the posterior from the chain.
posterior = transform.(Ref(t), get_position.(chain));
return posterior, chain
end

max_stars_repo_name: nilshg/Econometrics

max_issues_repo_name: nilshg/Econometrics

max_forks_repo_name: nilshg/Econometrics


text:
__precompile__()

module Z3

using PyCall
import Base.push!, Base.pop!

# Load z3 Python library
const z3 = PyNULL()

function __init__()
    copy!(z3, pyimport_conda("z3", "z3"))
end

export
# Low-level access
z3,
# Model
Z3Model,
# Variables
variable,
# Constraints
constraint, objective, implies, atmost, atleast,
# Solver
check, get_unsat_core, solve

# Model
include("z3_model.jl")
# Variables
include("z3_var.jl")
# Constraints
include("z3_constr.jl")
# Solver
include("z3_solver.jl")

end


text:
using Makie, CatmullClark, Test

# Will display a graphic briefly, needed for code coverage.

const donutpoints = [
    [-2.0, -0.5, -2.0], [-2.0, -0.5, 2.0], [2.0, -0.5, -2.0], [2.0, -0.5, 2.0],
    [-1.0, -0.5, -1.0], [-1.0, -0.5, 1.0], [1.0, -0.5, -1.0], [1.0, -0.5, 1.0],
    [-2.0, 0.5, -2.0], [-2.0, 0.5, 2.0], [2.0,  0.5, -2.0], [2.0, 0.5, 2.0],
    [-1.0, 0.5, -1.0], [-1.0, 0.5, 1.0], [1.0, 0.5, -1.0], [1.0, 0.5, 1.0]]

donutfaceindices = [
    [4, 5, 1, 0], [3, 1, 5, 7], [0, 2, 6, 4], [2, 3, 7, 6],
    [8,  9, 13, 12], [15, 13, 9, 11], [12, 14, 10, 8], [14, 15, 11, 10],
    [0, 1, 9, 8], [1, 3, 11, 9], [2, 0, 8, 10], [3, 2, 10, 11],
    [12, 13, 5, 4], [13, 15, 7, 5], [14, 12, 4, 6], [15, 14, 6, 7]]

const donutfaces = [map(x -> Point3f0(donutpoints[x]), p .+ 1) for p in donutfaceindices]

scene2 = drawfaces(donutfaces, :black)
setscene(scene2)
getscene()
sleep(1)
catmullclark(donutfaces, 1, CatmullClark.displaycallback)

face = donutfaces[2]

edge = CatmullClark.Edge(face[1], face[2])

@test CatmullClark.newedgepoint(CatmullClark.Edge(Point3f0(100, 100, 100),
    Point3f0(1, 1, 1)), donutfaces) == [50.5, 50.5, 50.5]

@test !CatmullClark.nexttohole(edge, donutfaces)

@test_throws String CatmullClark.adjacentpoints(Point3f0(100, 100, 100), donutfaces)

f = CatmullClark.edgesforface(face)[1]

@test f.p1[3] == 2.0

@test CatmullClark.edgemidpoint(f)[1] == 0.0


text:
module DaggerWebDash

using Dagger

include("core.jl")
include("profile.jl")
include("d3.jl")

end


text:
using PyPlot
# this script makes predictions, gets RMSEs, and plots the figure
function AnalyzeNet(savefile, epochs, data, trainsize, noutputs; title="", params="", doplot=false)
    Y = copy(data[trainsize+1:end,1:noutputs])
    data, m, s = stnorm(data)
    X = data[trainsize+1:end,noutputs+1:end]'
    model = mx.load_checkpoint(savefile, epochs, mx.FeedForward) # load trained model
    # obtain predictions
    provider = mx.ArrayDataProvider(:data => X)
    fit = mx.predict(model, provider)
    fit = fit'
    fit = fit.*s[:,1:noutputs]
    fit = fit.+m[:,1:noutputs]
    # compute RMSE
    error = fit - Y
    bias = mean(error,1)
    mse = mean(error.^2.0,1)
    rmse = sqrt.(mse)
    #rsq = 1.0 .- mse./mean((Y .- mean(Y,1)).^2.0,1)
    rsq = 1.0 .- var(error,1) ./ var(Y,1)
    names = ["bias","rmse","mse","R²"]
    println()
    println("__________________________________________________")
    println("Neural net indirect inference results")
    if title != "" println(title) end
    if params != ""
        prettyprint([bias' rmse' mse' rsq'], names, params)
    else
        prettyprint([bias' rmse' mse' rsq'], names)
    end
    println("__________________________________________________")
    if doplot
        # get the first layer parameters for influence analysis
        model = mx.load_checkpoint(savefile, epochs) # load trained model
        beta = copy(model[2][:fullyconnected0_weight])
        z = maximum(abs.(beta),2);
        cax3 = matshow(z', interpolation="nearest")
        colorbar(cax3)
        ninputs = size(z,1)
        xlabels = [string(i) for i=1:ninputs]
        xticks(0:ninputs-1, xlabels)
        show()
        println("") # stop PyPlot screen spam
    end
    return fit
end


text:
using Omega

function testw()
  w = Omega.SimpleΩ{Vector{Int}, Array{Float64, 3}}()
  x = logistic(2.0, 2.0, (1, 2, 3))
  x(w)
  w = Omega.SimpleΩ{Vector{Int}, Array{Float64, 1}}()
  x = Omega.logistic(rand(2), rand(2))
  x(w)
end

testw()

function testlogistic()
  x = logistic(0.0, 1.0)
  rand(x)
  x = logistic(0.0, 1.0, (1, 2))
  rand(x)
  x = logistic(logistic(0.0, 1.0), logistic(0.0, 1.0))
  rand(x)
  x = logistic(logistic(0.0, 1.0), 1.0)
  rand(x)
  x = logistic(1.0, logistic(0.0, 1.0))
  rand(x)
  x = logistic(0.0, 1.0, (1,2,3))
  rand(x)
  x = logistic(logistic(0.0, 1.0, (1,2,3)), logistic(0.0, 1.0, (1,2,3)))
  rand(x)
  x = logistic(logistic(0.0, 1.0, (1,2,3)), 1.0)
  rand(x)
  x = logistic(1.0, logistic(0.0, 1.0, (1,2,3)))
  rand(x)
  x = logistic(logistic(0.0, 1.0, (1,2,3)), logistic(0.0, 1.0))
  rand(x)
  x = logistic(0, 1)
  rand(x)
end

testlogistic()


text:
# compute mandelbrot
"""
    mandelbrotBoundCheck(cr::AbstractFloat, ci::AbstractFloat, maxIter::Int = 1000)

Check whether a point belongs to the Mandelbrot Set.
Optimized for fast computation.
"""
function mandelbrotBoundCheck(
    cr::T,
    ci::T,
    maxIter::Int = 1000,
) where {T<:AbstractFloat}
    zr = zero(T)
    zi = zero(T)
    zrsqr = zr^2
    zisqr = zi^2
    result = 0
    for i = 1:maxIter
        if zrsqr + zisqr > 4.0
            result = i
            break
        end
        zi = (zr + zi)^2 - zrsqr - zisqr
        zi += ci
        zr = zrsqr - zisqr + cr
        zrsqr = zr^2
        zisqr = zi^2
    end
    return result
end

"""
    computeMandelbrot(
        xmin::Float64,
        xmax::Float64,
        ymin::Float64,
        ymax::Float64,
        width::Int = w_lr,
        height::Int = h_lr,
        maxIter::Int = 100,
        verbose = true,
    )

Compute the Mandelbrot Fractal.

See also: [`computeMandelbrot!`](@ref), [`computeMandelbrot_GPU`](@ref)
"""
function computeMandelbrot(
    xmin::Float64,
    xmax::Float64,
    ymin::Float64,
    ymax::Float64,
    width::Int = w_lr,
    height::Int = h_lr,
    maxIter::Int = 100,
    verbose = true,
)
    if verbose
        p = Progress(width)
        update!(p, 0)
        jj = Threads.Atomic{Int}(0)
        l = Threads.SpinLock()
    end

    # xc = (xmax + xmin) / 2
    # yc = (ymax + ymin) / 2
    # dx = (xmax - xmin) / width
    # dy = (ymax - ymin) / height

    x_arr = range(xmin, stop = xmax, length = width)
    y_arr = range(ymin, stop = ymax, length = height)

    pixels = zeros(typeof(xmin), height, width) #pixels[y,x]

    @threads for x_j = 1:width
        @inbounds for y_i = 1:height
            pixels[y_i, x_j] = mandelbrotBoundCheck(
                x_arr[x_j],
                y_arr[y_i],
                maxIter,
            )
        end
        if verbose
            Threads.atomic_add!(jj, 1)
            Threads.lock(l)
            update!(p, jj[])
            Threads.unlock(l)
        end
    end
    return pixels
end

"""
    computeMandelbrot(
        xmin::BigFloat,
        xmax::BigFloat,
        ymin::BigFloat,
        ymax::BigFloat,
        width::Int = w_lr,
        height::Int = h_lr,
        maxIter::Int = 100,
        verbose = true,
    )

Compute the Mandelbrot fractal using arbitrary precision computations (needed for deep zooms).
See also: [`computeMandelbrot!`](@ref), [`computeMandelbrot_GPU`](@ref)
"""
function computeMandelbrot(
    xmin::BigFloat,
    xmax::BigFloat,
    ymin::BigFloat,
    ymax::BigFloat,
    width::Int = w_lr,
    height::Int = h_lr,
    maxIter::Int = 100,
    verbose = true,
)
    if verbose
        p = Progress(width)
        update!(p, 0)
        jj = Threads.Atomic{Int}(0)
        l = Threads.SpinLock()
    end

    # xc = (xmax + xmin) / 2
    # yc = (ymax + ymin) / 2
    dx = (xmax - xmin) / width
    dy = (ymax - ymin) / height

    x_arr = range(xmin, stop = xmax, length = width)
    y_arr = range(ymin, stop = ymax, length = height)

    pixels = zeros(typeof(xmin), height, width) #pixels[y,x]

    # compute the required precision to have accurate computation of the fractal
    digits = 2 + ceil(Int, -log10(dx))
    bits = digits_to_bits(digits)
    bits = max(bits, 53) # use at least double precision
    @info "Using $digits digits"
    setprecision(bits) do
        @threads for x_j = 1:width
            @inbounds for y_i = 1:height
                pixels[y_i, x_j] = mandelbrotBoundCheck(
                    x_arr[x_j],
                    y_arr[y_i],
                    maxIter,
                )
            end
            if verbose
                Threads.atomic_add!(jj, 1)
                Threads.lock(l)
                update!(p, jj[])
                Threads.unlock(l)
            end
        end
    end
    return pixels
end

# gpu version
"""
    computeMandelbrot_GPU(
        xmin::Float64,
        xmax::Float64,
        ymin::Float64,
        ymax::Float64,
        width::Int = w_lr,
        height::Int = h_lr,
        maxIter::Int = 100,
        verbose = true)

Compute the Mandelbrot fractal using the GPU.

See also: [`computeMandelbrot!`](@ref), [`computeMandelbrot`](@ref)
"""
function computeMandelbrot_GPU(
    xmin::Float64,
    xmax::Float64,
    ymin::Float64,
    ymax::Float64,
    width::Int = w_lr,
    height::Int = h_lr,
    maxIter::Int = 100,
    verbose = true,
)

    x_arr = range(xmin, stop = xmax, length = width)
    y_arr = range(ymin, stop = ymax, length = height)

    dx = (xmax - xmin) / width

    xGrid = [i for j in y_arr, i in x_arr]
    yGrid = [j for j in y_arr, i in x_arr]

    # digits = 2 + ceil(Int, -log10(dx))

    # if digits <=7
    #
    #     c = AFArray(convert(Matrix{Float32}, xGrid + im * yGrid))
    #
    #     z = zeros(AFArray{Float32}, size(c))
    #     count = zeros(AFArray{Float32}, size(c))
    #
    # else
    #     if digits > 16
    #         @info "GPU computations are likely to be inaccurate at this scale"
    #     end
    #
    #     c = AFArray( xGrid + im * yGrid)
    #
    #     z = zeros(AFArray{Float64}, size(c))
    #     count = zeros(AFArray{Float64}, size(c))
    # end

    c = AFArray(xGrid + im * yGrid)

    z = zeros(AFArray{Float64}, size(c))
    count = zeros(AFArray{Float64}, size(c))

    if verbose
        @showprogress for n = 1:maxIter
            z = z .* z .+ c
            count = count + (abs(z) <= 2)
        end
    else
        for n = 1:maxIter
            z = z .* z .+ c
            count = count + (abs(z) <= 2)
        end
    end

    # sync the result
    sync(count)

    # transfer data back to the memory from GPU
    pixels = Array(count)

    return pixels
end

# compact interface
"""
    computeMandelbrot!(
        fractal_data::FractalData;
        verbose = true,
        use_GPU = false)

Compute the Mandelbrot fractal for a given FractalData object.

# Examples
```jldoctest
julia>  cmap1 = Mandelbrot.cycle_cmap(:inferno, 5)
        xmin1 = -1.744453831814658538530
        xmax1 = -1.744449945239591698236
        ymin1 = 0.022017835126305555133
        ymax1 = 0.022020017997233506531

julia>  fractal1_data = FractalData(xmin1, xmax1, ymin1, ymax1, width = Mandelbrot.w_4k, height = Mandelbrot.h_4k, colormap = cmap1, maxIter = 1500, scale_function = log)

julia>  computeMandelbrot!(fractal1_data)

julia>  display_fractal(fractal1_data, filename = "mandelbrot1.png")
```

See also: [`computeMandelbrot`](@ref)
"""
function computeMandelbrot!(
    fractal_data::FractalData;
    verbose = true,
    use_GPU = false,
)
    if use_GPU
        pixels = computeMandelbrot_GPU(
            fractal_data.xmin,
            fractal_data.xmax,
            fractal_data.ymin,
            fractal_data.ymax,
            fractal_data.width,
            fractal_data.height,
            fractal_data.maxIter,
            verbose,
        )
    else
        pixels = computeMandelbrot(
            fractal_data.xmin,
            fractal_data.xmax,
            fractal_data.ymin,
            fractal_data.ymax,
            fractal_data.width,
            fractal_data.height,
            fractal_data.maxIter,
            verbose,
        )
    end
    fractal_data.fractal = pixels
    return pixels
end


text:
@testset "Scalar comparisons" begin
    t = Tensor(3.14)

    # compare against larger scalar
    @test t < 4
    @test t <= 4
    @test !(t > 4)
    @test !(t >= 4)
    @test t != 4

    @test 4 > t
    @test 4 >= t
    @test !(4 < t)
    @test !(4 <= t)
    @test 4 != t

    # compare against smaller scalar
    @test !(t < 3)
    @test !(t <= 3)
    @test t > 3
    @test t >= 3
    @test t != 3

    @test !(3 > t)
    @test !(3 >= t)
    @test 3 < t
    @test 3 <= t
    @test 3 != t

    # compare against equal scalar
    @test !(t < 3.14)
    @test t <= 3.14
    @test !(t > 3.14)
    @test t >= 3.14
    @test t == 3.14

    @test !(3.14 > t)
    @test 3.14 >= t
    @test !(3.14 < t)
    @test 3.14 <= t
    @test 3.14 == t

    # comparisons between scalar tensors also work
    @test t < Tensor(4)
    @test t <= Tensor(4)
    @test !(t < Tensor(3))
    @test !(t <= Tensor(3))
    @test t == Tensor(3.14)

    # non-equality comparisons throw if tensor isn't scalar
    t = Tensor([2.71, 3.14])

    @test_throws MethodError t < 4
    @test_throws MethodError t <= 4
    @test_throws MethodError !(t > 4)
    @test_throws MethodError !(t >= 4)

    @test_throws MethodError 4 > t
    @test_throws MethodError 4 >= t
    @test_throws MethodError !(4 < t)
    @test_throws MethodError !(4 <= t)

    @test t != 4
    @test 4 != t
end

@testset "Scalar operations" begin
    # + - * / ÷ \ ^ %
    @test Tensor(2) + 0.4 == Tensor(2.4)
    @test 3 + Tensor(1.5) == Tensor(4.5)
    @test Tensor(5) + Tensor(4) == Tensor(9)

    @test Tensor(2) - 0.4 == Tensor(1.6)
    @test 3 - Tensor(1.5) == Tensor(1.5)
    @test Tensor(5) - Tensor(4) == Tensor(1)

    @test Tensor(2) * 0.4 == Tensor(0.8)
    @test 3 * Tensor(1.5) == Tensor(4.5)
    @test Tensor(5) * Tensor(4) == Tensor(20)

    @test Tensor(2) / 0.4 == Tensor(5.0)
    @test 3 / Tensor(1.5) == Tensor(2.0)
    @test Tensor(5) / Tensor(4) == Tensor(1.25)

    @test Tensor(2) ÷ 0.4 == Tensor(4.0)
    @test 3 ÷ Tensor(1.5) == Tensor(2.0)
    @test Tensor(5) ÷ Tensor(4) == Tensor(1)

    @test Tensor(2) \ 0.4 == Tensor(0.2)
    @test 3 \ Tensor(1.5) == Tensor(0.5)
    @test Tensor(5) \ Tensor(4) == Tensor(0.8)

    @test Tensor(2)^0.4 ≈ Tensor(1.3195079)
    @test 3^Tensor(1.5) ≈ Tensor(5.1961524)
    @test Tensor(5)^Tensor(4) == Tensor(625)

    # floating point error
    @test Tensor(2) % 0.4 ≈ Tensor(0.399999999)
    @test 3 % Tensor(1.5) == Tensor(0.0)
    @test Tensor(5) % Tensor(4) == Tensor(1)
end

@testset "Non-scalar operations" begin
    t1 = Tensor([
        1 2 3
        4 5 6
    ])
    t2 = Tensor([
        1 0 1
        0 1 0
    ])

    # unary +, - operators
    @test +t1 == Tensor([
        1 2 3
        4 5 6
    ])
    @test -t1 == Tensor([
        -1 -2 -3
        -4 -5 -6
    ])

    # binary +, - operators
    @test t1 + t2 == Tensor([
        2 2 4
        4 6 6
    ])
    @test t1 + t2 == t2 + t1

    @test t1 - t2 == Tensor([
        0 2 2
        4 4 6
    ])
    @test t1 - t2 == -(t2 - t1)

    # size of tensors to be added or subtracted has to match or the methods will throw
    t3 = Tensor([
        1 4
        2 5
        3 6
    ])

    @test_throws DimensionMismatch t1 + t3
    @test_throws DimensionMismatch t3 + t2
    @test_throws DimensionMismatch t1 - t3
    @test_throws DimensionMismatch t3 - t2
end

@testset "Non-scalar-scalar arithmetic" begin
    t1 = Tensor(rand(3, 3))
    t2 = Tensor(2)
    t3 = Tensor(-1.0f0)

    # each tensor can be multiplied by a scalar (tensor) from both sides
    @test t1 * t2 == t2 * t1 == 2 * t1 == t1 * 2 == Tensor(t1.data * 2)
    @test t1 * t3 == t3 * t1 == -1.0f0 * t1 == t1 * -1.0f0 == Tensor(t1.data * -1.0f0)

    # each tensor can be divided by a scalar (tensor)
    @test t1 / t2 == t1 / 2 == Tensor(t1.data / 2)
    @test t1 / t3 == t1 / -1.0f0 == Tensor(t1.data / -1.0f0)

    # non-scalar tensors can not be divided by
    @test_throws MethodError t2 / t1
    @test_throws MethodError -1.0f0 / t1

    # similar to Julia arrays only * and / are directly supported by tensors all other
    # operations need to Broadcasted
    @test_throws MethodError t1 ÷ t2
    @test_throws MethodError t1 ÷ 2
    @test_throws MethodError t1 \ t2
    @test_throws MethodError t1 \ 2
    @test_throws MethodError t1^t2
    @test_throws MethodError t1^2
    @test_throws MethodError t1 % t2
    @test_throws MethodError t1 % 2

    # this works
    @test t1 .÷ t2 == t1 .÷ 2 == Tensor(t1.data .÷ 2)
    @test t1 .\ t2 == t1 .\ 2 == Tensor(t1.data .\ 2)
    @test t1 .^ t2 == t1 .^ 2 == Tensor(t1.data .^ 2)
    @test t1 .% t2 == t1 .% 2 == Tensor(t1.data .% 2)
end

@testset "Array-like arithmetic" begin
    t1 = Tensor([1 2; 3 4])

    @test sum(t1) == Tensor(10)
    @test sum(t1; dims=1) == Tensor([4 6])
    @test sum(t1; dims=2) == Tensor(reshape([3, 7], 2, 1))

    @test prod(t1) == Tensor(24)
    @test prod(t1; dims=1) == Tensor([3 8])
    @test prod(t1; dims=2) == Tensor(reshape([2, 12], 2, 1))

    @test maximum(t1) == Tensor(4)
    @test maximum(x -> -x, t1) == Tensor(-1)
    @test maximum(t1; dims=1) == Tensor([3 4])

    @test minimum(t1) == Tensor(1)
    @test minimum(x -> -x, t1) == Tensor(-4)
    @test minimum(t1; dims=2) == Tensor(reshape([1, 3], 2, 1))

    # NOTE: when passing the 'dims' keyword to extrema, its behaviour is slightly different
    # than with arrays, i.e., instead of a tensor of tuples, it returns a tuple of tensors
    @test extrema(t1) == (Tensor(1), Tensor(4))
    @test extrema(x -> -x, t1) == (Tensor(-4), Tensor(-1))
    @test extrema(t1; dims=1) == (Tensor([1 2]), Tensor([3 4]))

    # NOTE: similar to extrema, this functions does not return a tensor of cartesian indices
    # when assigning the 'dims' keyword but rather an 'Array{CartesianIndices}'
    @test argmax(t1) == CartesianIndex(2, 2)
    @test argmax(t1; dims=1) == [CartesianIndex(2, 1) CartesianIndex(2, 2)]
    @test argmin(t1) == CartesianIndex(1, 1)
    @test argmin(t1; dims=2) == reshape([CartesianIndex(1, 1), CartesianIndex(2, 1)], 2, 1)

    @test findmax(t1) == (Tensor(4), CartesianIndex(2, 2))
    @test findmax(t1; dims=1) ==
        (Tensor([3 4]), [CartesianIndex(2, 1) CartesianIndex(2, 2)])
    @test findmin(t1) == (Tensor(1), CartesianIndex(1, 1))
    @test findmin(t1; dims=2) == (
        Tensor(reshape([1, 3], 2, 1)),
        reshape([CartesianIndex(1, 1), CartesianIndex(2, 1)], 2, 1),
    )

    t2 = Tensor([1-im 3; -2im 2+3im])
    @test conj(t2) == Tensor([1+im 3; 2im 2-3im])
    t3 = Tensor(rand(4, 7, 5))
    @test conj(t3) == t3
end


text:
using DelimitedFiles
using DataStructures

function solve(input)
    raw = readdlm(input,'\n')
    s=raw[1]
    n_units = solvePart1(s,[])
    println("part 1 result: $n_units")
    n_units = solvePart2(s)
    println("part 2 result: $n_units")

end

function solvePart1(s,escape)
    result=[s[1]]
    for c in s[2:end]
        if findfirst(x->x==c,escape)==nothing
            if length(result)>0 && abs(result[end]-c)==32
                pop!(result)
            else
                push!(result,c)
            end
        end
    end
    n_units = length(result)
    return n_units
end

function solvePart2(s)
    ascii = [65:65+25...]
    searchGrid = []
    mapreduce(process,searchMin,ascii,init=(s,searchGrid))
    @show searchGrid
    return min(searchGrid...)
end

function process(codeChar)
    return [Char(codeChar),Char(codeChar+32)]
end

function searchMin((s,searchGrid),exclude)
    push!(searchGrid,solvePart1(s,exclude))
    return (s,searchGrid)
end

solve("input.txt")


text:
mutable struct ExactMonotonicRiskRegion <: AbstractRiskRegion
    β::Float64
    surv::Function
end

function ∈(x::VecF64, Ω::ExactMonotonicRiskRegion)
    if Ω.surv(x) < 1 - Ω.β
        return true
    else
        return false
    end
end

mutable struct MonotonicRiskRegion <: AbstractRiskRegion
    β::Float64
    nonrisk_frontier::LinkedList{VecF64}
    risk_frontier::LinkedList{VecF64}
    surv::SurvivorApproximator
    function MonotonicRiskRegion(surv::SurvivorApproximator, β::Float64)
        return new(β,nil(VecF64),nil(VecF64),surv)
    end
end

function add_to_risk_frontier!(Ω::AbstractRiskRegion, x::AbstractVector{T}) where T<:Real
    l = Ω.risk_frontier
    if isa(l, Nil{VecF64})
        return Ω.risk_frontier=list(x[:])
    end

    while !isa(l, Nil{VecF64})
        pf = head(l)
        if vec_isless(x, pf)
            if isa(tail(l),Nil{VecF64})
                return Ω.risk_frontier=list(x[:])
            else
                decapitate!(l)
            end
        end
        l = tail(l)
    end
    return Ω.risk_frontier = cons(x[:], Ω.risk_frontier)
end

function add_to_nonrisk_frontier!(Ω::AbstractRiskRegion, x::AbstractVector{T}) where T<:Real
    l = Ω.nonrisk_frontier
    if isa(l, Nil{VecF64})
        return Ω.nonrisk_frontier=list(x[:])
    end

    while !isa(l, Nil{VecF64})
        pf = head(l)
        if vec_isless(pf, x)
            if isa(tail(l),Nil{VecF64})
                return Ω.nonrisk_frontier=list(x[:])
            else
                decapitate!(l)
            end
        end
        l = tail(l)
    end
    return Ω.nonrisk_frontier = cons(x[:], Ω.nonrisk_frontier)
end

function ∈(x::VecF64, Ω::MonotonicRiskRegion)
    if below_nonrisk_frontier(x, Ω.nonrisk_frontier) return false
    elseif above_risk_frontier(x, Ω.risk_frontier) return true
    else
        prob, err = Ω.surv(x)
        if prob > 1 - Ω.β
            if prob - err > (1 - Ω.β)
                add_to_nonrisk_frontier!(Ω, x)
            end
            return false
        else
            if prob + err < (1-Ω.β)
                add_to_risk_frontier!(Ω, x)
            end
            return true
        end
    end
end

function prob_nonrisk(dist::Distribution{Multivariate, Continuous}, β_list::Vector{Float64}, num_points_surv::Int = 50000, num_points_nonrisk::Int = 10000, α::Float64=0.99)
    sample = rand(dist, num_points_nonrisk)
    surv = SurvivorApproximator(rand(dist, num_points_surv), α)
    Ω = Dict{Float64, MonotonicRiskRegion}()
    probs = Dict{Float64,Float64}()

    for β in β_list
        Ω[β] = MonotonicRiskRegion(surv, β)
        probs[β] = 0.0
    end

    for i in 1:num_points_nonrisk
        point = view(sample, :, i)
        calc_surv_prob = false
        surv_prob = 0.0
        for β in β_list
            if calc_surv_prob
                probs[β] += (surv_prob > 1-β ? 1 : 0)
                continue
            else
                shortcut = false
                # Does sampled point dominate any point in risk region?
                if below_nonrisk_frontier(point, Ω[β].nonrisk_frontier)
                    shortcut=true
                    probs[β] += 1
                elseif above_risk_frontier(point, Ω[β].risk_frontier)
                    shortcut=true
                end

                if !shortcut
                    surv_prob, err = surv(point)
                    if surv_prob > 1 - β
                        probs[β]+=1
                        if surv_prob - err > 1-β
                            add_to_nonrisk_frontier!(Ω[β], point)
                        end
                    else
                        if surv_prob + err < 1-β
                            add_to_risk_frontier!(Ω[β], point)
                        end
                    end
                    calc_surv_prob=true
                end
            end
        end
    end

    for β in β_list
        probs[β]/= num_points_nonrisk
    end
    return probs
end


text:
# Randomized QB decomposition

function rqb(X,
             k::Int,
             p::Int,
             q::Int)

    m, n = size(X)
    Y = X * randinit(n, k + p)
    sub_iterations!(X, Y, q)
    Q = qr(Y).Q

    return Q, Q' * X
end


text:
function main(window)
 push!(window.assets, "widgets")

    inp = Input(Dict())

    s = sampler()
    form = vbox(
        h1("Submit your rating"),
        watch!(s, textinput("", name=:name, label="Your name")),
        hbox("Your rating", watch!(s, slider(1:10, name=:rating)))
            |> packacross(center),
        trigger!(s, button("Submit", name=:submit))
    ) |> maxwidth(400px)

    lift(inp) do dict
        vbox(
            plugsampler(s, form) >>> inp,
            vskip(2em),
            string(dict)
        ) |> pad(2em)
    end
end
println("Hello world")
println("Hello thi sis just dumb...")
print("hello julia")

max_stars_repo_name: vbsteja/code

max_issues_repo_name: vbsteja/code

max_forks_repo_name: vbsteja/code


text:
using BNP
using Base.Test

include("distributionsTests.jl")
include("psmtest.jl")
include("vipointestimatetest.jl")

# load tests
include("dpmm_tests.jl")
#include("hdp_test.jl")
#include("vcm_tests.jl")


text:
### A Pluto.jl notebook ###
# v0.12.17

using Markdown
using InteractiveUtils

# ╔═╡ 3c1afde0-3cd3-11eb-1334-d778fc425486
using Feather;using Pandas

# ╔═╡ 70723130-3cd3-11eb-0796-8316334e96c0
readdir()

# ╔═╡ 91429d00-3cd3-11eb-085c-b5d30d88a3e6
head(read_csv("cleaned",index_col=0))

# ╔═╡ Cell order:
# ╠═3c1afde0-3cd3-11eb-1334-d778fc425486
# ╠═70723130-3cd3-11eb-0796-8316334e96c0
# ╠═91429d00-3cd3-11eb-085c-b5d30d88a3e6

max_stars_repo_name: punkmath/Misc

max_issues_repo_name: punkmath/Misc

max_forks_repo_name: punkmath/Misc


text:
using Test
using PokerGUI

@testset "PokerGUI" begin
    @test 1==1
end


text:
using Pkg, PackageCompiler

pkg"activate . "

compile_package("JuliaOpenGL")

max_stars_repo_name: Gilga/JuliaOpenGL

max_issues_repo_name: Gilga/JuliaOpenGL

max_forks_repo_name: Gilga/JuliaOpenGL


text:
module TestDaemonService

using Base.Test
using SimpleTasksTests.Utils.TestTasks
using SimpleTasksTests.Utils.MockServices
using SimpleTasks.Services.Daemon

import SimpleTasks.Services.Queue
import SimpleTasks.Services.Bucket
import SimpleTasks.Services.Datasource
import SimpleTasks.Tasks.DaemonTask
import JSON

function make_mock_daemon_service()
    return DaemonService(MockQueueService(), MockQueueService(),
        MockQueueService(), MockBucketService(), MockDatasourceService(), 10)
end

function test_register_no_execute_method()
    daemon = make_mock_daemon_service()
    @test_throws Exception Daemon.register!(daemon,
        TEST_TASK_NAME, MockTaskNoExecute)
end

function test_register_with_execute_method()
    daemon = make_mock_daemon_service()
    exception = nothing
    try
         Daemon.register!(daemon, TEST_TASK_NAME, MockTaskExecute)
    catch e
        exception = e
    end
    @test exception == nothing
end

function test_parse_empty()
    daemon = make_mock_daemon_service()
    @test_throws ArgumentError Daemon.parse(daemon, " ")
end

function test_parse_no_basic_info()
    daemon = make_mock_daemon_service()
    task = make_valid_task_execute()
    dict = JSON.parse(JSON.json(task))
    delete!(dict, "basic_info")
    @test_throws KeyError Daemon.parse(daemon, JSON.json(dict))
end

function test_parse_no_payload_info()
    daemon = make_mock_daemon_service()
    task = make_valid_task_execute()
    Daemon.register!(daemon, TEST_TASK_NAME, typeof(task))
    dict = JSON.parse(JSON.json(task))
    delete!(dict, "payload_info")
    @test_throws KeyError Daemon.parse(daemon, JSON.json(dict))
end

function test_parse_task_not_registered()
    daemon = make_mock_daemon_service()
    task = make_valid_task_execute()
    dict = JSON.parse(JSON.json(task))

    @test_throws ErrorException Daemon.parse(daemon, JSON.json(dict))
end

function test_parse_good()
    daemon = make_mock_daemon_service()
    task = make_valid_task_execute()
    Daemon.register!(daemon, TEST_TASK_NAME, typeof(task))
    dict = JSON.parse(JSON.json(task))
    parsed_task = Daemon.parse(daemon, JSON.json(dict))
    @test parsed_task != nothing
    @test parsed_task.basic_info.name == task.basic_info.name
    @test parsed_task.basic_info.id == task.basic_info.id
    @test parsed_task.payload_info == task.payload_info

end

function __init__()
    test_register_no_execute_method()
    test_register_with_execute_method()

    test_parse_empty()
    test_parse_no_basic_info()
    test_parse_task_not_registered()
    test_parse_good()
end

end #module TestDaemon

max_forks_repo_name: seung-lab/SimpleTasks