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

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

Creates a device pool.

# Required Parameters
- `name`: The device pool's name.
- `projectArn`: The ARN of the project for the device pool.
- `rules`: The device pool's rules.

# Optional Parameters
- `description`: The device pool's description.
- `maxDevices`: The number of devices that Device Farm can add to your device pool. Device Farm adds devices that are available and meet the criteria that you assign for the rules parameter. Depending on how many devices meet these constraints, your device pool might contain fewer devices than the value for this parameter. By specifying the maximum number of devices, you can control the costs that you incur by running tests.
"""

create_device_pool(name, projectArn, rules; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateDevicePool", Dict{String, Any}("name"=>name, "projectArn"=>projectArn, "rules"=>rules); aws_config=aws_config)
create_device_pool(name, projectArn, rules, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateDevicePool", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("name"=>name, "projectArn"=>projectArn, "rules"=>rules), args)); aws_config=aws_config)

"""
    CreateInstanceProfile()

Creates a profile that can be applied to one or more private fleet device instances.

# Required Parameters
- `name`: The name of your instance profile.

# Optional Parameters
- `description`: The description of your instance profile.
- `excludeAppPackagesFromCleanup`: An array of strings that specifies the list of app packages that should not be cleaned up from the device after a test run. The list of packages is considered only if you set packageCleanup to true.
- `packageCleanup`: When set to true, Device Farm removes app packages after a test run. The default value is false for private devices.
- `rebootAfterUse`: When set to true, Device Farm reboots the instance after a test run. The default value is true.
"""

create_instance_profile(name; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateInstanceProfile", Dict{String, Any}("name"=>name); aws_config=aws_config)
create_instance_profile(name, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateInstanceProfile", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("name"=>name), args)); aws_config=aws_config)

"""
    CreateNetworkProfile()

Creates a network profile.

# Required Parameters
- `name`: The name for the new network profile.
- `projectArn`: The Amazon Resource Name (ARN) of the project for which you want to create a network profile.

# Optional Parameters
- `description`: The description of the network profile.
- `downlinkBandwidthBits`: The data throughput rate in bits per second, as an integer from 0 to 104857600.
- `downlinkDelayMs`: Delay time for all packets to destination in milliseconds as an integer from 0 to 2000.
- `downlinkJitterMs`: Time variation in the delay of received packets in milliseconds as an integer from 0 to 2000.
- `downlinkLossPercent`: Proportion of received packets that fail to arrive from 0 to 100 percent.
- `type`: The type of network profile to create. Valid values are listed here.
- `uplinkBandwidthBits`: The data throughput rate in bits per second, as an integer from 0 to 104857600.
- `uplinkDelayMs`: Delay time for all packets to destination in milliseconds as an integer from 0 to 2000.
- `uplinkJitterMs`: Time variation in the delay of received packets in milliseconds as an integer from 0 to 2000.
- `uplinkLossPercent`: Proportion of transmitted packets that fail to arrive from 0 to 100 percent.
"""

create_network_profile(name, projectArn; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateNetworkProfile", Dict{String, Any}("name"=>name, "projectArn"=>projectArn); aws_config=aws_config)
create_network_profile(name, projectArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateNetworkProfile", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("name"=>name, "projectArn"=>projectArn), args)); aws_config=aws_config)

"""
    CreateProject()

Creates a project.

# Required Parameters
- `name`: The project's name.

# Optional Parameters
- `defaultJobTimeoutMinutes`: Sets the execution timeout value (in minutes) for a project. All test runs in this project use the specified execution timeout value unless overridden when scheduling a run.
"""

create_project(name; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateProject", Dict{String, Any}("name"=>name); aws_config=aws_config)
create_project(name, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateProject", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("name"=>name), args)); aws_config=aws_config)

"""
    CreateRemoteAccessSession()

Specifies and starts a remote access session.

# Required Parameters
- `deviceArn`: The ARN of the device for which you want to create a remote access session.
- `projectArn`: The Amazon Resource Name (ARN) of the project for which you want to create a remote access session.

# Optional Parameters
- `clientId`: Unique identifier for the client. If you want access to multiple devices on the same client, you should pass the same clientId value in each call to CreateRemoteAccessSession. This identifier is required only if remoteDebugEnabled is set to true. Remote debugging is no longer supported.
- `configuration`: The configuration information for the remote access session request.
- `instanceArn`: The Amazon Resource Name (ARN) of the device instance for which you want to create a remote access session.
- `interactionMode`: The interaction mode of the remote access session. Valid values are:   INTERACTIVE: You can interact with the iOS device by viewing, touching, and rotating the screen. You cannot run XCUITest framework-based tests in this mode.   NO_VIDEO: You are connected to the device, but cannot interact with it or view the screen. This mode has the fastest test execution speed. You can run XCUITest framework-based tests in this mode.   VIDEO_ONLY: You can view the screen, but cannot touch or rotate it. You can run XCUITest framework-based tests and watch the screen in this mode.
- `name`: The name of the remote access session to create.
- `remoteDebugEnabled`: Set to true if you want to access devices remotely for debugging in your remote access session. Remote debugging is no longer supported.
- `remoteRecordAppArn`: The Amazon Resource Name (ARN) for the app to be recorded in the remote access session.
- `remoteRecordEnabled`: Set to true to enable remote recording for the remote access session.
- `skipAppResign`: When set to true, for private devices, Device Farm does not sign your app again. For public devices, Device Farm always signs your apps again. For more information on how Device Farm modifies your uploads during tests, see Do you modify my app?
- `sshPublicKey`: Ignored. The public key of the ssh key pair you want to use for connecting to remote devices in your remote debugging session. This key is required only if remoteDebugEnabled is set to true. Remote debugging is no longer supported.
"""

create_remote_access_session(deviceArn, projectArn; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateRemoteAccessSession", Dict{String, Any}("deviceArn"=>deviceArn, "projectArn"=>projectArn); aws_config=aws_config)
create_remote_access_session(deviceArn, projectArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateRemoteAccessSession", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("deviceArn"=>deviceArn, "projectArn"=>projectArn), args)); aws_config=aws_config)

"""
    CreateTestGridProject()

Creates a Selenium testing project. Projects are used to track TestGridSession instances.

# Required Parameters
- `name`: Human-readable name of the Selenium testing project.

# Optional Parameters
- `description`: Human-readable description of the project.
"""

create_test_grid_project(name; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateTestGridProject", Dict{String, Any}("name"=>name); aws_config=aws_config)
create_test_grid_project(name, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateTestGridProject", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("name"=>name), args)); aws_config=aws_config)

"""
    CreateTestGridUrl()

Creates a signed, short-term URL that can be passed to a Selenium RemoteWebDriver constructor.

# Required Parameters
- `expiresInSeconds`: Lifetime, in seconds, of the URL.
- `projectArn`: ARN (from CreateTestGridProject or ListTestGridProjects) to associate with the short-term URL.

"""

create_test_grid_url(expiresInSeconds, projectArn; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateTestGridUrl", Dict{String, Any}("expiresInSeconds"=>expiresInSeconds, "projectArn"=>projectArn); aws_config=aws_config)
create_test_grid_url(expiresInSeconds, projectArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateTestGridUrl", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("expiresInSeconds"=>expiresInSeconds, "projectArn"=>projectArn), args)); aws_config=aws_config)

"""
    CreateUpload()

Uploads an app or test scripts.

# Required Parameters
- `name`: The upload's file name. The name should not contain any forward slashes (/). If you are uploading an iOS app, the file name must end with the .ipa extension. If you are uploading an Android app, the file name must end with the .apk extension. For all others, the file name must end with the .zip file extension.
- `projectArn`: The ARN of the project for the upload.
- `type`: The upload's upload type. Must be one of the following values:   ANDROID_APP   IOS_APP   WEB_APP   EXTERNAL_DATA   APPIUM_JAVA_JUNIT_TEST_PACKAGE   APPIUM_JAVA_TESTNG_TEST_PACKAGE   APPIUM_PYTHON_TEST_PACKAGE   APPIUM_NODE_TEST_PACKAGE   APPIUM_RUBY_TEST_PACKAGE   APPIUM_WEB_JAVA_JUNIT_TEST_PACKAGE   APPIUM_WEB_JAVA_TESTNG_TEST_PACKAGE   APPIUM_WEB_PYTHON_TEST_PACKAGE   APPIUM_WEB_NODE_TEST_PACKAGE   APPIUM_WEB_RUBY_TEST_PACKAGE   CALABASH_TEST_PACKAGE   INSTRUMENTATION_TEST_PACKAGE   UIAUTOMATION_TEST_PACKAGE   UIAUTOMATOR_TEST_PACKAGE   XCTEST_TEST_PACKAGE   XCTEST_UI_TEST_PACKAGE   APPIUM_JAVA_JUNIT_TEST_SPEC   APPIUM_JAVA_TESTNG_TEST_SPEC   APPIUM_PYTHON_TEST_SPEC   APPIUM_NODE_TEST_SPEC   APPIUM_RUBY_TEST_SPEC   APPIUM_WEB_JAVA_JUNIT_TEST_SPEC   APPIUM_WEB_JAVA_TESTNG_TEST_SPEC   APPIUM_WEB_PYTHON_TEST_SPEC   APPIUM_WEB_NODE_TEST_SPEC   APPIUM_WEB_RUBY_TEST_SPEC   INSTRUMENTATION_TEST_SPEC   XCTEST_UI_TEST_SPEC    If you call CreateUpload with WEB_APP specified, AWS Device Farm throws an ArgumentException error.

# Optional Parameters
- `contentType`: The upload's content type (for example, application/octet-stream).
"""

create_upload(name, projectArn, type; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateUpload", Dict{String, Any}("name"=>name, "projectArn"=>projectArn, "type"=>type); aws_config=aws_config)
create_upload(name, projectArn, type, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateUpload", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("name"=>name, "projectArn"=>projectArn, "type"=>type), args)); aws_config=aws_config)

"""
    CreateVPCEConfiguration()

Creates a configuration record in Device Farm for your Amazon Virtual Private Cloud (VPC) endpoint.

# Required Parameters
- `serviceDnsName`: The DNS name of the service running in your VPC that you want Device Farm to test.
- `vpceConfigurationName`: The friendly name you give to your VPC endpoint configuration, to manage your configurations more easily.
- `vpceServiceName`: The name of the VPC endpoint service running in your AWS account that you want Device Farm to test.

# Optional Parameters
- `vpceConfigurationDescription`: An optional description that provides details about your VPC endpoint configuration.
"""

create_vpceconfiguration(serviceDnsName, vpceConfigurationName, vpceServiceName; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateVPCEConfiguration", Dict{String, Any}("serviceDnsName"=>serviceDnsName, "vpceConfigurationName"=>vpceConfigurationName, "vpceServiceName"=>vpceServiceName); aws_config=aws_config)
create_vpceconfiguration(serviceDnsName, vpceConfigurationName, vpceServiceName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("CreateVPCEConfiguration", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("serviceDnsName"=>serviceDnsName, "vpceConfigurationName"=>vpceConfigurationName, "vpceServiceName"=>vpceServiceName), args)); aws_config=aws_config)

"""
    DeleteDevicePool()

Deletes a device pool given the pool ARN. Does not allow deletion of curated pools owned by the system.

# Required Parameters
- `arn`: Represents the Amazon Resource Name (ARN) of the Device Farm device pool to delete.

"""

delete_device_pool(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteDevicePool", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
delete_device_pool(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteDevicePool", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    DeleteInstanceProfile()

Deletes a profile that can be applied to one or more private device instances.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the instance profile you are requesting to delete.

"""

delete_instance_profile(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteInstanceProfile", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
delete_instance_profile(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteInstanceProfile", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    DeleteNetworkProfile()

Deletes a network profile.

# Required Parameters
- `arn`: The ARN of the network profile to delete.

"""

delete_network_profile(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteNetworkProfile", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
delete_network_profile(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteNetworkProfile", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    DeleteProject()

Deletes an AWS Device Farm project, given the project ARN.  Deleting this resource does not stop an in-progress run.

# Required Parameters
- `arn`: Represents the Amazon Resource Name (ARN) of the Device Farm project to delete.

"""

delete_project(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteProject", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
delete_project(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteProject", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    DeleteRemoteAccessSession()

Deletes a completed remote access session and its results.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the session for which you want to delete remote access.

"""

delete_remote_access_session(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteRemoteAccessSession", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
delete_remote_access_session(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteRemoteAccessSession", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    DeleteRun()

Deletes the run, given the run ARN.  Deleting this resource does not stop an in-progress run.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) for the run to delete.

"""

delete_run(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteRun", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
delete_run(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteRun", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    DeleteTestGridProject()

 Deletes a Selenium testing project and all content generated under it.   You cannot undo this operation.   You cannot delete a project if it has active sessions.

# Required Parameters
- `projectArn`: The ARN of the project to delete, from CreateTestGridProject or ListTestGridProjects.

"""

delete_test_grid_project(projectArn; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteTestGridProject", Dict{String, Any}("projectArn"=>projectArn); aws_config=aws_config)
delete_test_grid_project(projectArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteTestGridProject", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("projectArn"=>projectArn), args)); aws_config=aws_config)

"""
    DeleteUpload()

Deletes an upload given the upload ARN.

# Required Parameters
- `arn`: Represents the Amazon Resource Name (ARN) of the Device Farm upload to delete.

"""

delete_upload(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteUpload", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
delete_upload(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteUpload", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    DeleteVPCEConfiguration()

Deletes a configuration for your Amazon Virtual Private Cloud (VPC) endpoint.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the VPC endpoint configuration you want to delete.

"""

delete_vpceconfiguration(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteVPCEConfiguration", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
delete_vpceconfiguration(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("DeleteVPCEConfiguration", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    GetAccountSettings()

Returns the number of unmetered iOS or unmetered Android devices that have been purchased by the account.

"""

get_account_settings(; aws_config::AWSConfig=global_aws_config()) = device_farm("GetAccountSettings"; aws_config=aws_config)
get_account_settings(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetAccountSettings", args; aws_config=aws_config)

"""
    GetDevice()

Gets information about a unique device type.

# Required Parameters
- `arn`: The device type's ARN.

"""

get_device(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetDevice", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
get_device(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetDevice", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    GetDeviceInstance()

Returns information about a device instance that belongs to a private device fleet.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the instance you're requesting information about.

"""

get_device_instance(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetDeviceInstance", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
get_device_instance(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetDeviceInstance", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    GetDevicePool()

Gets information about a device pool.

# Required Parameters
- `arn`: The device pool's ARN.

"""

get_device_pool(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetDevicePool", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
get_device_pool(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetDevicePool", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    GetDevicePoolCompatibility()

Gets information about compatibility with a device pool.

# Required Parameters
- `devicePoolArn`: The device pool's ARN.

# Optional Parameters
- `appArn`: The ARN of the app that is associated with the specified device pool.
- `configuration`: An object that contains information about the settings for a run.
- `test`: Information about the uploaded test to be run against the device pool.
- `testType`: The test type for the specified device pool. Allowed values include the following:   BUILTIN_FUZZ.   BUILTIN_EXPLORER. For Android, an app explorer that traverses an Android app, interacting with it and capturing screenshots at the same time.   APPIUM_JAVA_JUNIT.   APPIUM_JAVA_TESTNG.   APPIUM_PYTHON.   APPIUM_NODE.   APPIUM_RUBY.   APPIUM_WEB_JAVA_JUNIT.   APPIUM_WEB_JAVA_TESTNG.   APPIUM_WEB_PYTHON.   APPIUM_WEB_NODE.   APPIUM_WEB_RUBY.   CALABASH.   INSTRUMENTATION.   UIAUTOMATION.   UIAUTOMATOR.   XCTEST.   XCTEST_UI.
"""

get_device_pool_compatibility(devicePoolArn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetDevicePoolCompatibility", Dict{String, Any}("devicePoolArn"=>devicePoolArn); aws_config=aws_config)
get_device_pool_compatibility(devicePoolArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetDevicePoolCompatibility", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("devicePoolArn"=>devicePoolArn), args)); aws_config=aws_config)

"""
    GetInstanceProfile()

Returns information about the specified instance profile.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of an instance profile.

"""

get_instance_profile(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetInstanceProfile", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
get_instance_profile(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetInstanceProfile", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    GetJob()

Gets information about a job.

# Required Parameters
- `arn`: The job's ARN.

"""

get_job(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetJob", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
get_job(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    GetNetworkProfile()

Returns information about a network profile.

# Required Parameters
- `arn`: The ARN of the network profile to return information about.

"""

get_network_profile(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetNetworkProfile", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
get_network_profile(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetNetworkProfile", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    GetOfferingStatus()

Gets the current status and future status of all offerings purchased by an AWS account. The response indicates how many offerings are currently available and the offerings that will be available in the next period. The API returns a NotEligible error if the user is not permitted to invoke the operation. If you must be able to invoke this operation, contact aws-devicefarm-support@amazon.com.

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

get_offering_status(; aws_config::AWSConfig=global_aws_config()) = device_farm("GetOfferingStatus"; aws_config=aws_config)
get_offering_status(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetOfferingStatus", args; aws_config=aws_config)

"""
    GetProject()

Gets information about a project.

# Required Parameters
- `arn`: The project's ARN.

"""

get_project(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetProject", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
get_project(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetProject", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    GetRemoteAccessSession()

Returns a link to a currently running remote access session.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the remote access session about which you want to get session information.

"""

get_remote_access_session(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetRemoteAccessSession", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
get_remote_access_session(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetRemoteAccessSession", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    GetRun()

Gets information about a run.

# Required Parameters
- `arn`: The run's ARN.

"""

get_run(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetRun", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
get_run(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetRun", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    GetSuite()

Gets information about a suite.

# Required Parameters
- `arn`: The suite's ARN.

"""

get_suite(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetSuite", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
get_suite(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetSuite", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    GetTest()

Gets information about a test.

# Required Parameters
- `arn`: The test's ARN.

"""

get_test(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetTest", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
get_test(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetTest", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    GetTestGridProject()

Retrieves information about a Selenium testing project.

# Required Parameters
- `projectArn`: The ARN of the Selenium testing project, from either CreateTestGridProject or ListTestGridProjects.

"""

get_test_grid_project(projectArn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetTestGridProject", Dict{String, Any}("projectArn"=>projectArn); aws_config=aws_config)
get_test_grid_project(projectArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetTestGridProject", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("projectArn"=>projectArn), args)); aws_config=aws_config)

"""
    GetTestGridSession()

A session is an instance of a browser created through a RemoteWebDriver with the URL from CreateTestGridUrlResulturl. You can use the following to look up sessions:   The session ARN (GetTestGridSessionRequestsessionArn).   The project ARN and a session ID (GetTestGridSessionRequestprojectArn and GetTestGridSessionRequestsessionId).

# Optional Parameters
- `projectArn`: The ARN for the project that this session belongs to. See CreateTestGridProject and ListTestGridProjects.
- `sessionArn`: An ARN that uniquely identifies a TestGridSession.
- `sessionId`: An ID associated with this session.
"""

get_test_grid_session(; aws_config::AWSConfig=global_aws_config()) = device_farm("GetTestGridSession"; aws_config=aws_config)
get_test_grid_session(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetTestGridSession", args; aws_config=aws_config)

"""
    GetUpload()

Gets information about an upload.

# Required Parameters
- `arn`: The upload's ARN.

"""

get_upload(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetUpload", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
get_upload(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetUpload", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    GetVPCEConfiguration()

Returns information about the configuration settings for your Amazon Virtual Private Cloud (VPC) endpoint.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the VPC endpoint configuration you want to describe.

"""

get_vpceconfiguration(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("GetVPCEConfiguration", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
get_vpceconfiguration(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("GetVPCEConfiguration", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    InstallToRemoteAccessSession()

Installs an application to the device in a remote access session. For Android applications, the file must be in .apk format. For iOS applications, the file must be in .ipa format.

# Required Parameters
- `appArn`: The ARN of the app about which you are requesting information.
- `remoteAccessSessionArn`: The Amazon Resource Name (ARN) of the remote access session about which you are requesting information.

"""

install_to_remote_access_session(appArn, remoteAccessSessionArn; aws_config::AWSConfig=global_aws_config()) = device_farm("InstallToRemoteAccessSession", Dict{String, Any}("appArn"=>appArn, "remoteAccessSessionArn"=>remoteAccessSessionArn); aws_config=aws_config)
install_to_remote_access_session(appArn, remoteAccessSessionArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("InstallToRemoteAccessSession", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("appArn"=>appArn, "remoteAccessSessionArn"=>remoteAccessSessionArn), args)); aws_config=aws_config)

"""
    ListArtifacts()

Gets information about artifacts.

# Required Parameters
- `arn`: The run, job, suite, or test ARN.
- `type`: The artifacts' type. Allowed values include:   FILE   LOG   SCREENSHOT

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_artifacts(arn, type; aws_config::AWSConfig=global_aws_config()) = device_farm("ListArtifacts", Dict{String, Any}("arn"=>arn, "type"=>type); aws_config=aws_config)
list_artifacts(arn, type, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListArtifacts", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn, "type"=>type), args)); aws_config=aws_config)

"""
    ListDeviceInstances()

Returns information about the private device instances associated with one or more AWS accounts.

# Optional Parameters
- `maxResults`: An integer that specifies the maximum number of items you want to return in the API response.
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_device_instances(; aws_config::AWSConfig=global_aws_config()) = device_farm("ListDeviceInstances"; aws_config=aws_config)
list_device_instances(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListDeviceInstances", args; aws_config=aws_config)

"""
    ListDevicePools()

Gets information about device pools.

# Required Parameters
- `arn`: The project ARN.

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
- `type`: The device pools' type. Allowed values include:   CURATED: A device pool that is created and managed by AWS Device Farm.   PRIVATE: A device pool that is created and managed by the device pool developer.
"""

list_device_pools(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("ListDevicePools", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
list_device_pools(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListDevicePools", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    ListDevices()

Gets information about unique device types.

# Optional Parameters
- `arn`: The Amazon Resource Name (ARN) of the project.
- `filters`: Used to select a set of devices. A filter is made up of an attribute, an operator, and one or more values.   Attribute: The aspect of a device such as platform or model used as the selection criteria in a device filter. Allowed values include:   ARN: The Amazon Resource Name (ARN) of the device (for example, arn:aws:devicefarm:us-west-2::device:12345Example).   PLATFORM: The device platform. Valid values are ANDROID or IOS.   OS_VERSION: The operating system version (for example, 10.3.2).   MODEL: The device model (for example, iPad 5th Gen).   AVAILABILITY: The current availability of the device. Valid values are AVAILABLE, HIGHLY_AVAILABLE, BUSY, or TEMPORARY_NOT_AVAILABLE.   FORM_FACTOR: The device form factor. Valid values are PHONE or TABLET.   MANUFACTURER: The device manufacturer (for example, Apple).   REMOTE_ACCESS_ENABLED: Whether the device is enabled for remote access. Valid values are TRUE or FALSE.   REMOTE_DEBUG_ENABLED: Whether the device is enabled for remote debugging. Valid values are TRUE or FALSE. Because remote debugging is no longer supported, this attribute is ignored.   INSTANCE_ARN: The Amazon Resource Name (ARN) of the device instance.   INSTANCE_LABELS: The label of the device instance.   FLEET_TYPE: The fleet type. Valid values are PUBLIC or PRIVATE.     Operator: The filter operator.   The EQUALS operator is available for every attribute except INSTANCE_LABELS.   The CONTAINS operator is available for the INSTANCE_LABELS and MODEL attributes.   The IN and NOT_IN operators are available for the ARN, OS_VERSION, MODEL, MANUFACTURER, and INSTANCE_ARN attributes.   The LESS_THAN, GREATER_THAN, LESS_THAN_OR_EQUALS, and GREATER_THAN_OR_EQUALS operators are also available for the OS_VERSION attribute.     Values: An array of one or more filter values.   The IN and NOT_IN operators take a values array that has one or more elements.   The other operators require an array with a single element.   In a request, the AVAILABILITY attribute takes the following values: AVAILABLE, HIGHLY_AVAILABLE, BUSY, or TEMPORARY_NOT_AVAILABLE.
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_devices(; aws_config::AWSConfig=global_aws_config()) = device_farm("ListDevices"; aws_config=aws_config)
list_devices(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListDevices", args; aws_config=aws_config)

"""
    ListInstanceProfiles()

Returns information about all the instance profiles in an AWS account.

# Optional Parameters
- `maxResults`: An integer that specifies the maximum number of items you want to return in the API response.
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_instance_profiles(; aws_config::AWSConfig=global_aws_config()) = device_farm("ListInstanceProfiles"; aws_config=aws_config)
list_instance_profiles(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListInstanceProfiles", args; aws_config=aws_config)

"""
    ListJobs()

Gets information about jobs for a given test run.

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

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_jobs(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("ListJobs", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
list_jobs(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListJobs", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    ListNetworkProfiles()

Returns the list of available network profiles.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the project for which you want to list network profiles.

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
- `type`: The type of network profile to return information about. Valid values are listed here.
"""

list_network_profiles(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("ListNetworkProfiles", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
list_network_profiles(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListNetworkProfiles", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    ListOfferingPromotions()

Returns a list of offering promotions. Each offering promotion record contains the ID and description of the promotion. The API returns a NotEligible error if the caller is not permitted to invoke the operation. Contact aws-devicefarm-support@amazon.com if you must be able to invoke this operation.

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_offering_promotions(; aws_config::AWSConfig=global_aws_config()) = device_farm("ListOfferingPromotions"; aws_config=aws_config)
list_offering_promotions(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListOfferingPromotions", args; aws_config=aws_config)

"""
    ListOfferingTransactions()

Returns a list of all historical purchases, renewals, and system renewal transactions for an AWS account. The list is paginated and ordered by a descending timestamp (most recent transactions are first). The API returns a NotEligible error if the user is not permitted to invoke the operation. If you must be able to invoke this operation, contact aws-devicefarm-support@amazon.com.

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_offering_transactions(; aws_config::AWSConfig=global_aws_config()) = device_farm("ListOfferingTransactions"; aws_config=aws_config)
list_offering_transactions(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListOfferingTransactions", args; aws_config=aws_config)

"""
    ListOfferings()

Returns a list of products or offerings that the user can manage through the API. Each offering record indicates the recurring price per unit and the frequency for that offering. The API returns a NotEligible error if the user is not permitted to invoke the operation. If you must be able to invoke this operation, contact aws-devicefarm-support@amazon.com.

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_offerings(; aws_config::AWSConfig=global_aws_config()) = device_farm("ListOfferings"; aws_config=aws_config)
list_offerings(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListOfferings", args; aws_config=aws_config)

"""
    ListProjects()

Gets information about projects.

# Optional Parameters
- `arn`: Optional. If no Amazon Resource Name (ARN) is specified, then AWS Device Farm returns a list of all projects for the AWS account. You can also specify a project ARN.
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_projects(; aws_config::AWSConfig=global_aws_config()) = device_farm("ListProjects"; aws_config=aws_config)
list_projects(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListProjects", args; aws_config=aws_config)

"""
    ListRemoteAccessSessions()

Returns a list of all currently running remote access sessions.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the project about which you are requesting information.

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_remote_access_sessions(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("ListRemoteAccessSessions", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
list_remote_access_sessions(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListRemoteAccessSessions", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    ListRuns()

Gets information about runs, given an AWS Device Farm project ARN.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the project for which you want to list runs.

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_runs(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("ListRuns", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
list_runs(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListRuns", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    ListSamples()

Gets information about samples, given an AWS Device Farm job ARN.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the job used to list samples.

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_samples(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("ListSamples", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
list_samples(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListSamples", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    ListSuites()

Gets information about test suites for a given job.

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

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_suites(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("ListSuites", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
list_suites(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListSuites", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    ListTagsForResource()

List the tags for an AWS Device Farm resource.

# Required Parameters
- `ResourceARN`: The Amazon Resource Name (ARN) of the resource or resources for which to list tags. You can associate tags with the following Device Farm resources: PROJECT, RUN, NETWORK_PROFILE, INSTANCE_PROFILE, DEVICE_INSTANCE, SESSION, DEVICE_POOL, DEVICE, and VPCE_CONFIGURATION.

"""

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

"""
    ListTestGridProjects()

Gets a list of all Selenium testing projects in your account.

# Optional Parameters
- `maxResult`: Return no more than this number of results.
- `nextToken`: From a response, used to continue a paginated listing.
"""

list_test_grid_projects(; aws_config::AWSConfig=global_aws_config()) = device_farm("ListTestGridProjects"; aws_config=aws_config)
list_test_grid_projects(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListTestGridProjects", args; aws_config=aws_config)

"""
    ListTestGridSessionActions()

Returns a list of the actions taken in a TestGridSession.

# Required Parameters
- `sessionArn`: The ARN of the session to retrieve.

# Optional Parameters
- `maxResult`: The maximum number of sessions to return per response.
- `nextToken`: Pagination token.
"""

list_test_grid_session_actions(sessionArn; aws_config::AWSConfig=global_aws_config()) = device_farm("ListTestGridSessionActions", Dict{String, Any}("sessionArn"=>sessionArn); aws_config=aws_config)
list_test_grid_session_actions(sessionArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListTestGridSessionActions", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("sessionArn"=>sessionArn), args)); aws_config=aws_config)

"""
    ListTestGridSessionArtifacts()

Retrieves a list of artifacts created during the session.

# Required Parameters
- `sessionArn`: The ARN of a TestGridSession.

# Optional Parameters
- `maxResult`: The maximum number of results to be returned by a request.
- `nextToken`: Pagination token.
- `type`: Limit results to a specified type of artifact.
"""

list_test_grid_session_artifacts(sessionArn; aws_config::AWSConfig=global_aws_config()) = device_farm("ListTestGridSessionArtifacts", Dict{String, Any}("sessionArn"=>sessionArn); aws_config=aws_config)
list_test_grid_session_artifacts(sessionArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListTestGridSessionArtifacts", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("sessionArn"=>sessionArn), args)); aws_config=aws_config)

"""
    ListTestGridSessions()

Retrieves a list of sessions for a TestGridProject.

# Required Parameters
- `projectArn`: ARN of a TestGridProject.

# Optional Parameters
- `creationTimeAfter`: Return only sessions created after this time.
- `creationTimeBefore`: Return only sessions created before this time.
- `endTimeAfter`: Return only sessions that ended after this time.
- `endTimeBefore`: Return only sessions that ended before this time.
- `maxResult`: Return only this many results at a time.
- `nextToken`: Pagination token.
- `status`: Return only sessions in this state.
"""

list_test_grid_sessions(projectArn; aws_config::AWSConfig=global_aws_config()) = device_farm("ListTestGridSessions", Dict{String, Any}("projectArn"=>projectArn); aws_config=aws_config)
list_test_grid_sessions(projectArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListTestGridSessions", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("projectArn"=>projectArn), args)); aws_config=aws_config)

"""
    ListTests()

Gets information about tests in a given test suite.

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

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_tests(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("ListTests", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
list_tests(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListTests", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    ListUniqueProblems()

Gets information about unique problems, such as exceptions or crashes. Unique problems are defined as a single instance of an error across a run, job, or suite. For example, if a call in your application consistently raises an exception (OutOfBoundsException in MyActivity.java:386), ListUniqueProblems returns a single entry instead of many individual entries for that exception.

# Required Parameters
- `arn`: The unique problems' ARNs.

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_unique_problems(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("ListUniqueProblems", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
list_unique_problems(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListUniqueProblems", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    ListUploads()

Gets information about uploads, given an AWS Device Farm project ARN.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the project for which you want to list uploads.

# Optional Parameters
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
- `type`: The type of upload. Must be one of the following values:   ANDROID_APP   IOS_APP   WEB_APP   EXTERNAL_DATA   APPIUM_JAVA_JUNIT_TEST_PACKAGE   APPIUM_JAVA_TESTNG_TEST_PACKAGE   APPIUM_PYTHON_TEST_PACKAGE   APPIUM_NODE_TEST_PACKAGE   APPIUM_RUBY_TEST_PACKAGE   APPIUM_WEB_JAVA_JUNIT_TEST_PACKAGE   APPIUM_WEB_JAVA_TESTNG_TEST_PACKAGE   APPIUM_WEB_PYTHON_TEST_PACKAGE   APPIUM_WEB_NODE_TEST_PACKAGE   APPIUM_WEB_RUBY_TEST_PACKAGE   CALABASH_TEST_PACKAGE   INSTRUMENTATION_TEST_PACKAGE   UIAUTOMATION_TEST_PACKAGE   UIAUTOMATOR_TEST_PACKAGE   XCTEST_TEST_PACKAGE   XCTEST_UI_TEST_PACKAGE   APPIUM_JAVA_JUNIT_TEST_SPEC   APPIUM_JAVA_TESTNG_TEST_SPEC   APPIUM_PYTHON_TEST_SPEC   APPIUM_NODE_TEST_SPEC    APPIUM_RUBY_TEST_SPEC   APPIUM_WEB_JAVA_JUNIT_TEST_SPEC   APPIUM_WEB_JAVA_TESTNG_TEST_SPEC   APPIUM_WEB_PYTHON_TEST_SPEC   APPIUM_WEB_NODE_TEST_SPEC   APPIUM_WEB_RUBY_TEST_SPEC   INSTRUMENTATION_TEST_SPEC   XCTEST_UI_TEST_SPEC
"""

list_uploads(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("ListUploads", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
list_uploads(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListUploads", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    ListVPCEConfigurations()

Returns information about all Amazon Virtual Private Cloud (VPC) endpoint configurations in the AWS account.

# Optional Parameters
- `maxResults`: An integer that specifies the maximum number of items you want to return in the API response.
- `nextToken`: An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
"""

list_vpceconfigurations(; aws_config::AWSConfig=global_aws_config()) = device_farm("ListVPCEConfigurations"; aws_config=aws_config)
list_vpceconfigurations(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ListVPCEConfigurations", args; aws_config=aws_config)

"""
    PurchaseOffering()

Immediately purchases offerings for an AWS account. Offerings renew with the latest total purchased quantity for an offering, unless the renewal was overridden. The API returns a NotEligible error if the user is not permitted to invoke the operation. If you must be able to invoke this operation, contact aws-devicefarm-support@amazon.com.

# Optional Parameters
- `offeringId`: The ID of the offering.
- `offeringPromotionId`: The ID of the offering promotion to be applied to the purchase.
- `quantity`: The number of device slots to purchase in an offering request.
"""

purchase_offering(; aws_config::AWSConfig=global_aws_config()) = device_farm("PurchaseOffering"; aws_config=aws_config)
purchase_offering(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("PurchaseOffering", args; aws_config=aws_config)

"""
    RenewOffering()

Explicitly sets the quantity of devices to renew for an offering, starting from the effectiveDate of the next period. The API returns a NotEligible error if the user is not permitted to invoke the operation. If you must be able to invoke this operation, contact aws-devicefarm-support@amazon.com.

# Optional Parameters
- `offeringId`: The ID of a request to renew an offering.
- `quantity`: The quantity requested in an offering renewal.
"""

renew_offering(; aws_config::AWSConfig=global_aws_config()) = device_farm("RenewOffering"; aws_config=aws_config)
renew_offering(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("RenewOffering", args; aws_config=aws_config)

"""
    ScheduleRun()

Schedules a run.

# Required Parameters
- `projectArn`: The ARN of the project for the run to be scheduled.
- `test`: Information about the test for the run to be scheduled.

# Optional Parameters
- `appArn`: The ARN of an application package to run tests against, created with CreateUpload. See ListUploads.
- `configuration`: Information about the settings for the run to be scheduled.
- `devicePoolArn`: The ARN of the device pool for the run to be scheduled.
- `deviceSelectionConfiguration`: The filter criteria used to dynamically select a set of devices for a test run and the maximum number of devices to be included in the run. Either  devicePoolArn  or  deviceSelectionConfiguration  is required in a request.
- `executionConfiguration`: Specifies configuration information about a test run, such as the execution timeout (in minutes).
- `name`: The name for the run to be scheduled.
"""

schedule_run(projectArn, test; aws_config::AWSConfig=global_aws_config()) = device_farm("ScheduleRun", Dict{String, Any}("projectArn"=>projectArn, "test"=>test); aws_config=aws_config)
schedule_run(projectArn, test, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("ScheduleRun", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("projectArn"=>projectArn, "test"=>test), args)); aws_config=aws_config)

"""
    StopJob()

Initiates a stop request for the current job. AWS Device Farm immediately stops the job on the device where tests have not started. You are not billed for this device. On the device where tests have started, setup suite and teardown suite tests run to completion on the device. You are billed for setup, teardown, and any tests that were in progress or already completed.

# Required Parameters
- `arn`: Represents the Amazon Resource Name (ARN) of the Device Farm job to stop.

"""

stop_job(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("StopJob", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
stop_job(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("StopJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    StopRemoteAccessSession()

Ends a specified remote access session.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the remote access session to stop.

"""

stop_remote_access_session(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("StopRemoteAccessSession", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
stop_remote_access_session(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("StopRemoteAccessSession", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    StopRun()

Initiates a stop request for the current test run. AWS Device Farm immediately stops the run on devices where tests have not started. You are not billed for these devices. On devices where tests have started executing, setup suite and teardown suite tests run to completion on those devices. You are billed for setup, teardown, and any tests that were in progress or already completed.

# Required Parameters
- `arn`: Represents the Amazon Resource Name (ARN) of the Device Farm run to stop.

"""

stop_run(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("StopRun", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
stop_run(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("StopRun", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    TagResource()

Associates the specified tags to a resource with the specified resourceArn. If existing tags on a resource are not specified in the request parameters, they are not changed. When a resource is deleted, the tags associated with that resource are also deleted.

# Required Parameters
- `ResourceARN`: The Amazon Resource Name (ARN) of the resource or resources to which to add tags. You can associate tags with the following Device Farm resources: PROJECT, RUN, NETWORK_PROFILE, INSTANCE_PROFILE, DEVICE_INSTANCE, SESSION, DEVICE_POOL, DEVICE, and VPCE_CONFIGURATION.
- `Tags`: The tags to add to the resource. A tag is an array of key-value pairs. Tag keys can have a maximum character length of 128 characters. Tag values can have a maximum length of 256 characters.

"""

tag_resource(ResourceARN, Tags; aws_config::AWSConfig=global_aws_config()) = device_farm("TagResource", Dict{String, Any}("ResourceARN"=>ResourceARN, "Tags"=>Tags); aws_config=aws_config)
tag_resource(ResourceARN, Tags, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("TagResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResourceARN"=>ResourceARN, "Tags"=>Tags), args)); aws_config=aws_config)

"""
    UntagResource()

Deletes the specified tags from a resource.

# Required Parameters
- `ResourceARN`: The Amazon Resource Name (ARN) of the resource or resources from which to delete tags. You can associate tags with the following Device Farm resources: PROJECT, RUN, NETWORK_PROFILE, INSTANCE_PROFILE, DEVICE_INSTANCE, SESSION, DEVICE_POOL, DEVICE, and VPCE_CONFIGURATION.
- `TagKeys`: The keys of the tags to be removed.

"""

untag_resource(ResourceARN, TagKeys; aws_config::AWSConfig=global_aws_config()) = device_farm("UntagResource", Dict{String, Any}("ResourceARN"=>ResourceARN, "TagKeys"=>TagKeys); aws_config=aws_config)
untag_resource(ResourceARN, TagKeys, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("UntagResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResourceARN"=>ResourceARN, "TagKeys"=>TagKeys), args)); aws_config=aws_config)

"""
    UpdateDeviceInstance()

Updates information about a private device instance.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the device instance.

# Optional Parameters
- `labels`: An array of strings that you want to associate with the device instance.
- `profileArn`: The ARN of the profile that you want to associate with the device instance.
"""

update_device_instance(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateDeviceInstance", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
update_device_instance(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateDeviceInstance", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    UpdateDevicePool()

Modifies the name, description, and rules in a device pool given the attributes and the pool ARN. Rule updates are all-or-nothing, meaning they can only be updated as a whole (or not at all).

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the Device Farm device pool to update.

# Optional Parameters
- `clearMaxDevices`: Sets whether the maxDevices parameter applies to your device pool. If you set this parameter to true, the maxDevices parameter does not apply, and Device Farm does not limit the number of devices that it adds to your device pool. In this case, Device Farm adds all available devices that meet the criteria specified in the rules parameter. If you use this parameter in your request, you cannot use the maxDevices parameter in the same request.
- `description`: A description of the device pool to update.
- `maxDevices`: The number of devices that Device Farm can add to your device pool. Device Farm adds devices that are available and that meet the criteria that you assign for the rules parameter. Depending on how many devices meet these constraints, your device pool might contain fewer devices than the value for this parameter. By specifying the maximum number of devices, you can control the costs that you incur by running tests. If you use this parameter in your request, you cannot use the clearMaxDevices parameter in the same request.
- `name`: A string that represents the name of the device pool to update.
- `rules`: Represents the rules to modify for the device pool. Updating rules is optional. If you update rules for your request, the update replaces the existing rules.
"""

update_device_pool(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateDevicePool", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
update_device_pool(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateDevicePool", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    UpdateInstanceProfile()

Updates information about an existing private device instance profile.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the instance profile.

# Optional Parameters
- `description`: The updated description for your instance profile.
- `excludeAppPackagesFromCleanup`: An array of strings that specifies the list of app packages that should not be cleaned up from the device after a test run is over. The list of packages is only considered if you set packageCleanup to true.
- `name`: The updated name for your instance profile.
- `packageCleanup`: The updated choice for whether you want to specify package cleanup. The default value is false for private devices.
- `rebootAfterUse`: The updated choice for whether you want to reboot the device after use. The default value is true.
"""

update_instance_profile(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateInstanceProfile", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
update_instance_profile(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateInstanceProfile", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    UpdateNetworkProfile()

Updates the network profile.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the project for which you want to update network profile settings.

# Optional Parameters
- `description`: The description of the network profile about which you are returning information.
- `downlinkBandwidthBits`: The data throughput rate in bits per second, as an integer from 0 to 104857600.
- `downlinkDelayMs`: Delay time for all packets to destination in milliseconds as an integer from 0 to 2000.
- `downlinkJitterMs`: Time variation in the delay of received packets in milliseconds as an integer from 0 to 2000.
- `downlinkLossPercent`: Proportion of received packets that fail to arrive from 0 to 100 percent.
- `name`: The name of the network profile about which you are returning information.
- `type`: The type of network profile to return information about. Valid values are listed here.
- `uplinkBandwidthBits`: The data throughput rate in bits per second, as an integer from 0 to 104857600.
- `uplinkDelayMs`: Delay time for all packets to destination in milliseconds as an integer from 0 to 2000.
- `uplinkJitterMs`: Time variation in the delay of received packets in milliseconds as an integer from 0 to 2000.
- `uplinkLossPercent`: Proportion of transmitted packets that fail to arrive from 0 to 100 percent.
"""

update_network_profile(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateNetworkProfile", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
update_network_profile(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateNetworkProfile", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    UpdateProject()

Modifies the specified project name, given the project ARN and a new name.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the project whose name to update.

# Optional Parameters
- `defaultJobTimeoutMinutes`: The number of minutes a test run in the project executes before it times out.
- `name`: A string that represents the new name of the project that you are updating.
"""

update_project(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateProject", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
update_project(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateProject", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    UpdateTestGridProject()

Change details of a project.

# Required Parameters
- `projectArn`: ARN of the project to update.

# Optional Parameters
- `description`: Human-readable description for the project.
- `name`: Human-readable name for the project.
"""

update_test_grid_project(projectArn; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateTestGridProject", Dict{String, Any}("projectArn"=>projectArn); aws_config=aws_config)
update_test_grid_project(projectArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateTestGridProject", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("projectArn"=>projectArn), args)); aws_config=aws_config)

"""
    UpdateUpload()

Updates an uploaded test spec.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the uploaded test spec.

# Optional Parameters
- `contentType`: The upload's content type (for example, application/x-yaml).
- `editContent`: Set to true if the YAML file has changed and must be updated. Otherwise, set to false.
- `name`: The upload's test spec file name. The name must not contain any forward slashes (/). The test spec file name must end with the .yaml or .yml file extension.
"""

update_upload(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateUpload", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
update_upload(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateUpload", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)

"""
    UpdateVPCEConfiguration()

Updates information about an Amazon Virtual Private Cloud (VPC) endpoint configuration.

# Required Parameters
- `arn`: The Amazon Resource Name (ARN) of the VPC endpoint configuration you want to update.

# Optional Parameters
- `serviceDnsName`: The DNS (domain) name used to connect to your private service in your VPC. The DNS name must not already be in use on the internet.
- `vpceConfigurationDescription`: An optional description that provides details about your VPC endpoint configuration.
- `vpceConfigurationName`: The friendly name you give to your VPC endpoint configuration to manage your configurations more easily.
- `vpceServiceName`: The name of the VPC endpoint service running in your AWS account that you want Device Farm to test.
"""

update_vpceconfiguration(arn; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateVPCEConfiguration", Dict{String, Any}("arn"=>arn); aws_config=aws_config)
update_vpceconfiguration(arn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = device_farm("UpdateVPCEConfiguration", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("arn"=>arn), args)); aws_config=aws_config)


text:
# Orchestrates scripts

# Install packages
printstyled("1. Installing packages\n", color = :blue)
include("install_packages.jl")

# Main
## Pulse
printstyled("2. Runing pulse analysis\n", color = :blue)
include("fig_pulse.jl")
printstyled("Done! fig_pulse.jl created\n\n", color = :green)
## Press
printstyled("3. Runing press analysis\n", color = :blue)
include("fig_press.jl")
printstyled("Done! fig_pulse.jl created\n", color = :green)

# Supplementary Information

# The line below is used to run the SI version of the figures: when the 1st
# argument of 'ARGS' is true, then the model parameters used are the ones for
# the SI figure. Note that we actually use `ARGS` because this is specifically
# the vector that captures external arguments. Thus using it allows us to use
# arguments in the command line. So here, to run the SI version of fig_pulse,
# I'd use `julia fig_pulse.jl true`. To mimic this we simply add "true" to
# ARGS here rather than via an external argument
push!(ARGS, "true")

## Pulse
printstyled("4. Runing pulse analysis for SI\n", color = :blue)
include("fig_pulse.jl")
printstyled("Done! fig_pulse_si.jl created\n\n", color = :green)

## Press
printstyled("5. Runing press analysis for SI\n", color = :blue)
include("fig_press.jl")
printstyled("Done! fig_press_si.jl created\n\n", color = :green)

# Figures S2 and S3 takes ~2hours each and basically call the same functions
# as previous analyses so we skipped them on GitHub Actions
printstyled("NB: Fig. S1 and S2 are skipped because they are time/energy-consuming\n\n", color = :red)

# Figure S2 takes ~2hours
# printstyled("Runing simulations for FigS1\n", color = :blue)
# include("fig_S1.jl")

# Figue S3 takes ~2hours
# printstyled("Runing simulations for FigS1\n", color = :blue)
# include("fig_S2.jl")

ext: jl

max_stars_repo_name: McCannLab/Labmnivory

max_issues_repo_name: McCannLab/Labmnivory

max_forks_repo_name: McCannLab/Labmnivory


text:
using Base: PkgId

if isdefined(Base, :pkgorigins)
    include("loading.jl")
else
    include("legacy_loading.jl")
end

"""
    parse_pkg_files(id::PkgId)

This function gets called by `watch_package` and runs when a package is first loaded.
Its job is to organize the files and expressions defining the module so that later we can
detect and process revisions.
"""
parse_pkg_files(id::PkgId)

"""
    parentfile, included_files = modulefiles(mod::Module)

Return the `parentfile` in which `mod` was defined, as well as a list of any
other files that were `include`d to define `mod`. If this operation is unsuccessful,
`(nothing, nothing)` is returned.

All files are returned as absolute paths.
"""
modulefiles(mod::Module)

# This is primarily used to parse non-precompilable packages.
# These lack a cache header that lists the files that constitute the package;
# they also lack the source cache, and so have to parsed immediately or
# we won't be able to compute a diff when a file is modified (we don't have a record
# of what the source was before the modification).
#
# The main trick here is that since `using` is recursive, `included_files`
# might contain files associated with many different packages. We have to figure
# out which correspond to a particular module `mod`, which we do by:
#   - checking the module in which each file is evaluated. This suffices to
#     detect "supporting" files, i.e., those `included` within the module
#     definition.
#   - checking the filename. Since the "top level" file is evaluated into Main,
#     we can't use the module-of-evaluation to find it. Here we hope that the
#     top-level filename follows convention and matches the module. TODO?: it's
#     possible that this needs to be supplemented with parsing.
function queue_includes!(pkgdata::PkgData, id::PkgId)
    modstring = id.name
    delids = Int[]
    for i = 1:length(included_files)
        mod, fname = included_files[i]
        if mod == Base.__toplevel__
            mod = Main
        end
        modname = String(Symbol(mod))
        if startswith(modname, modstring) || endswith(fname, modstring*".jl")
            modexsigs = parse_source(fname, mod)
            if modexsigs !== nothing
                fname = relpath(fname, pkgdata)
                push!(pkgdata, fname=>FileInfo(modexsigs))
            end
            push!(delids, i)
        end
    end
    deleteat!(included_files, delids)
    CodeTracking._pkgfiles[id] = pkgdata.info
    return pkgdata
end

function queue_includes(mod::Module)
    id = PkgId(mod)
    pkgdata = get(pkgdatas, id, nothing)
    if pkgdata === nothing
        pkgdata = PkgData(id)
    end
    queue_includes!(pkgdata, id)
    if has_writable_paths(pkgdata)
        init_watching(pkgdata)
    end
    pkgdatas[id] = pkgdata
    return pkgdata
end

# A near-duplicate of some of the functionality of queue_includes!
# This gets called for silenced packages, to make sure they don't "contaminate"
# included_files
function remove_from_included_files(modsym::Symbol)
    i = 1
    modstring = string(modsym)
    while i <= length(included_files)
        mod, fname = included_files[i]
        modname = String(Symbol(mod))
        if startswith(modname, modstring) || endswith(fname, modstring*".jl")
            deleteat!(included_files, i)
        else
            i += 1
        end
    end
end

function read_from_cache(pkgdata::PkgData, file::AbstractString)
    fi = fileinfo(pkgdata, file)
    filep = joinpath(basedir(pkgdata), file)
    if fi.cachefile == basesrccache
        # Get the original path
        filec = get(cache_file_key, filep, filep)
        return open(basesrccache) do io
            Base._read_dependency_src(io, filec)
        end
    end
    Base.read_dependency_src(fi.cachefile, filep)
end

function maybe_parse_from_cache!(pkgdata::PkgData, file::AbstractString)
    if startswith(file, "REPL[")
        return add_definitions_from_repl(file)
    end
    fi = fileinfo(pkgdata, file)
    if isempty(fi.modexsigs) && (!isempty(fi.cachefile) || !isempty(fi.cacheexprs))
        # Source was never parsed, get it from the precompile cache
        src = read_from_cache(pkgdata, file)
        filep = joinpath(basedir(pkgdata), file)
        filec = get(cache_file_key, filep, filep)
        topmod = first(keys(fi.modexsigs))
        if parse_source!(fi.modexsigs, src, filec, topmod) === nothing
            @error "failed to parse cache file source text for $file"
        end
        add_modexs!(fi, fi.cacheexprs)
        empty!(fi.cacheexprs)
    end
    return fi
end

function add_modexs!(fi::FileInfo, modexs)
    for (mod, rex) in modexs
        exsigs = get(fi.modexsigs, mod, nothing)
        if exsigs === nothing
            fi.modexsigs[mod] = exsigs = ExprsSigs()
        end
        pushex!(exsigs, rex)
    end
    return fi
end

function maybe_extract_sigs!(fi::FileInfo)
    if !fi.extracted[]
        instantiate_sigs!(fi.modexsigs)
        fi.extracted[] = true
    end
    return fi
end
maybe_extract_sigs!(pkgdata::PkgData, file::AbstractString) = maybe_extract_sigs!(fileinfo(pkgdata, file))

function maybe_add_includes_to_pkgdata!(pkgdata::PkgData, file::AbstractString, includes; eval_now::Bool=false)
    for (mod, inc) in includes
        inc = joinpath(splitdir(file)[1], inc)
        incrp = relpath(inc, pkgdata)
        hasfile = false
        for srcfile in srcfiles(pkgdata)
            if srcfile == incrp
                hasfile = true
                break
            end
        end
        if !hasfile
            # Add the file to pkgdata
            push!(pkgdata.info.files, incrp)
            fi = FileInfo(mod)
            push!(pkgdata.fileinfos, fi)
            # Parse the source of the new file
            fullfile = joinpath(basedir(pkgdata), incrp)
            if isfile(fullfile)
                parse_source!(fi.modexsigs, fullfile, mod)
                if eval_now
                    # Use runtime dispatch to reduce latency
                    Base.invokelatest(instantiate_sigs!, fi.modexsigs; mode=:eval)
                end
            end
            # Add to watchlist
            init_watching(pkgdata, (incrp,))
            yield()
        end
    end
end

function add_require(sourcefile::String, modcaller::Module, idmod::String, modname::String, expr::Expr)
    expr isa Expr || return
    arthunk = TaskThunk(_add_require, (sourcefile, modcaller, idmod, modname, expr))
    schedule(Task(arthunk))
    return nothing
end

# Use locking to prevent races between inner and outer @require blocks
const requires_lock = ReentrantLock()

function _add_require(sourcefile, modcaller, idmod, modname, expr)
    id = PkgId(modcaller)
    # If this fires when the module is first being loaded (because the dependency
    # was already loaded), Revise may not yet have the pkgdata for this package.
    while !haskey(pkgdatas, id)
        sleep(0.1)
    end

    lock(requires_lock)
    try
        # Get/create the FileInfo specifically for tracking @require blocks
        pkgdata = pkgdatas[id]
        filekey = relpath(sourcefile, pkgdata) * "__@require__"
        fileidx = fileindex(pkgdata, filekey)
        if fileidx === nothing
            files = srcfiles(pkgdata)
            fileidx = length(files) + 1
            push!(files, filekey)
            push!(pkgdata.fileinfos, FileInfo(modcaller))
        end
        fi = pkgdata.fileinfos[fileidx]
        # Tag the expr to ensure it is unique
        expr = Expr(:block, copy(expr))
        push!(expr.args, :(__pkguuid__ = $idmod))
        # Add the expression to the fileinfo
        complex = true     # is this too complex to delay?
        if !fi.extracted[]
            # If we haven't yet extracted signatures, do our best to avoid it now in case the
            # signature-extraction code has not yet been compiled (latency reduction)
            includes, complex = deferrable_require(expr)
            if !complex
                # [(modcaller, inc) for inc in includes] but without precompiling a Generator
                modincludes = Tuple{Module,String}[]
                for inc in includes
                    push!(modincludes, (modcaller, inc))
                end
                maybe_add_includes_to_pkgdata!(pkgdata, filekey, modincludes)
                if isempty(fi.modexsigs)
                    # Source has not even been parsed
                    push!(fi.cacheexprs, (modcaller, expr))
                else
                    add_modexs!(fi, [(modcaller, expr)])
                end
            end
        end
        if complex
            Base.invokelatest(eval_require_now, pkgdata, fileidx, filekey, sourcefile, modcaller, expr)
        end
    finally
        unlock(requires_lock)
    end
end

function deferrable_require(expr)
    includes = String[]
    complex = deferrable_require!(includes, expr)
    return includes, complex
end
function deferrable_require!(includes, expr::Expr)
    if expr.head === :call
        callee = expr.args[1]
        if callee === :include
            if isa(expr.args[2], AbstractString)
                push!(includes, expr.args[2])
            else
                return true
            end
        elseif callee === :eval || (isa(callee, Expr) && callee.head === :. && is_quotenode_egal(callee.args[2], :eval))
            # Any eval statement is suspicious and requires immediate action
            return false
        end
    end
    expr.head === :macrocall && expr.args[1] === Symbol("@eval") && return true
    for a in expr.args
        a isa Expr || continue
        deferrable_require!(includes, a) && return true
    end
    return false
end

function eval_require_now(pkgdata::PkgData, fileidx::Int, filekey::String, sourcefile::String, modcaller::Module, expr::Expr)
    fi = pkgdata.fileinfos[fileidx]
    exsnew = ExprsSigs()
    exsnew[RelocatableExpr(expr)] = nothing
    mexsnew = ModuleExprsSigs(modcaller=>exsnew)
    # Before executing the expression we need to set the load path appropriately
    prev = Base.source_path(nothing)
    tls = task_local_storage()
    tls[:SOURCE_PATH] = sourcefile
    # Now execute the expression
    mexsnew, includes = try
        eval_new!(mexsnew, fi.modexsigs)
    finally
        if prev === nothing
            delete!(tls, :SOURCE_PATH)
        else
            tls[:SOURCE_PATH] = prev
        end
    end
    # Add any new methods or `include`d files to tracked objects
    pkgdata.fileinfos[fileidx] = FileInfo(mexsnew, fi)
    ret = maybe_add_includes_to_pkgdata!(pkgdata, filekey, includes; eval_now=true)
    return ret
end

function watch_files_via_dir(dirname)
    try
        wait_changed(dirname)  # this will block until there is a modification
    catch e
        # issue #459
        (isa(e, InterruptException) && throwto_repl(e)) || throw(e)
    end
    latestfiles = Pair{String,PkgId}[]
    # Check to see if we're still watching this directory
    stillwatching = haskey(watched_files, dirname)
    if stillwatching
        wf = watched_files[dirname]
        for (file, id) in wf.trackedfiles
            fullpath = joinpath(dirname, file)
            if isdir(fullpath)
                # Detected a modification in a directory that we're watching in
                # itself (not as a container for watched files)
                push!(latestfiles, file=>id)
                continue
            elseif !file_exists(fullpath)
                # File may have been deleted. But be very sure.
                sleep(0.1)
                if !file_exists(fullpath)
                    push!(latestfiles, file=>id)
                    continue
                end
            end
            if newer(mtime(fullpath), wf.timestamp)
                push!(latestfiles, file=>id)
            end
        end
        isempty(latestfiles) || updatetime!(wf)  # ref issue #341
    end
    return latestfiles, stillwatching
end

"""
    watch_package(id::Base.PkgId)

Start watching a package for changes to the files that define it.
This function gets called via a callback registered with `Base.require`, at the completion
of module-loading by `using` or `import`.
"""
function watch_package(id::PkgId)
    # Because the callbacks are made with `invokelatest`, for reasons of performance
    # we need to make sure this function is fast to compile. By hiding the real
    # work behind a @async, we truncate the chain of dependency.
    schedule(Task(TaskThunk(_watch_package, (id,))))
    sleep(0.001)
end

@noinline function _watch_package(id::PkgId)
    modsym = Symbol(id.name)
    if modsym ∈ dont_watch_pkgs
        if modsym ∉ silence_pkgs
            @warn "$modsym is excluded from watching by Revise. Use Revise.silence(\"$modsym\") to quiet this warning."
        end
        remove_from_included_files(modsym)
        return nothing
    end
    pkgdata = parse_pkg_files(id)
    if has_writable_paths(pkgdata)
        init_watching(pkgdata, srcfiles(pkgdata))
    end
    pkgdatas[id] = pkgdata
end

function has_writable_paths(pkgdata::PkgData)
    dir = basedir(pkgdata)
    isdir(dir) || return true
    haswritable = false
    cd(dir) do
        for file in srcfiles(pkgdata)
            haswritable |= iswritable(file)
        end
    end
    return haswritable
end

function watch_includes(mod::Module, fn::AbstractString)
    push!(included_files, (mod, normpath(abspath(fn))))
end

## Working with Pkg and code-loading

# Much of this is adapted from base/loading.jl

function manifest_file(project_file)
    if project_file isa String && isfile(project_file)
        mfile = Base.project_file_manifest_path(project_file)
        if mfile isa String
            return mfile
        end
    end
    return nothing
end
manifest_file() = manifest_file(Base.active_project())

if isdefined(Base, :explicit_manifest_entry_path)
    function manifest_paths!(pkgpaths::Dict, manifest_file::String)
        d = if isdefined(Base, :get_deps) # `get_deps` is present in versions that support new manifest formats
            Base.get_deps(Base.parsed_toml(manifest_file))
        else
            Base.parsed_toml(manifest_file)
        end
        for (name, entries) in d
            entries::Vector{Any}
            for entry in entries
                id = PkgId(UUID(entry["uuid"]::String), name)
                path = Base.explicit_manifest_entry_path(manifest_file, id, entry)
                if path !== nothing
                    pkgpaths[id] = path
                end
            end
        end
        return pkgpaths
    end
else
    # Legacy (delete when Julia 1.6 or higher is the minimum supported version)
    if isdefined(Base, :TOMLCache)
        function manifest_paths!(pkgpaths::Dict, manifest_file::String)
            d = if isdefined(Base, :get_deps) # `get_deps` is present in versions that support new manifest formats
                Base.get_deps(Base.parsed_toml(manifest_file))
            else
                Base.parsed_toml(manifest_file)
            end
            for (name, entries) in d
                entries::Vector{Any}
                for info in entries
                    name::String
                    info::Dict{String, Any}
                    uuid = UUID(info["uuid"]::String)
                    hash = get(info, "git-tree-sha1", nothing)::Union{String, Nothing}
                    path = nothing
                    if hash !== nothing
                        path = find_from_hash(name, uuid, Base.SHA1(hash))
                        path === nothing && error("no path found for $id and hash $hash")
                    end
                    maybe_path = get(info, "path", nothing)::Union{String, Nothing}
                    if maybe_path !== nothing
                        path = abspath(dirname(manifest_file), maybe_path)
                    end
                    if path !== nothing
                        pkgpaths[PkgId(Base.UUID(uuid), name)] = path
                    end
                end
            end
            return pkgpaths
        end
    else
        function manifest_paths!(pkgpaths::Dict, manifest_file::String)
            open(manifest_file) do io
                uuid = name = path = hash = id = nothing
                for line in eachline(io)
                    if (m = match(Base.re_section_capture, line)) != nothing
                        name = String(m.captures[1])
                        path = hash = nothing
                    elseif (m = match(Base.re_uuid_to_string, line)) != nothing
                        uuid = UUID(m.captures[1])
                        name === nothing && error("name not set for $uuid")
                        id = PkgId(uuid, name)
                        # UUID is last, so time to store
                        if path !== nothing
                            pkgpaths[id] = path
                        elseif hash !== nothing
                            path = find_from_hash(name, uuid, hash)
                            path === nothing && error("no path found for $id and hash $hash")
                            pkgpaths[id] = path
                        end
                        uuid = name = path = hash = id = nothing
                    elseif (m = match(Base.re_path_to_string, line)) != nothing
                        path = String(m.captures[1])
                        path = abspath(dirname(manifest_file), path)
                    elseif (m = match(Base.re_hash_to_string, line)) != nothing
                        hash = Base.SHA1(m.captures[1])
                    end
                end
            end
            return pkgpaths
        end
    end
    function find_from_hash(name::String, uuid::Base.UUID, hash::Base.SHA1)
        for slug in (Base.version_slug(uuid, hash, 4), Base.version_slug(uuid, hash))
            for depot in DEPOT_PATH
                path = abspath(depot, "packages", name, slug)
                if ispath(path)
                    return path
                end
            end
        end
        return nothing
    end
end

manifest_paths(manifest_file::String) =
    manifest_paths!(Dict{PkgId,String}(), manifest_file)

function watch_manifest(mfile)
    while true
        try
            wait_changed(mfile)
        catch e
            # issue #459
            (isa(e, InterruptException) && throwto_repl(e)) || throw(e)
        end
        try
            with_logger(_debug_logger) do
                @debug "Pkg" _group="manifest_update" manifest_file=mfile
                isfile(mfile) || return nothing
                pkgdirs = manifest_paths(mfile)
                for (id, pkgdir) in pkgdirs
                    if haskey(pkgdatas, id)
                        pkgdata = pkgdatas[id]
                        if pkgdir != basedir(pkgdata)
                            ## The package directory has changed
                            @debug "Pkg" _group="pathswitch" oldpath=basedir(pkgdata) newpath=pkgdir
                            # Stop all associated watching tasks
                            for dir in unique_dirs(srcfiles(pkgdata))
                                @debug "Pkg" _group="unwatch" dir=dir
                                delete!(watched_files, joinpath(basedir(pkgdata), dir))
                                # Note: if the file is revised, the task(s) will run one more time.
                                # However, because we've removed the directory from the watch list this will be a no-op,
                                # and then the tasks will be dropped.
                            end
                            # Revise code as needed
                            files = String[]
                            for file in srcfiles(pkgdata)
                                maybe_extract_sigs!(maybe_parse_from_cache!(pkgdata, file))
                                push!(revision_queue, (pkgdata, file))
                                push!(files, file)
                                notify(revision_event)
                            end
                            # Update the directory
                            pkgdata.info.basedir = pkgdir
                            # Restart watching, if applicable
                            if has_writable_paths(pkgdata)
                                init_watching(pkgdata, files)
                            end
                        end
                    end
                end
            end
        catch err
            @static if VERSION >= v"1.2.0-DEV.253"
                put!(Base.active_repl_backend.response_channel, (Base.catch_stack(), true))
            else
                put!(Base.active_repl_backend.response_channel, (err, catch_backtrace()))
            end
        end
    end
end


text:
server = LanguageServerInstance(IOBuffer(), IOBuffer(), true)
server.runlinter = true
function ≂(r1::LanguageServer.Range, r2::LanguageServer.Range)
    r1.start.line == r2.start.line &&
    r1.start.character == r2.start.character &&
    r1.stop.line == r2.stop.line &&
    r1.stop.character == r2.stop.character
end

@testset "undeclared variable" begin
    server.documents[LanguageServer.URI2("none")] = doc = LanguageServer.Document("none","variable",true)
    LanguageServer.parse_all(doc, server)

    d = doc.diagnostics[1]
    @test d.loc == 0:8
    vscode_diag = LanguageServer.convert_diagnostic(d, doc)
    @test vscode_diag.range ≂ Range(0, 0, 0, 8)
end

#
# @testset "missing ws on op" begin
#     server.documents["none"] = doc = LanguageServer.Document("none","1+2",true)
#     LanguageServer.parse_all(doc, server)

#     d = doc.diagnostics[1]
#     @test d.loc == 1:2
#     vscode_diag = LanguageServer.convert_diagnostic(d, doc)
#     @test vscode_diag.range ≂ Range(0, 1, 0, 2)
# end

# @testset "extra ws on op" begin
#     server.documents["none"] = doc = LanguageServer.Document("none","1 : 2",true)
#     LanguageServer.parse_all(doc, server)

#     d = doc.diagnostics[1]
#     @test d.loc == 2:3
#     vscode_diag = LanguageServer.convert_diagnostic(d, doc)
#     @test vscode_diag.range ≂ Range(0, 2, 0, 3)
# end

# @testset "missing ws on comma" begin
#     doc = LanguageServer.Document("none","1,2",true)
#     LanguageServer.parse_all(doc, server)

#     d = doc.diagnostics[1]
#     @test d.loc == 1:2
#     vscode_diag = LanguageServer.convert_diagnostic(d, doc)
#     @test vscode_diag.range ≂ Range(0, 1, 0, 2)
# end

# @testset "extra ws on comma" begin
#     doc = LanguageServer.Document("none","1 , 2",true)
#     LanguageServer.parse_all(doc, server)

#     d = doc.diagnostics[1]
#     @test d.loc == 2:3
#     vscode_diag = LanguageServer.convert_diagnostic(d, doc)
#     @test vscode_diag.range ≂ Range(0, 2, 0, 3)
# end

# @testset "extra ws on brackets" begin
#     doc = LanguageServer.Document("none","( 1 )",true)
#     LanguageServer.parse_all(doc, server)

#     d = doc.diagnostics[1]
#     @test d.loc == 0:1
#     vscode_diag = LanguageServer.convert_diagnostic(d, doc)
#     @test vscode_diag.range ≂ Range(0, 0, 0, 1)

#     d = doc.diagnostics[2]
#     @test d.loc == 4:5
#     vscode_diag = LanguageServer.convert_diagnostic(d, doc)
#     @test vscode_diag.range ≂ Range(0, 4, 0, 5)
# end

@testset "deprecated type syntaxes" begin
    @testset "abstract" begin
        server.documents[LanguageServer.URI2("none")] = doc = LanguageServer.Document("none","""
        abstract T
        """,true)
        LanguageServer.parse_all(doc, server)

        d = doc.diagnostics[1]
        @test d.loc == 0:8
        @test LanguageServer.convert_diagnostic(d, doc).range ≂ Range(0, 0, 0, 8)
    end

    @testset "type" begin
        server.documents[LanguageServer.URI2("none")] = doc = LanguageServer.Document("none","""
        type T end
        """,true)
        LanguageServer.parse_all(doc, server)

        d = doc.diagnostics[1]
        @test d.loc == 0:4
        @test LanguageServer.convert_diagnostic(d, doc).range ≂ Range(0, 0, 0, 4)
    end

    @testset "immutable" begin
        server.documents[LanguageServer.URI2("none")] = doc = LanguageServer.Document("none","""
        immutable T end
        """,true)
        LanguageServer.parse_all(doc, server)

        d = doc.diagnostics[1]
        @test d.loc == 0:9
        @test LanguageServer.convert_diagnostic(d, doc).range ≂ Range(0, 0, 0, 9)
    end

    @testset "typealias" begin
        server.documents[LanguageServer.URI2("none")] = doc = LanguageServer.Document("none","""
        immutable T end
        """,true)
        LanguageServer.parse_all(doc, server)

        d = doc.diagnostics[1]
        @test d.loc == 0:9
        @test LanguageServer.convert_diagnostic(d, doc).range ≂ Range(0, 0, 0, 9)
    end

    @testset "bitstype" begin
        server.documents[LanguageServer.URI2("none")] = doc = LanguageServer.Document("none","""
        bitstype a b
        """,true)
        LanguageServer.parse_all(doc, server)

        d = doc.diagnostics[1]
        @test d.loc == 0:8
        @test LanguageServer.convert_diagnostic(d, doc).range ≂ Range(0, 0, 0, 8)
    end
end