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

"""
    abort_environment_update()
    abort_environment_update(params::Dict{String,<:Any})

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

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("AbortEnvironmentUpdate"; aws_config=aws_config)
abort_environment_update(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("AbortEnvironmentUpdate", params; aws_config=aws_config)

"""
    apply_environment_managed_action(action_id)
    apply_environment_managed_action(action_id, params::Dict{String,<:Any})

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.

# Arguments
- `action_id`: The action ID of the scheduled managed action to execute.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"EnvironmentId"`: The environment ID of the target environment.
- `"EnvironmentName"`: The name of the target environment.
"""
apply_environment_managed_action(ActionId; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("ApplyEnvironmentManagedAction", Dict{String, Any}("ActionId"=>ActionId); aws_config=aws_config)
apply_environment_managed_action(ActionId, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("ApplyEnvironmentManagedAction", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ActionId"=>ActionId), params)); aws_config=aws_config)

"""
    associate_environment_operations_role(environment_name, operations_role)
    associate_environment_operations_role(environment_name, operations_role, params::Dict{String,<:Any})

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.

# Arguments
- `environment_name`: The name of the environment to which to set the operations role.
- `operations_role`: 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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("AssociateEnvironmentOperationsRole", Dict{String, Any}("EnvironmentName"=>EnvironmentName, "OperationsRole"=>OperationsRole); aws_config=aws_config)
associate_environment_operations_role(EnvironmentName, OperationsRole, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("AssociateEnvironmentOperationsRole", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("EnvironmentName"=>EnvironmentName, "OperationsRole"=>OperationsRole), params)); aws_config=aws_config)

"""
    check_dnsavailability(cnameprefix)
    check_dnsavailability(cnameprefix, params::Dict{String,<:Any})

Checks if the specified CNAME is available.

# Arguments
- `cnameprefix`: The prefix used when this CNAME is reserved.

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

"""
    compose_environments()
    compose_environments(params::Dict{String,<:Any})

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
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("ComposeEnvironments"; aws_config=aws_config)
compose_environments(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("ComposeEnvironments", params; aws_config=aws_config)

"""
    create_application(application_name)
    create_application(application_name, params::Dict{String,<:Any})

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

# Arguments
- `application_name`: The name of the application. Must be unique within your account.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("CreateApplication", Dict{String, Any}("ApplicationName"=>ApplicationName); aws_config=aws_config)
create_application(ApplicationName, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("CreateApplication", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName), params)); aws_config=aws_config)

"""
    create_application_version(application_name, version_label)
    create_application_version(application_name, version_label, params::Dict{String,<:Any})

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.

# Arguments
- `application_name`:  The name of the application. If no application is found with this
  name, and AutoCreateApplication is false, returns an InvalidParameterValue error.
- `version_label`: 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
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("CreateApplicationVersion", Dict{String, Any}("ApplicationName"=>ApplicationName, "VersionLabel"=>VersionLabel); aws_config=aws_config)
create_application_version(ApplicationName, VersionLabel, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("CreateApplicationVersion", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "VersionLabel"=>VersionLabel), params)); aws_config=aws_config)

"""
    create_configuration_template(application_name, template_name)
    create_configuration_template(application_name, template_name, params::Dict{String,<:Any})

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

# Arguments
- `application_name`: The name of the Elastic Beanstalk application to associate with this
  configuration template.
- `template_name`: The name of the configuration template. Constraint: This name must be
  unique per application.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("CreateConfigurationTemplate", Dict{String, Any}("ApplicationName"=>ApplicationName, "TemplateName"=>TemplateName); aws_config=aws_config)
create_configuration_template(ApplicationName, TemplateName, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("CreateConfigurationTemplate", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "TemplateName"=>TemplateName), params)); aws_config=aws_config)

"""
    create_environment(application_name)
    create_environment(application_name, params::Dict{String,<:Any})

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

# Arguments
- `application_name`: The name of the application that is associated with this environment.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("CreateEnvironment", Dict{String, Any}("ApplicationName"=>ApplicationName); aws_config=aws_config)
create_environment(ApplicationName, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("CreateEnvironment", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName), params)); aws_config=aws_config)

"""
    create_platform_version(platform_definition_bundle, platform_name, platform_version)
    create_platform_version(platform_definition_bundle, platform_name, platform_version, params::Dict{String,<:Any})

Create a new version of your custom platform.

# Arguments
- `platform_definition_bundle`: The location of the platform definition archive in Amazon
  S3.
- `platform_name`: The name of your custom platform.
- `platform_version`: The number, such as 1.0.2, for the new platform version.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=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, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("CreatePlatformVersion", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("PlatformDefinitionBundle"=>PlatformDefinitionBundle, "PlatformName"=>PlatformName, "PlatformVersion"=>PlatformVersion), params)); aws_config=aws_config)

"""
    create_storage_location()
    create_storage_location(params::Dict{String,<:Any})

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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("CreateStorageLocation"; aws_config=aws_config)
create_storage_location(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("CreateStorageLocation", params; aws_config=aws_config)

"""
    delete_application(application_name)
    delete_application(application_name, params::Dict{String,<:Any})

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.

# Arguments
- `application_name`: The name of the application to delete.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"TerminateEnvByForce"`: When set to true, running environments will be terminated before
  deleting the application.
"""
delete_application(ApplicationName; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DeleteApplication", Dict{String, Any}("ApplicationName"=>ApplicationName); aws_config=aws_config)
delete_application(ApplicationName, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DeleteApplication", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName), params)); aws_config=aws_config)

"""
    delete_application_version(application_name, version_label)
    delete_application_version(application_name, version_label, params::Dict{String,<:Any})

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

# Arguments
- `application_name`: The name of the application to which the version belongs.
- `version_label`: The label of the version to delete.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DeleteApplicationVersion", Dict{String, Any}("ApplicationName"=>ApplicationName, "VersionLabel"=>VersionLabel); aws_config=aws_config)
delete_application_version(ApplicationName, VersionLabel, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DeleteApplicationVersion", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "VersionLabel"=>VersionLabel), params)); aws_config=aws_config)

"""
    delete_configuration_template(application_name, template_name)
    delete_configuration_template(application_name, template_name, params::Dict{String,<:Any})

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.

# Arguments
- `application_name`: The name of the application to delete the configuration template from.
- `template_name`: The name of the configuration template to delete.

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

"""
    delete_environment_configuration(application_name, environment_name)
    delete_environment_configuration(application_name, environment_name, params::Dict{String,<:Any})

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.

# Arguments
- `application_name`: The name of the application the environment is associated with.
- `environment_name`: The name of the environment to delete the draft configuration from.

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

"""
    delete_platform_version()
    delete_platform_version(params::Dict{String,<:Any})

Deletes the specified version of a custom platform.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"PlatformArn"`: The ARN of the version of the custom platform.
"""
delete_platform_version(; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DeletePlatformVersion"; aws_config=aws_config)
delete_platform_version(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DeletePlatformVersion", params; aws_config=aws_config)

"""
    describe_account_attributes()
    describe_account_attributes(params::Dict{String,<:Any})

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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeAccountAttributes"; aws_config=aws_config)
describe_account_attributes(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeAccountAttributes", params; aws_config=aws_config)

"""
    describe_application_versions()
    describe_application_versions(params::Dict{String,<:Any})

Retrieve a list of application versions.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeApplicationVersions"; aws_config=aws_config)
describe_application_versions(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeApplicationVersions", params; aws_config=aws_config)

"""
    describe_applications()
    describe_applications(params::Dict{String,<:Any})

Returns the descriptions of existing applications.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"ApplicationNames"`: If specified, AWS Elastic Beanstalk restricts the returned
  descriptions to only include those with the specified names.
"""
describe_applications(; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeApplications"; aws_config=aws_config)
describe_applications(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeApplications", params; aws_config=aws_config)

"""
    describe_configuration_options()
    describe_configuration_options(params::Dict{String,<:Any})

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
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeConfigurationOptions"; aws_config=aws_config)
describe_configuration_options(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeConfigurationOptions", params; aws_config=aws_config)

"""
    describe_configuration_settings(application_name)
    describe_configuration_settings(application_name, params::Dict{String,<:Any})

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

# Arguments
- `application_name`: The application for the environment or configuration template.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeConfigurationSettings", Dict{String, Any}("ApplicationName"=>ApplicationName); aws_config=aws_config)
describe_configuration_settings(ApplicationName, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeConfigurationSettings", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName), params)); aws_config=aws_config)

"""
    describe_environment_health()
    describe_environment_health(params::Dict{String,<:Any})

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

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentHealth"; aws_config=aws_config)
describe_environment_health(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentHealth", params; aws_config=aws_config)

"""
    describe_environment_managed_action_history()
    describe_environment_managed_action_history(params::Dict{String,<:Any})

Lists an environment's completed and failed managed actions.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentManagedActionHistory"; aws_config=aws_config)
describe_environment_managed_action_history(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentManagedActionHistory", params; aws_config=aws_config)

"""
    describe_environment_managed_actions()
    describe_environment_managed_actions(params::Dict{String,<:Any})

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

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentManagedActions"; aws_config=aws_config)
describe_environment_managed_actions(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentManagedActions", params; aws_config=aws_config)

"""
    describe_environment_resources()
    describe_environment_resources(params::Dict{String,<:Any})

Returns AWS resources for this environment.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentResources"; aws_config=aws_config)
describe_environment_resources(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironmentResources", params; aws_config=aws_config)

"""
    describe_environments()
    describe_environments(params::Dict{String,<:Any})

Returns descriptions for existing environments.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironments"; aws_config=aws_config)
describe_environments(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEnvironments", params; aws_config=aws_config)

"""
    describe_events()
    describe_events(params::Dict{String,<:Any})

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
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEvents"; aws_config=aws_config)
describe_events(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeEvents", params; aws_config=aws_config)

"""
    describe_instances_health()
    describe_instances_health(params::Dict{String,<:Any})

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

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeInstancesHealth"; aws_config=aws_config)
describe_instances_health(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribeInstancesHealth", params; aws_config=aws_config)

"""
    describe_platform_version()
    describe_platform_version(params::Dict{String,<:Any})

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
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"PlatformArn"`: The ARN of the platform version.
"""
describe_platform_version(; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribePlatformVersion"; aws_config=aws_config)
describe_platform_version(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("DescribePlatformVersion", params; aws_config=aws_config)

"""
    disassociate_environment_operations_role(environment_name)
    disassociate_environment_operations_role(environment_name, params::Dict{String,<:Any})

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.

# Arguments
- `environment_name`: The name of the environment from which to disassociate the operations
  role.

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

"""
    list_available_solution_stacks()
    list_available_solution_stacks(params::Dict{String,<:Any})

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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("ListAvailableSolutionStacks"; aws_config=aws_config)
list_available_solution_stacks(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("ListAvailableSolutionStacks", params; aws_config=aws_config)

"""
    list_platform_branches()
    list_platform_branches(params::Dict{String,<:Any})

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
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("ListPlatformBranches"; aws_config=aws_config)
list_platform_branches(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("ListPlatformBranches", params; aws_config=aws_config)

"""
    list_platform_versions()
    list_platform_versions(params::Dict{String,<:Any})

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
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("ListPlatformVersions"; aws_config=aws_config)
list_platform_versions(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("ListPlatformVersions", params; aws_config=aws_config)

"""
    list_tags_for_resource(resource_arn)
    list_tags_for_resource(resource_arn, params::Dict{String,<:Any})

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.

# Arguments
- `resource_arn`: 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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("ListTagsForResource", Dict{String, Any}("ResourceArn"=>ResourceArn); aws_config=aws_config)
list_tags_for_resource(ResourceArn, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("ListTagsForResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResourceArn"=>ResourceArn), params)); aws_config=aws_config)

"""
    rebuild_environment()
    rebuild_environment(params::Dict{String,<:Any})

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
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("RebuildEnvironment"; aws_config=aws_config)
rebuild_environment(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("RebuildEnvironment", params; aws_config=aws_config)

"""
    request_environment_info(info_type)
    request_environment_info(info_type, params::Dict{String,<:Any})

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

# Arguments
- `info_type`: The type of information to request.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("RequestEnvironmentInfo", Dict{String, Any}("InfoType"=>InfoType); aws_config=aws_config)
request_environment_info(InfoType, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("RequestEnvironmentInfo", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("InfoType"=>InfoType), params)); aws_config=aws_config)

"""
    restart_app_server()
    restart_app_server(params::Dict{String,<:Any})

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

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("RestartAppServer"; aws_config=aws_config)
restart_app_server(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("RestartAppServer", params; aws_config=aws_config)

"""
    retrieve_environment_info(info_type)
    retrieve_environment_info(info_type, params::Dict{String,<:Any})

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

# Arguments
- `info_type`: The type of information to retrieve.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("RetrieveEnvironmentInfo", Dict{String, Any}("InfoType"=>InfoType); aws_config=aws_config)
retrieve_environment_info(InfoType, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("RetrieveEnvironmentInfo", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("InfoType"=>InfoType), params)); aws_config=aws_config)

"""
    swap_environment_cnames()
    swap_environment_cnames(params::Dict{String,<:Any})

Swaps the CNAMEs of two environments.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("SwapEnvironmentCNAMEs"; aws_config=aws_config)
swap_environment_cnames(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("SwapEnvironmentCNAMEs", params; aws_config=aws_config)

"""
    terminate_environment()
    terminate_environment(params::Dict{String,<:Any})

Terminates the specified environment.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("TerminateEnvironment"; aws_config=aws_config)
terminate_environment(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("TerminateEnvironment", params; aws_config=aws_config)

"""
    update_application(application_name)
    update_application(application_name, params::Dict{String,<:Any})

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.

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

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Description"`: A new description for the application. Default: If not specified, AWS
  Elastic Beanstalk does not update the description.
"""
update_application(ApplicationName; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("UpdateApplication", Dict{String, Any}("ApplicationName"=>ApplicationName); aws_config=aws_config)
update_application(ApplicationName, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("UpdateApplication", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName), params)); aws_config=aws_config)

"""
    update_application_resource_lifecycle(application_name, resource_lifecycle_config)
    update_application_resource_lifecycle(application_name, resource_lifecycle_config, params::Dict{String,<:Any})

Modifies lifecycle settings for an application.

# Arguments
- `application_name`: The name of the application.
- `resource_lifecycle_config`: The lifecycle configuration.

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

"""
    update_application_version(application_name, version_label)
    update_application_version(application_name, version_label, params::Dict{String,<:Any})

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.

# Arguments
- `application_name`: The name of the application associated with this version.  If no
  application is found with this name, UpdateApplication returns an InvalidParameterValue
  error.
- `version_label`: The name of the version to update. If no application version is found
  with this label, UpdateApplication returns an InvalidParameterValue error.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Description"`: A new description for this version.
"""
update_application_version(ApplicationName, VersionLabel; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("UpdateApplicationVersion", Dict{String, Any}("ApplicationName"=>ApplicationName, "VersionLabel"=>VersionLabel); aws_config=aws_config)
update_application_version(ApplicationName, VersionLabel, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("UpdateApplicationVersion", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "VersionLabel"=>VersionLabel), params)); aws_config=aws_config)

"""
    update_configuration_template(application_name, template_name)
    update_configuration_template(application_name, template_name, params::Dict{String,<:Any})

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

# Arguments
- `application_name`: 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.
- `template_name`: The name of the configuration template to update.  If no configuration
  template is found with this name, UpdateConfigurationTemplate returns an
  InvalidParameterValue error.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("UpdateConfigurationTemplate", Dict{String, Any}("ApplicationName"=>ApplicationName, "TemplateName"=>TemplateName); aws_config=aws_config)
update_configuration_template(ApplicationName, TemplateName, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("UpdateConfigurationTemplate", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "TemplateName"=>TemplateName), params)); aws_config=aws_config)

"""
    update_environment()
    update_environment(params::Dict{String,<:Any})

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
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("UpdateEnvironment"; aws_config=aws_config)
update_environment(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("UpdateEnvironment", params; aws_config=aws_config)

"""
    update_tags_for_resource(resource_arn)
    update_tags_for_resource(resource_arn, params::Dict{String,<:Any})

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.

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

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("UpdateTagsForResource", Dict{String, Any}("ResourceArn"=>ResourceArn); aws_config=aws_config)
update_tags_for_resource(ResourceArn, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("UpdateTagsForResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResourceArn"=>ResourceArn), params)); aws_config=aws_config)

"""
    validate_configuration_settings(application_name, option_settings)
    validate_configuration_settings(application_name, option_settings, params::Dict{String,<:Any})

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.

# Arguments
- `application_name`: The name of the application that the configuration template or
  environment belongs to.
- `option_settings`: A list of the options and desired values to evaluate.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"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::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("ValidateConfigurationSettings", Dict{String, Any}("ApplicationName"=>ApplicationName, "OptionSettings"=>OptionSettings); aws_config=aws_config)
validate_configuration_settings(ApplicationName, OptionSettings, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = elastic_beanstalk("ValidateConfigurationSettings", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ApplicationName"=>ApplicationName, "OptionSettings"=>OptionSettings), params)); aws_config=aws_config)


text:
using PyCall
using PyPlot

@pyimport modeller

function r_enumerate(seq)
    """Enumerate a sequence in reverse order"""
    # Note that we don"t use reversed() since Python 2.3 doesn"t have it
    num = pybuiltin(:len)(seq) - 1
    while num >= 0
        produce((num, get(seq, num)))
        num -= 1
    end
end

function get_profile(profile_file, seq)
    """Read `profile_file` into a Python array, and add gaps corresponding to
       the alignment sequence `seq`."""
    # Read all non-comment and non-blank lines from the file:
    f = open(profile_file)
    vals = Any[]
    for line in eachline(f)
        if line[1] != '#' && length(line) > 10
            spl = split(line)
            push!(vals, float(last(spl)))
        end
    end
    close(f)
    # Insert gaps into the profile corresponding to those in seq:
    taskAtr = @task r_enumerate(seq[:residues])
    for x in taskAtr
        n = x[1]
        res = x[2]
        for gap in range(1, res[:get_leading_gaps]())
            # Julia arrays start from 1 so we have to add 1 to the position
            insert!(vals, n+1, nothing)
        end
    end
    # Add a gap at position "0", so that we effectively count from 1:
    insert!(vals, 1, nothing)
    return vals
end

e = modeller.environ()
a = modeller.alignment(e, file="TvLDH-1bdmA.ali")

template = get_profile("1bdmA.profile", get(a, "1bdmA"))
model = get_profile("TvLDH.profile", get(a, "TvLDH"))

# Plot the template and model profiles in the same plot for comparison:
figure(1, figsize=(10,6))
xlabel("Alignment position")
ylabel("DOPE per-residue score")
plot(model, color="red", linewidth=2, label="Model")
plot(template, color="green", linewidth=2, label="Template")
legend()
savefig("dope_profile.png", dpi=65)

ext: jl


text:
struct VTMResult
    fit::Any
    data::VirusLoadData
    names::Vector
    p0::Vector
    u0::Vector
end

function ViralTargetODE!(du, u, p, t)
    T, I₁, I₂, V = u
    β, k, δ, K, p, c = p
    du[1] = dT = -β*T*V
    du[2] = dI₁ = β*T*V - k*I₁
    du[3] = dI₂ = k*I₁ - δ*I₂/(K + I₂)
    du[4] = dV = p*I₂ - c*V
end

u0default = [1e+7, 75.0, 0.0, 1e-12]
lbdefault = [0.0, 0.0, 0.0, 0.0, 0.0]
ubdefault = [Inf, Inf, Inf, Inf, Inf]

function LogViralTargetModel(t, p, data, u0)
    tspan = (0.0, maximum(data.t))
    pars = (β = p[1],
            k = 4.0,
            δ = p[2],
            K = p[3],
            p = p[4],
            c = p[5])
    prob = ODEProblem(ViralTargetODE!, u0, tspan, values(pars))
    sol = solve(prob, Tsit5(), dtmax=1e-2)
    log10.(sol(t)[end, :])
end

function LogEmpiricalViralTargetModel(t, p, data, u0)
    θ = minimum(data.v)
    LogV = LogViralTargetModel(t, p, data, u0)
    max.(LogV, θ)
end

function fitVTM(data::VirusLoadData, p0::Vector; lb=lbdefault, ub=ubdefault, u0=u0default)
    model(t, p) = LogEmpiricalViralTargetModel(t, p, data, u0)
    fit = curve_fit(model, data.t, data.v, p0, lower=lb, upper=ub)
    names = ["β", "δ", "K", "p", "c"]
    VTMResult(fit, data, names, p0, u0)
end

@recipe function f(result::VTMResult; empirical=false, p0=false)
    tmin, tmax = 0.0, maximum(result.data.t)
    vmin, vmax = extrema(result.data.v)
    param = p0 ? result.fit.param : result.p0
    tt = Vector(range(tmin, tmax, step=1e-2))
    x := tt
    if empirical
        y := LogEmpiricalViralTargetModel(tt, param, result.data, result.u0)
    else
        y := LogViralTargetModel(tt, param, result.data, result.u0)
    end
    linewidth --> 4
    linestyle --> :dash
    xaxis --> ("Time (days)", (tmin, tmax))
    yaxis --> (L"\log\,V(t)", (vmin-1, vmax+1))
    grid --> :none
    label --> "Viral target model"
    ()
end

function Base.summary(result::VTMResult)
    println(@sprintf "RSS = %.5e (convergence: %s)" sum(abs2, result.fit.resid) result.fit.converged)
    CI = try
        confidence_interval(result.fit, 0.05)
    catch
        false
    end
    for i in 1:length(result.fit.param)
        name = result.names[i]
        val = result.fit.param[i]
        p0 = result.p0[i]
        if CI == false
            println(@sprintf "  %s = %.3e (initial=%.3e)" name val p0)
        else
            CIl = CI[i][1]
            CIr = CI[i][2]
            println(@sprintf "  %s = %.3e (CI=(%.3e, %.3e), initial=%.3e)" name val CIl CIr p0)
        end
    end
end


text:
export continuity

Space(d::IntervalDomain)=Chebyshev(d)

identity_fun(d::Interval)=Fun(eltype(d)[(d.b+d.a)/2,(d.b-d.a)/2],Chebyshev(d))

## Calculus

# the default domain space is higher to avoid negative ultraspherical spaces
Integral(d::IntervalDomain,n::Integer) = Integral(Ultraspherical(1,d),n)

for Func in (:DefiniteIntegral,:DefiniteLineIntegral)
    @eval begin
        $Func(d::IntervalDomain) = $Func(JacobiWeight(-.5,-.5,Chebyshev(d)))
        function $Func(α::Number,β::Number,d::IntervalDomain)
            @assert α == β
            @assert round(Int,α+.5) == α+.5
            @assert round(Int,α+.5) >= 0
            $Func(JacobiWeight(α,β,Ultraspherical(round(Int,α+.5),d)))
        end
        $Func(α::Number,β::Number) = $Func(α,β,Interval())
    end
end

## Evaluation

function continuity(d::Union{Vector,Tuple},order::Integer)

    m=length(d)
    B=zeros(Operator{mapreduce(eltype,promote_type,d)},m-1,m)

    for k=1:m-1
        B[k,k]=Evaluation(d[k],true,order)
        B[k,k+1]=-Evaluation(d[k+1],false,order)
    end
    B
end

function continuity(d::Union{Vector,Tuple},kr::UnitRange)
    @assert first(kr)==0
    m=length(d)
    B=zeros(Operator{mapreduce(eltype,promote_type,d)},length(kr)*(m-1),m)
    for r in kr
        B[(m-1)*r+1:(m-1)*(r+1),:]=continuity(d,r)
    end
    B
end

for OP in (:dirichlet,:neumann,:periodic)
    @eval $OP(d::Tuple)=$OP([d...])
end

for DT in (:IntervalDomain,:Space)
    @eval begin
        function dirichlet{T<:$DT}(d::Vector{T})
            m=length(d)
            B=zeros(Operator{mapreduce(eltype,promote_type,d)},2,m)
            B[1,1]=ldirichlet(d[1]);B[2,end]=rdirichlet(d[end])
            [B;
            continuity(d,0:1)]
        end

        function neumann{T<:$DT}(d::Vector{T})
            m=length(d)
            B=zeros(Operator{mapreduce(eltype,promote_type,d)},2,m)
            B[1,1]=ldirichlet(d[1]);B[2,end]=rdirichlet(d[end])
            [B;
            continuity(d,0:1)]
        end

        function periodic{T<:$DT}(d::Vector{T})
            m=length(d)
            B=zeros(Operator{mapreduce(eltype,promote_type,d)},2,m)
            B[1,1]=ldirichlet(d[1]);B[1,end]=-rdirichlet(d[end])
            B[2,1]=lneumann(d[1]);B[2,end]=-rneumann(d[end])
            [B;
            continuity(d,0:1)]
        end
    end
end


text:
mutable struct TunersFS
  W_star::Matrix{MCMC.TuningParam{Float64}}
  omega::Vector{MCMC.TuningParam{Float64}}
  tuners::Tuners

  TunersFS() = new()
end

function TunersFS(tuners::Tuners, s::State, X::Matrix{Float64})
  J, K = size(s.Z)
  I = length(s.y_imputed)
  W_star_tuner = [MCMC.TuningParam(1.0) for i in 1:I, k in 1:K]

  # number of covariates
  P = size(X, 2)
  omega_tuner = [MCMC.TuningParam(1.0) for p in 1:P]

  tfs = TunersFS()
  tfs.W_star = W_star_tuner
  tfs.omega = omega_tuner
  tfs.tuners = tuners

  return tfs
end


text:
module SpinMC

include("UnitCell.jl")
export UnitCell, addInteraction!, setInteractionOnsite!, setField!, addBasisSite!
include("InteractionMatrix.jl")
include("Lattice.jl")
export Lattice, size, length, getSpin, setSpin!, getSitePosition

include("Observables.jl")
export Observables
include("Spin.jl")
export getEnergy, getMagnetization, getCorrelation

include("MonteCarlo.jl")
export MonteCarlo, run!

include("Helper.jl")
include("IO.jl")
export writeMonteCarlo, readMonteCarlo

using Reexport
@reexport using BinningAnalysis

end


text:
module ARGSITER_TESTS

using Reproduce, Test, Git, FileIO

args_dict = Dict(
    "a"=>[1,2,3,4],
    "b"=>["1", "2"],
    "c"=>[("1", 103.0), ("2", 2034.0)]
)

function make_args(args::Dict{String, Union{String, Tuple}})
    ["--c1", args["c"][1],
     "--c2", args["c"][2],
     "--a", args["a"],
     "--b", args["b"]]
end

function setup_tests()
end

function reset_tests()
end

function test_args_iter()

        answer = [(1, ["--c1", "1", "--c2", "103.0", "--a", "1", "--b", "1"])
                  (2, ["--c1", "1", "--c2", "103.0", "--a", "2", "--b", "1"])
                  (3, ["--c1", "1", "--c2", "103.0", "--a", "3", "--b", "1"])
                  (4, ["--c1", "1", "--c2", "103.0", "--a", "4", "--b", "1"])
                  (5, ["--c1", "1", "--c2", "103.0", "--a", "1", "--b", "2"])
                  (6, ["--c1", "1", "--c2", "103.0", "--a", "2", "--b", "2"])
                  (7, ["--c1", "1", "--c2", "103.0", "--a", "3", "--b", "2"])
                  (8, ["--c1", "1", "--c2", "103.0", "--a", "4", "--b", "2"])
                  (9, ["--c1", "2", "--c2", "2034.0", "--a", "1", "--b", "1"])
                  (10, ["--c1", "2", "--c2", "2034.0", "--a", "2", "--b", "1"])
                  (11, ["--c1", "2", "--c2", "2034.0", "--a", "3", "--b", "1"])
                  (12, ["--c1", "2", "--c2", "2034.0", "--a", "4", "--b", "1"])
                  (13, ["--c1", "2", "--c2", "2034.0", "--a", "1", "--b", "2"])
                  (14, ["--c1", "2", "--c2", "2034.0", "--a", "2", "--b", "2"])
                  (15, ["--c1", "2", "--c2", "2034.0", "--a", "3", "--b", "2"])
                  (16, ["--c1", "2", "--c2", "2034.0", "--a", "4", "--b", "2"])]

    arg_iter = ArgIterator(args_dict, []; make_args=make_args)
    return all([answer[arg[1]] == arg for arg in arg_iter])
end

function test_args_loop()

    answer = [(1, ["--c1", "1", "--seed", "2", "--s1", "hello"]),
              (2, ["--c1", "1", "--seed", "3", "--s1", "hello"]),
              (3, ["--c1", "1", "--seed", "4", "--s1", "hello"]),
              (4, ["--c1", "1", "--seed", "5", "--s1", "hello"]),
              (5, ["--c1", "1", "--seed", "6", "--s1", "hello"]),
              (6, ["--c1", "2", "--seed", "2", "--s1", "hello"]),
              (7, ["--c1", "2", "--seed", "3", "--s1", "hello"]),
              (8, ["--c1", "2", "--seed", "4", "--s1", "hello"]),
              (9, ["--c1", "2", "--seed", "5", "--s1", "hello"]),
              (10, ["--c1", "2", "--seed", "6", "--s1", "hello"])]

    arg_loop = ArgLooper([["--c1", "1"], ["--c1", "2"]], ["--s1", "hello"], 2:6, "--seed")
    return all([answer[arg[1]] == arg for arg in arg_loop])
end

macro tests()
    @testset "ArgIterator Tests" begin
        setup_tests()
        @test test_args_iter() == true
        @test test_args_loop() == true
        reset_tests()
    end
end

end


text:
struct Spreadsheet <: AbstractVisualization
    table::Observable{SimpleTable}
end

Spreadsheet(pipelines::AbstractVector) = Spreadsheet(output(last(pipelines)))

function jsrender(session::Session, sh::Spreadsheet)
    ui = Tabular(sh.table)
    return jsrender(session, ui)
end


text:
# Digital signal plots

function PlotDigital(label_id, x::AbstractArray{T}, y::AbstractArray{T}, count::Integer, offset::Integer = 0, stride::Integer = sizeof(T)) where {T<:ImPlotData}
    ImPlot_PlotDigital(label_id, x, y, count, offset, stride)
end

function PlotDigital(label_id, x::AbstractArray{T}, y::AbstractArray{T}, count::Integer, offset::Integer = 0, stride::Integer = sizeof(T)) where {T<:Real}
    ImPlot_PlotDigital(label_id, Float64.(x), Float64.(y), count, offset, stride)
end

function PlotDigital(x::AbstractArray{T}, y::AbstractArray{T}; label_id::String = "",
                     count::Integer = min(length(x),length(y)), offset::Integer = 0,
                     stride::Integer = 1) where {T<:ImPlotData}

    ImPlot_PlotDigital(label_id, x, y, count, offset, stride * sizeof(T))
end

function PlotDigital(x::AbstractArray{T1}, y::AbstractArray{T2}; kwargs...) where {T1<:Real,T2<:Real}
    PlotDigital(promote(x,y)...; kwargs...)
end

# xfield, yfield should be propertynames of eltype(structvec)
function PlotDigital(
    structvec::Vector{T}, xfield::Symbol, yfield::Symbol;
    count::Integer = length(structvec), offset::Integer = 0,
    stride::Integer = 1, label_id::String = ""
) where T

    Tx = fieldtype(T, xfield)
    Ty = fieldtype(T, yfield)
    x_offset = fieldoffset(T, Base.fieldindex(T, xfield))
    y_offset = fieldoffset(T, Base.fieldindex(T, yfield))
    x_ptr = (pointer(structvec, 1) + x_offset) |> Ptr{Tx}
    y_ptr = (pointer(structvec, 1) + y_offset) |> Ptr{Ty}

    if !T.mutable
        # this is somewhat illegal and is used only to pass a pointer through AbstractArray argument into ccall
        x = unsafe_wrap(Vector{Tx}, x_ptr, size(structvec); own = false)
        y = unsafe_wrap(Vector{Ty}, y_ptr, size(structvec); own = false)
        stride = stride * sizeof(T)
    else # two new vectors every 1/60 second...
        x = Vector{Tx}(undef, length(structvec))
        y = Vector{Ty}(undef, length(structvec))
        for (i, val) in enumerate(structvec)
            x[i] = getproperty(val, xfield)
            y[i] = getproperty(val, yfield)
        end
        if Tx !== Ty
            x, y = promote(x, y)
        end
        stride = stride * sizeof(eltype(x))
    end

    ImPlot_PlotDigital(label_id, x, y, count, offset, stride)
end

PlotDigitalG(label_id, getter, data, count, offset=0) =
ImPlot_PlotDigitalG(label_id, getter, data, counter, offset)


text:
##############################################################################################
module TestDeSolvers
##############################################################################################
##############################################################################################
# imports and exports
using DataAssimilationBenchmarks.DeSolvers, DataAssimilationBenchmarks.L96
using LsqFit

##############################################################################################
##############################################################################################
# Define test function for analytical verification of discretization error
VecA = Union{Vector{Float64}, SubArray{Float64, 1}}
ParamDict = Union{Dict{String, Array{Float64}}, Dict{String, Vector{Float64}}}

##############################################################################################
##############################################################################################

function exponentialODE(x::T, t::Float64, dx_params::ParamDict) where {T <: VecA}
    # Wrapper for making a vector form of the exponential function for the DE solvers
    [exp(t)]
end

##############################################################################################
# Define auxiliary function to compute the difference of the simulated integral versus
# the analytical value

function expDiscretizationError(step_model!, h)
    # continuous time length of the integration
    tanl = 0.1

    # discrete integration steps
    fore_steps = convert(Int64, tanl/h)
    time_steps = LinRange(0, tanl, fore_steps + 1)

    # initial data for the exponential function
    x = [1.0]

    # set the kwargs for the integration scheme
    # with empty values for the uneccessary parameters
    diffusion = 0.0
    dx_params = Dict{String, Array{Float64}}()
    kwargs = Dict{String, Any}(
            "h" => h,
            "diffusion" => diffusion,
            "dx_params" => dx_params,
            "dx_dt" => exponentialODE,
            )
    for i in 1:fore_steps
        step_model!(x, time_steps[i], kwargs)
    end

    # find the absolute difference of the apprximate integral from the built-in exponential
    abs(x[1] - exp(tanl))
end

##############################################################################################
# Define auxiliary function to compute the least-squares estimated order of convergence

function calculateOrderConvergence(step_model!)
    # set step sizes in increasing order for log-10 log-10 analysis
    h_range = [0.005, 0.01, 0.05, 0.1]
    error_range = Vector{Float64}(undef, length(h_range))

    # loop the discretization and calculate the errors
    for i in 1:length(h_range)
        error_range[i] = expDiscretizationError(step_model!, h_range[i])
    end

    # convert the error and the step sizes to log-10
    h_range_log10 = log10.(h_range)
    error_range_log10 = log10.(error_range)

    function model_lsq_squares(x,p)
        # define a function object to vary parameters p
        @. p[1] + p[2]*x
    end

    # fit the best-fit line and return coefficients
    fit = curve_fit(model_lsq_squares, h_range_log10, error_range_log10, [1.0, 1.0])
    coef(fit)
end

##############################################################################################
# Wrapper function to be supplied to runtests

function testEMExponential()
    coef = calculateOrderConvergence(em_step!)

    if abs(coef[2] - 1.0) > 0.1
        false
    else
        true
    end
end

##############################################################################################
# Wrapper function to be supplied to runtests

function testRKExponential()
    coef = calculateOrderConvergence(rk4_step!)

    if abs(coef[2] - 4.0) > 0.1
        false
    else
        true
    end
end

##############################################################################################
# end module

end

max_stars_repo_name: sukhreens/DataAssimilationBenchmarks

max_issues_repo_name: sukhreens/DataAssimilationBenchmarks

max_forks_repo_name: sukhreens/DataAssimilationBenchmarks


text:
module DockerUtils

import HTTP
import JSON

export check_if_docker_installed
export install_docker
export check_if_snap_installed

function check_installation(program::String)
  print("Checking if $program is installed...")
  command = Cmd(`which $program`, ignorestatus=true)
  output = try
    read(command, String)
  catch e
    dump(e)
    ""
  end

  is_installed = output != ""
  println(is_installed ? "installed" : "not installed")
  is_installed
end

function check_if_docker_installed()
  check_installation("docker")
end

function check_if_snap_installed()
  check_installation("snap")
end

function install_docker()
  # TODO: Don't do this in production mode
  print("Docker is not currently installed.  Would you like to install it now? (y/n): ")
  do_install = false
  while true
    answer = readline()
    answer = lowercase(answer)
    if answer == "yes" || answer == "y"
      do_install = true
      break
    elseif answer == "no" || answer == "n"
      do_install = false
      break
    else
      print("Please enter y or n")
    end
  end

  if !do_install
    println("Skipping docker installation")
    return false
  end

  println("Docker will be installed")
  if !check_if_snap_installed()
    println("Automatic docker cannot be performed")
    if Sys.KERNEL == :Linux
      println("The recommended method for installing docker on Linux is to use snap.")
      println("Go to https://snapcraft.io/docs/installing-snapd for instructions on how to install snap and run this command again.")
    else
      println("Visit https://docs.docker.com/install/ for instructions on how to install the docker engine on your system")
    end

    return false
  end

  command = Cmd(`sudo snap install docker`)
  try
    read(command, String)
  catch e
    println("The docker installation failed")
    return false
  end

  true
end

end # module


text:
using DataStructures

mutable struct Node
    id::Int
    neighbours::Array{Node}
    color::Union{String, Nothing}
    distance::Union{Int, Nothing}
    predecessor::Union{Node, Nothing}
end
Node(id) = Node(id, [], nothing, nothing, nothing)

function makenodelist(adjlist::Array)::Array{Node, 1}
	ret::Array{Node, 1} = Array{Node, 1}(undef, length(adjlist))

	for i in 1 : length(adjlist)
		ret[i] = Node(i)
	end

	for i in 1 : length(adjlist)
		for j in adjlist[i]
			push!(ret[i].neighbours, ret[j])
		end
	end

	return ret
end

function isgoalnode(node::Node)::Bool
	return node.id == 8
end

function bfs!(nodes::Array{Node, 1}, start::Node)::Union{Node, Nothing}
	que::Queue{Node} = Queue{Node}()

	for i in nodes
		i.color = "white"
	end

	enqueue!(que, start)
	start.color = "gray"
	start.distance = 0

	while length(que) > 0
		cur_node = dequeue!(que)
		if cur_node.predecessor != nothing
			cur_node.distance = cur_node.predecessor.distance + 1
		end

		if isgoalnode(cur_node)
			return cur_node
		end

		for i in cur_node.neighbours
			if i.color == "white"
				enqueue!(que, i)
				i.predecessor = cur_node
				i.color = "gray"
			end
		end

		cur_node.color = "black"
	end

	return nothing
end

function makepathto(goalnode::Node)::Array{Int, 1}
	ret::Array{Int, 1} = [goalnode.id]

	while goalnode.predecessor != nothing
		goalnode = goalnode.predecessor
		push!(ret, goalnode.id)
	end
	reverse!(ret)
	return ret
end


text:
#using Plots

#pyplot()

#=function plottest()
    test02 = cmf(CMF2012_2)
    res02  = convert(CIE12_2,cmf(LMS2006_10))
    test10 = cmf(CMF2012_10)
    res10  = convert(CIE12_10,cmf(LMS2006_10))

    println(sqrt(maximum((delta1).^2)))
    println(sqrt(maximum((delta2).^2)))
    println(sqrt(maximum((delta3).^2)))
end
=#


text:
"""
    mutable struct FloryInteraction <: AbstractInteraction

An interaction representing a Flory-Huggins ``\\chi``-interaction between different monomer types.

The interaction energy has the form:
``H_{int} = (1/2) ∑_i ∑_j χ_{ij} ∫dr ϕ_i(r) ϕ_j(r)``
"""
mutable struct FloryInteraction <: AbstractInteraction
    mids   :: Set{Int}
    chis   :: Dict{NTuple{2,Int}, Float64}
    system :: Option{FieldSystem}
    FloryInteraction() = new(Set(), Dict(), nothing)
end

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

Base.show(io::IO, itx::FloryInteraction) = @printf(io, "FloryInteraction(%d monomers, %s pairs)", length(itx.mids), length(itx.chis))

function setup!(itx::FloryInteraction, sys::FieldSystem)
    itx.system = sys
    return nothing
end

function set_interaction!(itx::FloryInteraction, alpha::Integer, beta::Integer, chi::Real)
    @assert alpha != beta
    pair = ordered_pair(alpha, beta)
    if haskey(itx.chis, pair)
        @warn "Replacing interaction for monomer pair with IDs = $(pair)."
    end

    push!(itx.mids, alpha)
    push!(itx.mids, beta)
    itx.chis[pair] = chi

    return nothing
end

function energy(itx::FloryInteraction)
    @assert !isnothing(itx.system)
    sys = itx.system

    energy = 0.0
    for (pair, chi) in itx.chis
        alpha, beta = pair
        if hasmonomer(sys, alpha) && hasmonomer(sys, beta)
            va = sys.monomers[alpha].vol
            vb = sys.monomers[beta].vol
            rho_alpha = sys.density[alpha]
            rho_beta = sys.density[beta]

            @simd for i in eachindex(rho_alpha)
                @inbounds energy += chi * (rho_alpha[i] / va) * (rho_beta[i] / vb)
            end
        end
    end

    return energy / ngrid(sys)
end

function energy_bulk(itx::FloryInteraction)
    @assert !isnothing(itx.system)
    sys = itx.system
    monomers = sys.monomers

    energy = 0.0
    for (pair, chi) in itx.chis
        alpha, beta = pair
        if hasmonomer(sys, alpha) && hasmonomer(sys, beta)
            va = monomers[alpha].vol
            vb = monomers[beta].vol
            rho_alpha = sys.monomer_fracs[alpha]
            rho_beta = sys.monomer_fracs[beta]

            energy += chi * (rho_alpha / va) * (rho_beta / vb)
        end
    end

    return energy
end

function potential!(itx::FloryInteraction, alpha::Integer, pot::FieldGrid)
    @assert !isnothing(itx.system)
    sys = itx.system

    for beta in itx.mids
        pair = ordered_pair(alpha, beta)
        if !haskey(itx.chis, pair); continue; end
        chi = itx.chis[pair]

        rho_beta = sys.density[beta]
        vb = sys.monomers[beta].vol

        @simd for i in eachindex(pot)
            @inbounds pot[i] += chi * (rho_beta[i] / vb)
        end
    end

    return nothing
end


text:
module GabeUtils

include("workarounds.jl")
export seq, idmatrix

end