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

"""
    create_app_monitor(domain, name)
    create_app_monitor(domain, name, params::Dict{String,<:Any})

Creates a Amazon CloudWatch RUM app monitor, which collects telemetry data from your
application and sends that data to RUM. The data includes performance and reliability
information such as page load time, client-side errors, and user behavior. You use this
operation only to create a new app monitor. To update an existing app monitor, use
UpdateAppMonitor instead. After you create an app monitor, sign in to the CloudWatch RUM
console to get the JavaScript code snippet to add to your web application. For more
information, see How do I find a code snippet that I've already generated?

# Arguments
- `domain`: The top-level internet domain name for which your application has
  administrative authority.
- `name`: A name for the app monitor.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"AppMonitorConfiguration"`: A structure that contains much of the configuration data for
  the app monitor. If you are using Amazon Cognito for authorization, you must include this
  structure in your request, and it must include the ID of the Amazon Cognito identity pool
  to use for authorization. If you don't include AppMonitorConfiguration, you must set up
  your own authorization method. For more information, see Authorize your application to send
  data to Amazon Web Services. If you omit this argument, the sample rate used for RUM is set
  to 10% of the user sessions.
- `"CwLogEnabled"`: Data collected by RUM is kept by RUM for 30 days and then deleted. This
  parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch
  Logs in your account. This enables you to keep the telemetry data for more than 30 days,
  but it does incur Amazon CloudWatch Logs charges. If you omit this parameter, the default
  is false.
- `"Tags"`: Assigns one or more tags (key-value pairs) to the app monitor. Tags can help
  you organize and categorize your resources. You can also use them to scope user permissions
  by granting a user permission to access or change only resources with certain tag values.
  Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as
  strings of characters.  &lt;p&gt;You can associate as many as 50 tags with an app
  monitor.&lt;/p&gt; &lt;p&gt;For more information, see &lt;a
  href=&quot;https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html&quot;&gt;Tagging
  Amazon Web Services resources&lt;/a&gt;.&lt;/p&gt;
"""
function create_app_monitor(Domain, Name; aws_config::AbstractAWSConfig=global_aws_config())
    return rum(
        "POST",
        "/appmonitor",
        Dict{String,Any}("Domain" => Domain, "Name" => Name);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_app_monitor(
    Domain,
    Name,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return rum(
        "POST",
        "/appmonitor",
        Dict{String,Any}(
            mergewith(_merge, Dict{String,Any}("Domain" => Domain, "Name" => Name), params)
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Deletes an existing app monitor. This immediately stops the collection of data.

# Arguments
- `name`: The name of the app monitor to delete.

"""
function delete_app_monitor(Name; aws_config::AbstractAWSConfig=global_aws_config())
    return rum(
        "DELETE",
        "/appmonitor/$(Name)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_app_monitor(
    Name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return rum(
        "DELETE",
        "/appmonitor/$(Name)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Retrieves the complete configuration information for one app monitor.

# Arguments
- `name`: The app monitor to retrieve information for.

"""
function get_app_monitor(Name; aws_config::AbstractAWSConfig=global_aws_config())
    return rum(
        "GET", "/appmonitor/$(Name)"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
    )
end
function get_app_monitor(
    Name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return rum(
        "GET",
        "/appmonitor/$(Name)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_app_monitor_data(name, time_range)
    get_app_monitor_data(name, time_range, params::Dict{String,<:Any})

Retrieves the raw performance events that RUM has collected from your web application, so
that you can do your own processing or analysis of this data.

# Arguments
- `name`: The name of the app monitor that collected the data that you want to retrieve.
- `time_range`: A structure that defines the time range that you want to retrieve results
  from.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Filters"`: An array of structures that you can use to filter the results to those that
  match one or more sets of key-value pairs that you specify.
- `"MaxResults"`: The maximum number of results to return in one operation.
- `"NextToken"`: Use the token returned by the previous operation to request the next page
  of results.
"""
function get_app_monitor_data(
    Name, TimeRange; aws_config::AbstractAWSConfig=global_aws_config()
)
    return rum(
        "POST",
        "/appmonitor/$(Name)/data",
        Dict{String,Any}("TimeRange" => TimeRange);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_app_monitor_data(
    Name,
    TimeRange,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return rum(
        "POST",
        "/appmonitor/$(Name)/data",
        Dict{String,Any}(
            mergewith(_merge, Dict{String,Any}("TimeRange" => TimeRange), params)
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Returns a list of the Amazon CloudWatch RUM app monitors in the account.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The maximum number of results to return in one operation.
- `"nextToken"`: Use the token returned by the previous operation to request the next page
  of results.
"""
function list_app_monitors(; aws_config::AbstractAWSConfig=global_aws_config())
    return rum(
        "POST", "/appmonitors"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
    )
end
function list_app_monitors(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return rum(
        "POST",
        "/appmonitors",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Displays the tags associated with a CloudWatch RUM resource.

# Arguments
- `resource_arn`: The ARN of the resource that you want to see the tags of.

"""
function list_tags_for_resource(
    ResourceArn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return rum(
        "GET",
        "/tags/$(ResourceArn)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_tags_for_resource(
    ResourceArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return rum(
        "GET",
        "/tags/$(ResourceArn)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    put_rum_events(app_monitor_details, batch_id, id, rum_events, user_details)
    put_rum_events(app_monitor_details, batch_id, id, rum_events, user_details, params::Dict{String,<:Any})

Sends telemetry events about your application performance and user behavior to CloudWatch
RUM. The code snippet that RUM generates for you to add to your application includes
PutRumEvents operations to send this data to RUM. Each PutRumEvents operation can send a
batch of events from one user session.

# Arguments
- `app_monitor_details`: A structure that contains information about the app monitor that
  collected this telemetry information.
- `batch_id`: A unique identifier for this batch of RUM event data.
- `id`: The ID of the app monitor that is sending this data.
- `rum_events`: An array of structures that contain the telemetry event data.
- `user_details`: A structure that contains information about the user session that this
  batch of events was collected from.

"""
function put_rum_events(
    AppMonitorDetails,
    BatchId,
    Id,
    RumEvents,
    UserDetails;
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return rum(
        "POST",
        "/appmonitors/$(Id)/",
        Dict{String,Any}(
            "AppMonitorDetails" => AppMonitorDetails,
            "BatchId" => BatchId,
            "RumEvents" => RumEvents,
            "UserDetails" => UserDetails,
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function put_rum_events(
    AppMonitorDetails,
    BatchId,
    Id,
    RumEvents,
    UserDetails,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return rum(
        "POST",
        "/appmonitors/$(Id)/",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "AppMonitorDetails" => AppMonitorDetails,
                    "BatchId" => BatchId,
                    "RumEvents" => RumEvents,
                    "UserDetails" => UserDetails,
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Assigns one or more tags (key-value pairs) to the specified CloudWatch RUM resource.
Currently, the only resources that can be tagged app monitors. Tags can help you organize
and categorize your resources. You can also use them to scope user permissions by granting
a user permission to access or change only resources with certain tag values. Tags don't
have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of
characters. You can use the TagResource action with a resource that already has tags. If
you specify a new tag key for the resource, this tag is appended to the list of tags
associated with the alarm. If you specify a tag key that is already associated with the
resource, the new tag value that you specify replaces the previous value for that tag. You
can associate as many as 50 tags with a resource. For more information, see Tagging Amazon
Web Services resources.

# Arguments
- `resource_arn`: The ARN of the CloudWatch RUM resource that you're adding tags to.
- `tags`: The list of key-value pairs to associate with the resource.

"""
function tag_resource(ResourceArn, Tags; aws_config::AbstractAWSConfig=global_aws_config())
    return rum(
        "POST",
        "/tags/$(ResourceArn)",
        Dict{String,Any}("Tags" => Tags);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function tag_resource(
    ResourceArn,
    Tags,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return rum(
        "POST",
        "/tags/$(ResourceArn)",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("Tags" => Tags), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Removes one or more tags from the specified resource.

# Arguments
- `resource_arn`: The ARN of the CloudWatch RUM resource that you're removing tags from.
- `tag_keys`: The list of tag keys to remove from the resource.

"""
function untag_resource(
    ResourceArn, tagKeys; aws_config::AbstractAWSConfig=global_aws_config()
)
    return rum(
        "DELETE",
        "/tags/$(ResourceArn)",
        Dict{String,Any}("tagKeys" => tagKeys);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function untag_resource(
    ResourceArn,
    tagKeys,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return rum(
        "DELETE",
        "/tags/$(ResourceArn)",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("tagKeys" => tagKeys), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Updates the configuration of an existing app monitor. When you use this operation, only the
parts of the app monitor configuration that you specify in this operation are changed. For
any parameters that you omit, the existing values are kept. You can't use this operation to
change the tags of an existing app monitor. To change the tags of an existing app monitor,
use TagResource. To create a new app monitor, use CreateAppMonitor. After you update an app
monitor, sign in to the CloudWatch RUM console to get the updated JavaScript code snippet
to add to your web application. For more information, see How do I find a code snippet that
I've already generated?

# Arguments
- `name`: The name of the app monitor to update.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"AppMonitorConfiguration"`: A structure that contains much of the configuration data for
  the app monitor. If you are using Amazon Cognito for authorization, you must include this
  structure in your request, and it must include the ID of the Amazon Cognito identity pool
  to use for authorization. If you don't include AppMonitorConfiguration, you must set up
  your own authorization method. For more information, see Authorize your application to send
  data to Amazon Web Services.
- `"CwLogEnabled"`: Data collected by RUM is kept by RUM for 30 days and then deleted. This
  parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch
  Logs in your account. This enables you to keep the telemetry data for more than 30 days,
  but it does incur Amazon CloudWatch Logs charges.
- `"Domain"`: The top-level internet domain name for which your application has
  administrative authority.
"""
function update_app_monitor(Name; aws_config::AbstractAWSConfig=global_aws_config())
    return rum(
        "PATCH",
        "/appmonitor/$(Name)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_app_monitor(
    Name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return rum(
        "PATCH",
        "/appmonitor/$(Name)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
