R/cloudwatchlogs_operations.R

Defines functions cloudwatchlogs_untag_log_group cloudwatchlogs_test_metric_filter cloudwatchlogs_tag_log_group cloudwatchlogs_stop_query cloudwatchlogs_start_query cloudwatchlogs_put_subscription_filter cloudwatchlogs_put_retention_policy cloudwatchlogs_put_resource_policy cloudwatchlogs_put_query_definition cloudwatchlogs_put_metric_filter cloudwatchlogs_put_log_events cloudwatchlogs_put_destination_policy cloudwatchlogs_put_destination cloudwatchlogs_list_tags_log_group cloudwatchlogs_get_query_results cloudwatchlogs_get_log_record cloudwatchlogs_get_log_group_fields cloudwatchlogs_get_log_events cloudwatchlogs_filter_log_events cloudwatchlogs_disassociate_kms_key cloudwatchlogs_describe_subscription_filters cloudwatchlogs_describe_resource_policies cloudwatchlogs_describe_query_definitions cloudwatchlogs_describe_queries cloudwatchlogs_describe_metric_filters cloudwatchlogs_describe_log_streams cloudwatchlogs_describe_log_groups cloudwatchlogs_describe_export_tasks cloudwatchlogs_describe_destinations cloudwatchlogs_delete_subscription_filter cloudwatchlogs_delete_retention_policy cloudwatchlogs_delete_resource_policy cloudwatchlogs_delete_query_definition cloudwatchlogs_delete_metric_filter cloudwatchlogs_delete_log_stream cloudwatchlogs_delete_log_group cloudwatchlogs_delete_destination cloudwatchlogs_create_log_stream cloudwatchlogs_create_log_group cloudwatchlogs_create_export_task cloudwatchlogs_cancel_export_task cloudwatchlogs_associate_kms_key

Documented in cloudwatchlogs_associate_kms_key cloudwatchlogs_cancel_export_task cloudwatchlogs_create_export_task cloudwatchlogs_create_log_group cloudwatchlogs_create_log_stream cloudwatchlogs_delete_destination cloudwatchlogs_delete_log_group cloudwatchlogs_delete_log_stream cloudwatchlogs_delete_metric_filter cloudwatchlogs_delete_query_definition cloudwatchlogs_delete_resource_policy cloudwatchlogs_delete_retention_policy cloudwatchlogs_delete_subscription_filter cloudwatchlogs_describe_destinations cloudwatchlogs_describe_export_tasks cloudwatchlogs_describe_log_groups cloudwatchlogs_describe_log_streams cloudwatchlogs_describe_metric_filters cloudwatchlogs_describe_queries cloudwatchlogs_describe_query_definitions cloudwatchlogs_describe_resource_policies cloudwatchlogs_describe_subscription_filters cloudwatchlogs_disassociate_kms_key cloudwatchlogs_filter_log_events cloudwatchlogs_get_log_events cloudwatchlogs_get_log_group_fields cloudwatchlogs_get_log_record cloudwatchlogs_get_query_results cloudwatchlogs_list_tags_log_group cloudwatchlogs_put_destination cloudwatchlogs_put_destination_policy cloudwatchlogs_put_log_events cloudwatchlogs_put_metric_filter cloudwatchlogs_put_query_definition cloudwatchlogs_put_resource_policy cloudwatchlogs_put_retention_policy cloudwatchlogs_put_subscription_filter cloudwatchlogs_start_query cloudwatchlogs_stop_query cloudwatchlogs_tag_log_group cloudwatchlogs_test_metric_filter cloudwatchlogs_untag_log_group

# This file is generated by make.paws. Please do not edit here.
#' @importFrom paws.common get_config new_operation new_request send_request
#' @include cloudwatchlogs_service.R
NULL

#' Associates the specified AWS Key Management Service (AWS KMS) customer
#' master key (CMK) with the specified log group
#'
#' @description
#' Associates the specified AWS Key Management Service (AWS KMS) customer
#' master key (CMK) with the specified log group.
#' 
#' Associating an AWS KMS CMK with a log group overrides any existing
#' associations between the log group and a CMK. After a CMK is associated
#' with a log group, all newly ingested data for the log group is encrypted
#' using the CMK. This association is stored as long as the data encrypted
#' with the CMK is still within Amazon CloudWatch Logs. This enables Amazon
#' CloudWatch Logs to decrypt this data whenever it is requested.
#' 
#' CloudWatch Logs supports only symmetric CMKs. Do not use an associate an
#' asymmetric CMK with your log group. For more information, see [Using
#' Symmetric and Asymmetric
#' Keys](https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html).
#' 
#' It can take up to 5 minutes for this operation to take effect.
#' 
#' If you attempt to associate a CMK with a log group but the CMK does not
#' exist or the CMK is disabled, you receive an `InvalidParameterException`
#' error.
#'
#' @usage
#' cloudwatchlogs_associate_kms_key(logGroupName, kmsKeyId)
#'
#' @param logGroupName [required] The name of the log group.
#' @param kmsKeyId [required] The Amazon Resource Name (ARN) of the CMK to use when encrypting log
#' data. This must be a symmetric CMK. For more information, see [Amazon
#' Resource Names - AWS Key Management Service (AWS
#' KMS)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms)
#' and [Using Symmetric and Asymmetric
#' Keys](https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html).
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$associate_kms_key(
#'   logGroupName = "string",
#'   kmsKeyId = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_associate_kms_key
cloudwatchlogs_associate_kms_key <- function(logGroupName, kmsKeyId) {
  op <- new_operation(
    name = "AssociateKmsKey",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$associate_kms_key_input(logGroupName = logGroupName, kmsKeyId = kmsKeyId)
  output <- .cloudwatchlogs$associate_kms_key_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$associate_kms_key <- cloudwatchlogs_associate_kms_key

#' Cancels the specified export task
#'
#' @description
#' Cancels the specified export task.
#' 
#' The task must be in the `PENDING` or `RUNNING` state.
#'
#' @usage
#' cloudwatchlogs_cancel_export_task(taskId)
#'
#' @param taskId &#91;required&#93; The ID of the export task.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$cancel_export_task(
#'   taskId = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_cancel_export_task
cloudwatchlogs_cancel_export_task <- function(taskId) {
  op <- new_operation(
    name = "CancelExportTask",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$cancel_export_task_input(taskId = taskId)
  output <- .cloudwatchlogs$cancel_export_task_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$cancel_export_task <- cloudwatchlogs_cancel_export_task

#' Creates an export task, which allows you to efficiently export data from
#' a log group to an Amazon S3 bucket
#'
#' @description
#' Creates an export task, which allows you to efficiently export data from
#' a log group to an Amazon S3 bucket. When you perform a
#' [`create_export_task`][cloudwatchlogs_create_export_task] operation, you
#' must use credentials that have permission to write to the S3 bucket that
#' you specify as the destination.
#' 
#' This is an asynchronous call. If all the required information is
#' provided, this operation initiates an export task and responds with the
#' ID of the task. After the task has started, you can use
#' [`describe_export_tasks`][cloudwatchlogs_describe_export_tasks] to get
#' the status of the export task. Each account can only have one active
#' (`RUNNING` or `PENDING`) export task at a time. To cancel an export
#' task, use [`cancel_export_task`][cloudwatchlogs_cancel_export_task].
#' 
#' You can export logs from multiple log groups or multiple time ranges to
#' the same S3 bucket. To separate out log data for each export task, you
#' can specify a prefix to be used as the Amazon S3 key prefix for all
#' exported objects.
#' 
#' Exporting to S3 buckets that are encrypted with AES-256 is supported.
#' Exporting to S3 buckets encrypted with SSE-KMS is not supported.
#'
#' @usage
#' cloudwatchlogs_create_export_task(taskName, logGroupName,
#'   logStreamNamePrefix, from, to, destination, destinationPrefix)
#'
#' @param taskName The name of the export task.
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param logStreamNamePrefix Export only log streams that match the provided prefix. If you don't
#' specify a value, no prefix filter is applied.
#' @param from &#91;required&#93; The start time of the range for the request, expressed as the number of
#' milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp
#' earlier than this time are not exported.
#' @param to &#91;required&#93; The end time of the range for the request, expressed as the number of
#' milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp
#' later than this time are not exported.
#' @param destination &#91;required&#93; The name of S3 bucket for the exported log data. The bucket must be in
#' the same AWS region.
#' @param destinationPrefix The prefix used as the start of the key for every object exported. If
#' you don't specify a value, the default is `exportedlogs`.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   taskId = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$create_export_task(
#'   taskName = "string",
#'   logGroupName = "string",
#'   logStreamNamePrefix = "string",
#'   from = 123,
#'   to = 123,
#'   destination = "string",
#'   destinationPrefix = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_create_export_task
cloudwatchlogs_create_export_task <- function(taskName = NULL, logGroupName, logStreamNamePrefix = NULL, from, to, destination, destinationPrefix = NULL) {
  op <- new_operation(
    name = "CreateExportTask",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$create_export_task_input(taskName = taskName, logGroupName = logGroupName, logStreamNamePrefix = logStreamNamePrefix, from = from, to = to, destination = destination, destinationPrefix = destinationPrefix)
  output <- .cloudwatchlogs$create_export_task_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$create_export_task <- cloudwatchlogs_create_export_task

#' Creates a log group with the specified name
#'
#' @description
#' Creates a log group with the specified name. You can create up to 20,000
#' log groups per account.
#' 
#' You must use the following guidelines when naming a log group:
#' 
#' -   Log group names must be unique within a region for an AWS account.
#' 
#' -   Log group names can be between 1 and 512 characters long.
#' 
#' -   Log group names consist of the following characters: a-z, A-Z, 0-9,
#'     '_' (underscore), '-' (hyphen), '/' (forward slash), '.' (period),
#'     and '\#' (number sign)
#' 
#' When you create a log group, by default the log events in the log group
#' never expire. To set a retention policy so that events expire and are
#' deleted after a specified time, use
#' [`put_retention_policy`][cloudwatchlogs_put_retention_policy].
#' 
#' If you associate a AWS Key Management Service (AWS KMS) customer master
#' key (CMK) with the log group, ingested data is encrypted using the CMK.
#' This association is stored as long as the data encrypted with the CMK is
#' still within Amazon CloudWatch Logs. This enables Amazon CloudWatch Logs
#' to decrypt this data whenever it is requested.
#' 
#' If you attempt to associate a CMK with the log group but the CMK does
#' not exist or the CMK is disabled, you receive an
#' `InvalidParameterException` error.
#' 
#' CloudWatch Logs supports only symmetric CMKs. Do not associate an
#' asymmetric CMK with your log group. For more information, see [Using
#' Symmetric and Asymmetric
#' Keys](https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html).
#'
#' @usage
#' cloudwatchlogs_create_log_group(logGroupName, kmsKeyId, tags)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param kmsKeyId The Amazon Resource Name (ARN) of the CMK to use when encrypting log
#' data. For more information, see [Amazon Resource Names - AWS Key
#' Management Service (AWS
#' KMS)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms).
#' @param tags The key-value pairs to use for the tags.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$create_log_group(
#'   logGroupName = "string",
#'   kmsKeyId = "string",
#'   tags = list(
#'     "string"
#'   )
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_create_log_group
cloudwatchlogs_create_log_group <- function(logGroupName, kmsKeyId = NULL, tags = NULL) {
  op <- new_operation(
    name = "CreateLogGroup",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$create_log_group_input(logGroupName = logGroupName, kmsKeyId = kmsKeyId, tags = tags)
  output <- .cloudwatchlogs$create_log_group_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$create_log_group <- cloudwatchlogs_create_log_group

#' Creates a log stream for the specified log group
#'
#' @description
#' Creates a log stream for the specified log group. A log stream is a
#' sequence of log events that originate from a single source, such as an
#' application instance or a resource that is being monitored.
#' 
#' There is no limit on the number of log streams that you can create for a
#' log group. There is a limit of 50 TPS on
#' [`create_log_stream`][cloudwatchlogs_create_log_stream] operations,
#' after which transactions are throttled.
#' 
#' You must use the following guidelines when naming a log stream:
#' 
#' -   Log stream names must be unique within the log group.
#' 
#' -   Log stream names can be between 1 and 512 characters long.
#' 
#' -   The ':' (colon) and '*' (asterisk) characters are not allowed.
#'
#' @usage
#' cloudwatchlogs_create_log_stream(logGroupName, logStreamName)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param logStreamName &#91;required&#93; The name of the log stream.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$create_log_stream(
#'   logGroupName = "string",
#'   logStreamName = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_create_log_stream
cloudwatchlogs_create_log_stream <- function(logGroupName, logStreamName) {
  op <- new_operation(
    name = "CreateLogStream",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$create_log_stream_input(logGroupName = logGroupName, logStreamName = logStreamName)
  output <- .cloudwatchlogs$create_log_stream_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$create_log_stream <- cloudwatchlogs_create_log_stream

#' Deletes the specified destination, and eventually disables all the
#' subscription filters that publish to it
#'
#' @description
#' Deletes the specified destination, and eventually disables all the
#' subscription filters that publish to it. This operation does not delete
#' the physical resource encapsulated by the destination.
#'
#' @usage
#' cloudwatchlogs_delete_destination(destinationName)
#'
#' @param destinationName &#91;required&#93; The name of the destination.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$delete_destination(
#'   destinationName = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_delete_destination
cloudwatchlogs_delete_destination <- function(destinationName) {
  op <- new_operation(
    name = "DeleteDestination",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$delete_destination_input(destinationName = destinationName)
  output <- .cloudwatchlogs$delete_destination_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$delete_destination <- cloudwatchlogs_delete_destination

#' Deletes the specified log group and permanently deletes all the archived
#' log events associated with the log group
#'
#' @description
#' Deletes the specified log group and permanently deletes all the archived
#' log events associated with the log group.
#'
#' @usage
#' cloudwatchlogs_delete_log_group(logGroupName)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$delete_log_group(
#'   logGroupName = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_delete_log_group
cloudwatchlogs_delete_log_group <- function(logGroupName) {
  op <- new_operation(
    name = "DeleteLogGroup",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$delete_log_group_input(logGroupName = logGroupName)
  output <- .cloudwatchlogs$delete_log_group_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$delete_log_group <- cloudwatchlogs_delete_log_group

#' Deletes the specified log stream and permanently deletes all the
#' archived log events associated with the log stream
#'
#' @description
#' Deletes the specified log stream and permanently deletes all the
#' archived log events associated with the log stream.
#'
#' @usage
#' cloudwatchlogs_delete_log_stream(logGroupName, logStreamName)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param logStreamName &#91;required&#93; The name of the log stream.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$delete_log_stream(
#'   logGroupName = "string",
#'   logStreamName = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_delete_log_stream
cloudwatchlogs_delete_log_stream <- function(logGroupName, logStreamName) {
  op <- new_operation(
    name = "DeleteLogStream",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$delete_log_stream_input(logGroupName = logGroupName, logStreamName = logStreamName)
  output <- .cloudwatchlogs$delete_log_stream_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$delete_log_stream <- cloudwatchlogs_delete_log_stream

#' Deletes the specified metric filter
#'
#' @description
#' Deletes the specified metric filter.
#'
#' @usage
#' cloudwatchlogs_delete_metric_filter(logGroupName, filterName)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param filterName &#91;required&#93; The name of the metric filter.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$delete_metric_filter(
#'   logGroupName = "string",
#'   filterName = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_delete_metric_filter
cloudwatchlogs_delete_metric_filter <- function(logGroupName, filterName) {
  op <- new_operation(
    name = "DeleteMetricFilter",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$delete_metric_filter_input(logGroupName = logGroupName, filterName = filterName)
  output <- .cloudwatchlogs$delete_metric_filter_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$delete_metric_filter <- cloudwatchlogs_delete_metric_filter

#' Deletes a saved CloudWatch Logs Insights query definition
#'
#' @description
#' Deletes a saved CloudWatch Logs Insights query definition. A query
#' definition contains details about a saved CloudWatch Logs Insights
#' query.
#' 
#' Each [`delete_query_definition`][cloudwatchlogs_delete_query_definition]
#' operation can delete one query definition.
#' 
#' You must have the `logs:DeleteQueryDefinition` permission to be able to
#' perform this operation.
#'
#' @usage
#' cloudwatchlogs_delete_query_definition(queryDefinitionId)
#'
#' @param queryDefinitionId &#91;required&#93; The ID of the query definition that you want to delete. You can use
#' [`describe_query_definitions`][cloudwatchlogs_describe_query_definitions]
#' to retrieve the IDs of your saved query definitions.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   success = TRUE|FALSE
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$delete_query_definition(
#'   queryDefinitionId = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_delete_query_definition
cloudwatchlogs_delete_query_definition <- function(queryDefinitionId) {
  op <- new_operation(
    name = "DeleteQueryDefinition",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$delete_query_definition_input(queryDefinitionId = queryDefinitionId)
  output <- .cloudwatchlogs$delete_query_definition_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$delete_query_definition <- cloudwatchlogs_delete_query_definition

#' Deletes a resource policy from this account
#'
#' @description
#' Deletes a resource policy from this account. This revokes the access of
#' the identities in that policy to put log events to this account.
#'
#' @usage
#' cloudwatchlogs_delete_resource_policy(policyName)
#'
#' @param policyName The name of the policy to be revoked. This parameter is required.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$delete_resource_policy(
#'   policyName = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_delete_resource_policy
cloudwatchlogs_delete_resource_policy <- function(policyName = NULL) {
  op <- new_operation(
    name = "DeleteResourcePolicy",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$delete_resource_policy_input(policyName = policyName)
  output <- .cloudwatchlogs$delete_resource_policy_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$delete_resource_policy <- cloudwatchlogs_delete_resource_policy

#' Deletes the specified retention policy
#'
#' @description
#' Deletes the specified retention policy.
#' 
#' Log events do not expire if they belong to log groups without a
#' retention policy.
#'
#' @usage
#' cloudwatchlogs_delete_retention_policy(logGroupName)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$delete_retention_policy(
#'   logGroupName = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_delete_retention_policy
cloudwatchlogs_delete_retention_policy <- function(logGroupName) {
  op <- new_operation(
    name = "DeleteRetentionPolicy",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$delete_retention_policy_input(logGroupName = logGroupName)
  output <- .cloudwatchlogs$delete_retention_policy_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$delete_retention_policy <- cloudwatchlogs_delete_retention_policy

#' Deletes the specified subscription filter
#'
#' @description
#' Deletes the specified subscription filter.
#'
#' @usage
#' cloudwatchlogs_delete_subscription_filter(logGroupName, filterName)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param filterName &#91;required&#93; The name of the subscription filter.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$delete_subscription_filter(
#'   logGroupName = "string",
#'   filterName = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_delete_subscription_filter
cloudwatchlogs_delete_subscription_filter <- function(logGroupName, filterName) {
  op <- new_operation(
    name = "DeleteSubscriptionFilter",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$delete_subscription_filter_input(logGroupName = logGroupName, filterName = filterName)
  output <- .cloudwatchlogs$delete_subscription_filter_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$delete_subscription_filter <- cloudwatchlogs_delete_subscription_filter

#' Lists all your destinations
#'
#' @description
#' Lists all your destinations. The results are ASCII-sorted by destination
#' name.
#'
#' @usage
#' cloudwatchlogs_describe_destinations(DestinationNamePrefix, nextToken,
#'   limit)
#'
#' @param DestinationNamePrefix The prefix to match. If you don't specify a value, no prefix filter is
#' applied.
#' @param nextToken The token for the next set of items to return. (You received this token
#' from a previous call.)
#' @param limit The maximum number of items returned. If you don't specify a value, the
#' default is up to 50 items.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   destinations = list(
#'     list(
#'       destinationName = "string",
#'       targetArn = "string",
#'       roleArn = "string",
#'       accessPolicy = "string",
#'       arn = "string",
#'       creationTime = 123
#'     )
#'   ),
#'   nextToken = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$describe_destinations(
#'   DestinationNamePrefix = "string",
#'   nextToken = "string",
#'   limit = 123
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_describe_destinations
cloudwatchlogs_describe_destinations <- function(DestinationNamePrefix = NULL, nextToken = NULL, limit = NULL) {
  op <- new_operation(
    name = "DescribeDestinations",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$describe_destinations_input(DestinationNamePrefix = DestinationNamePrefix, nextToken = nextToken, limit = limit)
  output <- .cloudwatchlogs$describe_destinations_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$describe_destinations <- cloudwatchlogs_describe_destinations

#' Lists the specified export tasks
#'
#' @description
#' Lists the specified export tasks. You can list all your export tasks or
#' filter the results based on task ID or task status.
#'
#' @usage
#' cloudwatchlogs_describe_export_tasks(taskId, statusCode, nextToken,
#'   limit)
#'
#' @param taskId The ID of the export task. Specifying a task ID filters the results to
#' zero or one export tasks.
#' @param statusCode The status code of the export task. Specifying a status code filters the
#' results to zero or more export tasks.
#' @param nextToken The token for the next set of items to return. (You received this token
#' from a previous call.)
#' @param limit The maximum number of items returned. If you don't specify a value, the
#' default is up to 50 items.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   exportTasks = list(
#'     list(
#'       taskId = "string",
#'       taskName = "string",
#'       logGroupName = "string",
#'       from = 123,
#'       to = 123,
#'       destination = "string",
#'       destinationPrefix = "string",
#'       status = list(
#'         code = "CANCELLED"|"COMPLETED"|"FAILED"|"PENDING"|"PENDING_CANCEL"|"RUNNING",
#'         message = "string"
#'       ),
#'       executionInfo = list(
#'         creationTime = 123,
#'         completionTime = 123
#'       )
#'     )
#'   ),
#'   nextToken = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$describe_export_tasks(
#'   taskId = "string",
#'   statusCode = "CANCELLED"|"COMPLETED"|"FAILED"|"PENDING"|"PENDING_CANCEL"|"RUNNING",
#'   nextToken = "string",
#'   limit = 123
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_describe_export_tasks
cloudwatchlogs_describe_export_tasks <- function(taskId = NULL, statusCode = NULL, nextToken = NULL, limit = NULL) {
  op <- new_operation(
    name = "DescribeExportTasks",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$describe_export_tasks_input(taskId = taskId, statusCode = statusCode, nextToken = nextToken, limit = limit)
  output <- .cloudwatchlogs$describe_export_tasks_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$describe_export_tasks <- cloudwatchlogs_describe_export_tasks

#' Lists the specified log groups
#'
#' @description
#' Lists the specified log groups. You can list all your log groups or
#' filter the results by prefix. The results are ASCII-sorted by log group
#' name.
#'
#' @usage
#' cloudwatchlogs_describe_log_groups(logGroupNamePrefix, nextToken, limit)
#'
#' @param logGroupNamePrefix The prefix to match.
#' @param nextToken The token for the next set of items to return. (You received this token
#' from a previous call.)
#' @param limit The maximum number of items returned. If you don't specify a value, the
#' default is up to 50 items.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   logGroups = list(
#'     list(
#'       logGroupName = "string",
#'       creationTime = 123,
#'       retentionInDays = 123,
#'       metricFilterCount = 123,
#'       arn = "string",
#'       storedBytes = 123,
#'       kmsKeyId = "string"
#'     )
#'   ),
#'   nextToken = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$describe_log_groups(
#'   logGroupNamePrefix = "string",
#'   nextToken = "string",
#'   limit = 123
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_describe_log_groups
cloudwatchlogs_describe_log_groups <- function(logGroupNamePrefix = NULL, nextToken = NULL, limit = NULL) {
  op <- new_operation(
    name = "DescribeLogGroups",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$describe_log_groups_input(logGroupNamePrefix = logGroupNamePrefix, nextToken = nextToken, limit = limit)
  output <- .cloudwatchlogs$describe_log_groups_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$describe_log_groups <- cloudwatchlogs_describe_log_groups

#' Lists the log streams for the specified log group
#'
#' @description
#' Lists the log streams for the specified log group. You can list all the
#' log streams or filter the results by prefix. You can also control how
#' the results are ordered.
#' 
#' This operation has a limit of five transactions per second, after which
#' transactions are throttled.
#'
#' @usage
#' cloudwatchlogs_describe_log_streams(logGroupName, logStreamNamePrefix,
#'   orderBy, descending, nextToken, limit)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param logStreamNamePrefix The prefix to match.
#' 
#' If `orderBy` is `LastEventTime`, you cannot specify this parameter.
#' @param orderBy If the value is `LogStreamName`, the results are ordered by log stream
#' name. If the value is `LastEventTime`, the results are ordered by the
#' event time. The default value is `LogStreamName`.
#' 
#' If you order the results by event time, you cannot specify the
#' `logStreamNamePrefix` parameter.
#' 
#' `lastEventTimeStamp` represents the time of the most recent log event in
#' the log stream in CloudWatch Logs. This number is expressed as the
#' number of milliseconds after Jan 1, 1970 00:00:00 UTC.
#' `lastEventTimeStamp` updates on an eventual consistency basis. It
#' typically updates in less than an hour from ingestion, but in rare
#' situations might take longer.
#' @param descending If the value is true, results are returned in descending order. If the
#' value is to false, results are returned in ascending order. The default
#' value is false.
#' @param nextToken The token for the next set of items to return. (You received this token
#' from a previous call.)
#' @param limit The maximum number of items returned. If you don't specify a value, the
#' default is up to 50 items.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   logStreams = list(
#'     list(
#'       logStreamName = "string",
#'       creationTime = 123,
#'       firstEventTimestamp = 123,
#'       lastEventTimestamp = 123,
#'       lastIngestionTime = 123,
#'       uploadSequenceToken = "string",
#'       arn = "string",
#'       storedBytes = 123
#'     )
#'   ),
#'   nextToken = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$describe_log_streams(
#'   logGroupName = "string",
#'   logStreamNamePrefix = "string",
#'   orderBy = "LogStreamName"|"LastEventTime",
#'   descending = TRUE|FALSE,
#'   nextToken = "string",
#'   limit = 123
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_describe_log_streams
cloudwatchlogs_describe_log_streams <- function(logGroupName, logStreamNamePrefix = NULL, orderBy = NULL, descending = NULL, nextToken = NULL, limit = NULL) {
  op <- new_operation(
    name = "DescribeLogStreams",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$describe_log_streams_input(logGroupName = logGroupName, logStreamNamePrefix = logStreamNamePrefix, orderBy = orderBy, descending = descending, nextToken = nextToken, limit = limit)
  output <- .cloudwatchlogs$describe_log_streams_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$describe_log_streams <- cloudwatchlogs_describe_log_streams

#' Lists the specified metric filters
#'
#' @description
#' Lists the specified metric filters. You can list all of the metric
#' filters or filter the results by log name, prefix, metric name, or
#' metric namespace. The results are ASCII-sorted by filter name.
#'
#' @usage
#' cloudwatchlogs_describe_metric_filters(logGroupName, filterNamePrefix,
#'   nextToken, limit, metricName, metricNamespace)
#'
#' @param logGroupName The name of the log group.
#' @param filterNamePrefix The prefix to match. CloudWatch Logs uses the value you set here only if
#' you also include the `logGroupName` parameter in your request.
#' @param nextToken The token for the next set of items to return. (You received this token
#' from a previous call.)
#' @param limit The maximum number of items returned. If you don't specify a value, the
#' default is up to 50 items.
#' @param metricName Filters results to include only those with the specified metric name. If
#' you include this parameter in your request, you must also include the
#' `metricNamespace` parameter.
#' @param metricNamespace Filters results to include only those in the specified namespace. If you
#' include this parameter in your request, you must also include the
#' `metricName` parameter.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   metricFilters = list(
#'     list(
#'       filterName = "string",
#'       filterPattern = "string",
#'       metricTransformations = list(
#'         list(
#'           metricName = "string",
#'           metricNamespace = "string",
#'           metricValue = "string",
#'           defaultValue = 123.0
#'         )
#'       ),
#'       creationTime = 123,
#'       logGroupName = "string"
#'     )
#'   ),
#'   nextToken = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$describe_metric_filters(
#'   logGroupName = "string",
#'   filterNamePrefix = "string",
#'   nextToken = "string",
#'   limit = 123,
#'   metricName = "string",
#'   metricNamespace = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_describe_metric_filters
cloudwatchlogs_describe_metric_filters <- function(logGroupName = NULL, filterNamePrefix = NULL, nextToken = NULL, limit = NULL, metricName = NULL, metricNamespace = NULL) {
  op <- new_operation(
    name = "DescribeMetricFilters",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$describe_metric_filters_input(logGroupName = logGroupName, filterNamePrefix = filterNamePrefix, nextToken = nextToken, limit = limit, metricName = metricName, metricNamespace = metricNamespace)
  output <- .cloudwatchlogs$describe_metric_filters_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$describe_metric_filters <- cloudwatchlogs_describe_metric_filters

#' Returns a list of CloudWatch Logs Insights queries that are scheduled,
#' executing, or have been executed recently in this account
#'
#' @description
#' Returns a list of CloudWatch Logs Insights queries that are scheduled,
#' executing, or have been executed recently in this account. You can
#' request all queries or limit it to queries of a specific log group or
#' queries with a certain status.
#'
#' @usage
#' cloudwatchlogs_describe_queries(logGroupName, status, maxResults,
#'   nextToken)
#'
#' @param logGroupName Limits the returned queries to only those for the specified log group.
#' @param status Limits the returned queries to only those that have the specified
#' status. Valid values are `Cancelled`, `Complete`, `Failed`, `Running`,
#' and `Scheduled`.
#' @param maxResults Limits the number of returned queries to the specified number.
#' @param nextToken 
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   queries = list(
#'     list(
#'       queryId = "string",
#'       queryString = "string",
#'       status = "Scheduled"|"Running"|"Complete"|"Failed"|"Cancelled",
#'       createTime = 123,
#'       logGroupName = "string"
#'     )
#'   ),
#'   nextToken = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$describe_queries(
#'   logGroupName = "string",
#'   status = "Scheduled"|"Running"|"Complete"|"Failed"|"Cancelled",
#'   maxResults = 123,
#'   nextToken = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_describe_queries
cloudwatchlogs_describe_queries <- function(logGroupName = NULL, status = NULL, maxResults = NULL, nextToken = NULL) {
  op <- new_operation(
    name = "DescribeQueries",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$describe_queries_input(logGroupName = logGroupName, status = status, maxResults = maxResults, nextToken = nextToken)
  output <- .cloudwatchlogs$describe_queries_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$describe_queries <- cloudwatchlogs_describe_queries

#' This operation returns a paginated list of your saved CloudWatch Logs
#' Insights query definitions
#'
#' @description
#' This operation returns a paginated list of your saved CloudWatch Logs
#' Insights query definitions.
#' 
#' You can use the `queryDefinitionNamePrefix` parameter to limit the
#' results to only the query definitions that have names that start with a
#' certain string.
#'
#' @usage
#' cloudwatchlogs_describe_query_definitions(queryDefinitionNamePrefix,
#'   maxResults, nextToken)
#'
#' @param queryDefinitionNamePrefix Use this parameter to filter your results to only the query definitions
#' that have names that start with the prefix you specify.
#' @param maxResults Limits the number of returned query definitions to the specified number.
#' @param nextToken 
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   queryDefinitions = list(
#'     list(
#'       queryDefinitionId = "string",
#'       name = "string",
#'       queryString = "string",
#'       lastModified = 123,
#'       logGroupNames = list(
#'         "string"
#'       )
#'     )
#'   ),
#'   nextToken = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$describe_query_definitions(
#'   queryDefinitionNamePrefix = "string",
#'   maxResults = 123,
#'   nextToken = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_describe_query_definitions
cloudwatchlogs_describe_query_definitions <- function(queryDefinitionNamePrefix = NULL, maxResults = NULL, nextToken = NULL) {
  op <- new_operation(
    name = "DescribeQueryDefinitions",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$describe_query_definitions_input(queryDefinitionNamePrefix = queryDefinitionNamePrefix, maxResults = maxResults, nextToken = nextToken)
  output <- .cloudwatchlogs$describe_query_definitions_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$describe_query_definitions <- cloudwatchlogs_describe_query_definitions

#' Lists the resource policies in this account
#'
#' @description
#' Lists the resource policies in this account.
#'
#' @usage
#' cloudwatchlogs_describe_resource_policies(nextToken, limit)
#'
#' @param nextToken 
#' @param limit The maximum number of resource policies to be displayed with one call of
#' this API.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   resourcePolicies = list(
#'     list(
#'       policyName = "string",
#'       policyDocument = "string",
#'       lastUpdatedTime = 123
#'     )
#'   ),
#'   nextToken = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$describe_resource_policies(
#'   nextToken = "string",
#'   limit = 123
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_describe_resource_policies
cloudwatchlogs_describe_resource_policies <- function(nextToken = NULL, limit = NULL) {
  op <- new_operation(
    name = "DescribeResourcePolicies",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$describe_resource_policies_input(nextToken = nextToken, limit = limit)
  output <- .cloudwatchlogs$describe_resource_policies_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$describe_resource_policies <- cloudwatchlogs_describe_resource_policies

#' Lists the subscription filters for the specified log group
#'
#' @description
#' Lists the subscription filters for the specified log group. You can list
#' all the subscription filters or filter the results by prefix. The
#' results are ASCII-sorted by filter name.
#'
#' @usage
#' cloudwatchlogs_describe_subscription_filters(logGroupName,
#'   filterNamePrefix, nextToken, limit)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param filterNamePrefix The prefix to match. If you don't specify a value, no prefix filter is
#' applied.
#' @param nextToken The token for the next set of items to return. (You received this token
#' from a previous call.)
#' @param limit The maximum number of items returned. If you don't specify a value, the
#' default is up to 50 items.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   subscriptionFilters = list(
#'     list(
#'       filterName = "string",
#'       logGroupName = "string",
#'       filterPattern = "string",
#'       destinationArn = "string",
#'       roleArn = "string",
#'       distribution = "Random"|"ByLogStream",
#'       creationTime = 123
#'     )
#'   ),
#'   nextToken = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$describe_subscription_filters(
#'   logGroupName = "string",
#'   filterNamePrefix = "string",
#'   nextToken = "string",
#'   limit = 123
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_describe_subscription_filters
cloudwatchlogs_describe_subscription_filters <- function(logGroupName, filterNamePrefix = NULL, nextToken = NULL, limit = NULL) {
  op <- new_operation(
    name = "DescribeSubscriptionFilters",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$describe_subscription_filters_input(logGroupName = logGroupName, filterNamePrefix = filterNamePrefix, nextToken = nextToken, limit = limit)
  output <- .cloudwatchlogs$describe_subscription_filters_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$describe_subscription_filters <- cloudwatchlogs_describe_subscription_filters

#' Disassociates the associated AWS Key Management Service (AWS KMS)
#' customer master key (CMK) from the specified log group
#'
#' @description
#' Disassociates the associated AWS Key Management Service (AWS KMS)
#' customer master key (CMK) from the specified log group.
#' 
#' After the AWS KMS CMK is disassociated from the log group, AWS
#' CloudWatch Logs stops encrypting newly ingested data for the log group.
#' All previously ingested data remains encrypted, and AWS CloudWatch Logs
#' requires permissions for the CMK whenever the encrypted data is
#' requested.
#' 
#' Note that it can take up to 5 minutes for this operation to take effect.
#'
#' @usage
#' cloudwatchlogs_disassociate_kms_key(logGroupName)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$disassociate_kms_key(
#'   logGroupName = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_disassociate_kms_key
cloudwatchlogs_disassociate_kms_key <- function(logGroupName) {
  op <- new_operation(
    name = "DisassociateKmsKey",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$disassociate_kms_key_input(logGroupName = logGroupName)
  output <- .cloudwatchlogs$disassociate_kms_key_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$disassociate_kms_key <- cloudwatchlogs_disassociate_kms_key

#' Lists log events from the specified log group
#'
#' @description
#' Lists log events from the specified log group. You can list all the log
#' events or filter the results using a filter pattern, a time range, and
#' the name of the log stream.
#' 
#' By default, this operation returns as many log events as can fit in 1 MB
#' (up to 10,000 log events) or all the events found within the time range
#' that you specify. If the results include a token, then there are more
#' log events available, and you can get additional results by specifying
#' the token in a subsequent call. This operation can return empty results
#' while there are more log events available through the token.
#' 
#' The returned log events are sorted by event timestamp, the timestamp
#' when the event was ingested by CloudWatch Logs, and the ID of the
#' [`put_log_events`][cloudwatchlogs_put_log_events] request.
#'
#' @usage
#' cloudwatchlogs_filter_log_events(logGroupName, logStreamNames,
#'   logStreamNamePrefix, startTime, endTime, filterPattern, nextToken,
#'   limit, interleaved)
#'
#' @param logGroupName &#91;required&#93; The name of the log group to search.
#' @param logStreamNames Filters the results to only logs from the log streams in this list.
#' 
#' If you specify a value for both `logStreamNamePrefix` and
#' `logStreamNames`, the action returns an `InvalidParameterException`
#' error.
#' @param logStreamNamePrefix Filters the results to include only events from log streams that have
#' names starting with this prefix.
#' 
#' If you specify a value for both `logStreamNamePrefix` and
#' `logStreamNames`, but the value for `logStreamNamePrefix` does not match
#' any log stream names specified in `logStreamNames`, the action returns
#' an `InvalidParameterException` error.
#' @param startTime The start of the time range, expressed as the number of milliseconds
#' after Jan 1, 1970 00:00:00 UTC. Events with a timestamp before this time
#' are not returned.
#' 
#' If you omit `startTime` and `endTime` the most recent log events are
#' retrieved, to up 1 MB or 10,000 log events.
#' @param endTime The end of the time range, expressed as the number of milliseconds after
#' Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time
#' are not returned.
#' @param filterPattern The filter pattern to use. For more information, see [Filter and Pattern
#' Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html).
#' 
#' If not provided, all the events are matched.
#' @param nextToken The token for the next set of events to return. (You received this token
#' from a previous call.)
#' @param limit The maximum number of events to return. The default is 10,000 events.
#' @param interleaved If the value is true, the operation makes a best effort to provide
#' responses that contain events from multiple log streams within the log
#' group, interleaved in a single response. If the value is false, all the
#' matched log events in the first log stream are searched first, then
#' those in the next log stream, and so on. The default is false.
#' 
#' **Important:** Starting on June 17, 2019, this parameter is ignored and
#' the value is assumed to be true. The response from this operation always
#' interleaves events from multiple log streams within a log group.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   events = list(
#'     list(
#'       logStreamName = "string",
#'       timestamp = 123,
#'       message = "string",
#'       ingestionTime = 123,
#'       eventId = "string"
#'     )
#'   ),
#'   searchedLogStreams = list(
#'     list(
#'       logStreamName = "string",
#'       searchedCompletely = TRUE|FALSE
#'     )
#'   ),
#'   nextToken = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$filter_log_events(
#'   logGroupName = "string",
#'   logStreamNames = list(
#'     "string"
#'   ),
#'   logStreamNamePrefix = "string",
#'   startTime = 123,
#'   endTime = 123,
#'   filterPattern = "string",
#'   nextToken = "string",
#'   limit = 123,
#'   interleaved = TRUE|FALSE
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_filter_log_events
cloudwatchlogs_filter_log_events <- function(logGroupName, logStreamNames = NULL, logStreamNamePrefix = NULL, startTime = NULL, endTime = NULL, filterPattern = NULL, nextToken = NULL, limit = NULL, interleaved = NULL) {
  op <- new_operation(
    name = "FilterLogEvents",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$filter_log_events_input(logGroupName = logGroupName, logStreamNames = logStreamNames, logStreamNamePrefix = logStreamNamePrefix, startTime = startTime, endTime = endTime, filterPattern = filterPattern, nextToken = nextToken, limit = limit, interleaved = interleaved)
  output <- .cloudwatchlogs$filter_log_events_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$filter_log_events <- cloudwatchlogs_filter_log_events

#' Lists log events from the specified log stream
#'
#' @description
#' Lists log events from the specified log stream. You can list all of the
#' log events or filter using a time range.
#' 
#' By default, this operation returns as many log events as can fit in a
#' response size of 1MB (up to 10,000 log events). You can get additional
#' log events by specifying one of the tokens in a subsequent call. This
#' operation can return empty results while there are more log events
#' available through the token.
#'
#' @usage
#' cloudwatchlogs_get_log_events(logGroupName, logStreamName, startTime,
#'   endTime, nextToken, limit, startFromHead)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param logStreamName &#91;required&#93; The name of the log stream.
#' @param startTime The start of the time range, expressed as the number of milliseconds
#' after Jan 1, 1970 00:00:00 UTC. Events with a timestamp equal to this
#' time or later than this time are included. Events with a timestamp
#' earlier than this time are not included.
#' @param endTime The end of the time range, expressed as the number of milliseconds after
#' Jan 1, 1970 00:00:00 UTC. Events with a timestamp equal to or later than
#' this time are not included.
#' @param nextToken The token for the next set of items to return. (You received this token
#' from a previous call.)
#' 
#' Using this token works only when you specify `true` for `startFromHead`.
#' @param limit The maximum number of log events returned. If you don't specify a value,
#' the maximum is as many log events as can fit in a response size of 1 MB,
#' up to 10,000 log events.
#' @param startFromHead If the value is true, the earliest log events are returned first. If the
#' value is false, the latest log events are returned first. The default
#' value is false.
#' 
#' If you are using `nextToken` in this operation, you must specify `true`
#' for `startFromHead`.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   events = list(
#'     list(
#'       timestamp = 123,
#'       message = "string",
#'       ingestionTime = 123
#'     )
#'   ),
#'   nextForwardToken = "string",
#'   nextBackwardToken = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$get_log_events(
#'   logGroupName = "string",
#'   logStreamName = "string",
#'   startTime = 123,
#'   endTime = 123,
#'   nextToken = "string",
#'   limit = 123,
#'   startFromHead = TRUE|FALSE
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_get_log_events
cloudwatchlogs_get_log_events <- function(logGroupName, logStreamName, startTime = NULL, endTime = NULL, nextToken = NULL, limit = NULL, startFromHead = NULL) {
  op <- new_operation(
    name = "GetLogEvents",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$get_log_events_input(logGroupName = logGroupName, logStreamName = logStreamName, startTime = startTime, endTime = endTime, nextToken = nextToken, limit = limit, startFromHead = startFromHead)
  output <- .cloudwatchlogs$get_log_events_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$get_log_events <- cloudwatchlogs_get_log_events

#' Returns a list of the fields that are included in log events in the
#' specified log group, along with the percentage of log events that
#' contain each field
#'
#' @description
#' Returns a list of the fields that are included in log events in the
#' specified log group, along with the percentage of log events that
#' contain each field. The search is limited to a time period that you
#' specify.
#' 
#' In the results, fields that start with @@ are fields generated by
#' CloudWatch Logs. For example, `@@timestamp` is the timestamp of each log
#' event. For more information about the fields that are generated by
#' CloudWatch logs, see [Supported Logs and Discovered
#' Fields](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData-discoverable-fields.html).
#' 
#' The response results are sorted by the frequency percentage, starting
#' with the highest percentage.
#'
#' @usage
#' cloudwatchlogs_get_log_group_fields(logGroupName, time)
#'
#' @param logGroupName &#91;required&#93; The name of the log group to search.
#' @param time The time to set as the center of the query. If you specify `time`, the 8
#' minutes before and 8 minutes after this time are searched. If you omit
#' `time`, the past 15 minutes are queried.
#' 
#' The `time` value is specified as epoch time, the number of seconds since
#' January 1, 1970, 00:00:00 UTC.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   logGroupFields = list(
#'     list(
#'       name = "string",
#'       percent = 123
#'     )
#'   )
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$get_log_group_fields(
#'   logGroupName = "string",
#'   time = 123
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_get_log_group_fields
cloudwatchlogs_get_log_group_fields <- function(logGroupName, time = NULL) {
  op <- new_operation(
    name = "GetLogGroupFields",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$get_log_group_fields_input(logGroupName = logGroupName, time = time)
  output <- .cloudwatchlogs$get_log_group_fields_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$get_log_group_fields <- cloudwatchlogs_get_log_group_fields

#' Retrieves all of the fields and values of a single log event
#'
#' @description
#' Retrieves all of the fields and values of a single log event. All fields
#' are retrieved, even if the original query that produced the
#' `logRecordPointer` retrieved only a subset of fields. Fields are
#' returned as field name/field value pairs.
#' 
#' The full unparsed log event is returned within `@@message`.
#'
#' @usage
#' cloudwatchlogs_get_log_record(logRecordPointer)
#'
#' @param logRecordPointer &#91;required&#93; The pointer corresponding to the log event record you want to retrieve.
#' You get this from the response of a
#' [`get_query_results`][cloudwatchlogs_get_query_results] operation. In
#' that response, the value of the `@@ptr` field for a log event is the
#' value to use as `logRecordPointer` to retrieve that complete log event
#' record.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   logRecord = list(
#'     "string"
#'   )
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$get_log_record(
#'   logRecordPointer = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_get_log_record
cloudwatchlogs_get_log_record <- function(logRecordPointer) {
  op <- new_operation(
    name = "GetLogRecord",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$get_log_record_input(logRecordPointer = logRecordPointer)
  output <- .cloudwatchlogs$get_log_record_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$get_log_record <- cloudwatchlogs_get_log_record

#' Returns the results from the specified query
#'
#' @description
#' Returns the results from the specified query.
#' 
#' Only the fields requested in the query are returned, along with a `@@ptr`
#' field, which is the identifier for the log record. You can use the value
#' of `@@ptr` in a [`get_log_record`][cloudwatchlogs_get_log_record]
#' operation to get the full log record.
#' 
#' [`get_query_results`][cloudwatchlogs_get_query_results] does not start a
#' query execution. To run a query, use
#' [`start_query`][cloudwatchlogs_start_query].
#' 
#' If the value of the `Status` field in the output is `Running`, this
#' operation returns only partial results. If you see a value of
#' `Scheduled` or `Running` for the status, you can retry the operation
#' later to see the final results.
#'
#' @usage
#' cloudwatchlogs_get_query_results(queryId)
#'
#' @param queryId &#91;required&#93; The ID number of the query.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   results = list(
#'     list(
#'       list(
#'         field = "string",
#'         value = "string"
#'       )
#'     )
#'   ),
#'   statistics = list(
#'     recordsMatched = 123.0,
#'     recordsScanned = 123.0,
#'     bytesScanned = 123.0
#'   ),
#'   status = "Scheduled"|"Running"|"Complete"|"Failed"|"Cancelled"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$get_query_results(
#'   queryId = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_get_query_results
cloudwatchlogs_get_query_results <- function(queryId) {
  op <- new_operation(
    name = "GetQueryResults",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$get_query_results_input(queryId = queryId)
  output <- .cloudwatchlogs$get_query_results_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$get_query_results <- cloudwatchlogs_get_query_results

#' Lists the tags for the specified log group
#'
#' @description
#' Lists the tags for the specified log group.
#'
#' @usage
#' cloudwatchlogs_list_tags_log_group(logGroupName)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   tags = list(
#'     "string"
#'   )
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$list_tags_log_group(
#'   logGroupName = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_list_tags_log_group
cloudwatchlogs_list_tags_log_group <- function(logGroupName) {
  op <- new_operation(
    name = "ListTagsLogGroup",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$list_tags_log_group_input(logGroupName = logGroupName)
  output <- .cloudwatchlogs$list_tags_log_group_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$list_tags_log_group <- cloudwatchlogs_list_tags_log_group

#' Creates or updates a destination
#'
#' @description
#' Creates or updates a destination. This operation is used only to create
#' destinations for cross-account subscriptions.
#' 
#' A destination encapsulates a physical resource (such as an Amazon
#' Kinesis stream) and enables you to subscribe to a real-time stream of
#' log events for a different account, ingested using
#' [`put_log_events`][cloudwatchlogs_put_log_events].
#' 
#' Through an access policy, a destination controls what is written to it.
#' By default, [`put_destination`][cloudwatchlogs_put_destination] does not
#' set any access policy with the destination, which means a cross-account
#' user cannot call
#' [`put_subscription_filter`][cloudwatchlogs_put_subscription_filter]
#' against this destination. To enable this, the destination owner must
#' call [`put_destination_policy`][cloudwatchlogs_put_destination_policy]
#' after [`put_destination`][cloudwatchlogs_put_destination].
#' 
#' To perform a [`put_destination`][cloudwatchlogs_put_destination]
#' operation, you must also have the `iam:PassRole` permission.
#'
#' @usage
#' cloudwatchlogs_put_destination(destinationName, targetArn, roleArn)
#'
#' @param destinationName &#91;required&#93; A name for the destination.
#' @param targetArn &#91;required&#93; The ARN of an Amazon Kinesis stream to which to deliver matching log
#' events.
#' @param roleArn &#91;required&#93; The ARN of an IAM role that grants CloudWatch Logs permissions to call
#' the Amazon Kinesis `PutRecord` operation on the destination stream.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   destination = list(
#'     destinationName = "string",
#'     targetArn = "string",
#'     roleArn = "string",
#'     accessPolicy = "string",
#'     arn = "string",
#'     creationTime = 123
#'   )
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$put_destination(
#'   destinationName = "string",
#'   targetArn = "string",
#'   roleArn = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_put_destination
cloudwatchlogs_put_destination <- function(destinationName, targetArn, roleArn) {
  op <- new_operation(
    name = "PutDestination",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$put_destination_input(destinationName = destinationName, targetArn = targetArn, roleArn = roleArn)
  output <- .cloudwatchlogs$put_destination_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$put_destination <- cloudwatchlogs_put_destination

#' Creates or updates an access policy associated with an existing
#' destination
#'
#' @description
#' Creates or updates an access policy associated with an existing
#' destination. An access policy is an [IAM policy
#' document](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
#' that is used to authorize claims to register a subscription filter
#' against a given destination.
#'
#' @usage
#' cloudwatchlogs_put_destination_policy(destinationName, accessPolicy)
#'
#' @param destinationName &#91;required&#93; A name for an existing destination.
#' @param accessPolicy &#91;required&#93; An IAM policy document that authorizes cross-account users to deliver
#' their log events to the associated destination. This can be up to 5120
#' bytes.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$put_destination_policy(
#'   destinationName = "string",
#'   accessPolicy = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_put_destination_policy
cloudwatchlogs_put_destination_policy <- function(destinationName, accessPolicy) {
  op <- new_operation(
    name = "PutDestinationPolicy",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$put_destination_policy_input(destinationName = destinationName, accessPolicy = accessPolicy)
  output <- .cloudwatchlogs$put_destination_policy_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$put_destination_policy <- cloudwatchlogs_put_destination_policy

#' Uploads a batch of log events to the specified log stream
#'
#' @description
#' Uploads a batch of log events to the specified log stream.
#' 
#' You must include the sequence token obtained from the response of the
#' previous call. An upload in a newly created log stream does not require
#' a sequence token. You can also get the sequence token in the
#' `expectedSequenceToken` field from `InvalidSequenceTokenException`. If
#' you call [`put_log_events`][cloudwatchlogs_put_log_events] twice within
#' a narrow time period using the same value for `sequenceToken`, both
#' calls might be successful or one might be rejected.
#' 
#' The batch of events must satisfy the following constraints:
#' 
#' -   The maximum batch size is 1,048,576 bytes. This size is calculated
#'     as the sum of all event messages in UTF-8, plus 26 bytes for each
#'     log event.
#' 
#' -   None of the log events in the batch can be more than 2 hours in the
#'     future.
#' 
#' -   None of the log events in the batch can be older than 14 days or
#'     older than the retention period of the log group.
#' 
#' -   The log events in the batch must be in chronological order by their
#'     timestamp. The timestamp is the time the event occurred, expressed
#'     as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. (In
#'     AWS Tools for PowerShell and the AWS SDK for .NET, the timestamp is
#'     specified in .NET format: yyyy-mm-ddThh:mm:ss. For example,
#'     2017-09-15T13:45:30.)
#' 
#' -   A batch of log events in a single request cannot span more than 24
#'     hours. Otherwise, the operation fails.
#' 
#' -   The maximum number of log events in a batch is 10,000.
#' 
#' -   There is a quota of 5 requests per second per log stream. Additional
#'     requests are throttled. This quota can't be changed.
#' 
#' If a call to [`put_log_events`][cloudwatchlogs_put_log_events] returns
#' "UnrecognizedClientException" the most likely cause is an invalid AWS
#' access key ID or secret key.
#'
#' @usage
#' cloudwatchlogs_put_log_events(logGroupName, logStreamName, logEvents,
#'   sequenceToken)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param logStreamName &#91;required&#93; The name of the log stream.
#' @param logEvents &#91;required&#93; The log events.
#' @param sequenceToken The sequence token obtained from the response of the previous
#' [`put_log_events`][cloudwatchlogs_put_log_events] call. An upload in a
#' newly created log stream does not require a sequence token. You can also
#' get the sequence token using
#' [`describe_log_streams`][cloudwatchlogs_describe_log_streams]. If you
#' call [`put_log_events`][cloudwatchlogs_put_log_events] twice within a
#' narrow time period using the same value for `sequenceToken`, both calls
#' might be successful or one might be rejected.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   nextSequenceToken = "string",
#'   rejectedLogEventsInfo = list(
#'     tooNewLogEventStartIndex = 123,
#'     tooOldLogEventEndIndex = 123,
#'     expiredLogEventEndIndex = 123
#'   )
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$put_log_events(
#'   logGroupName = "string",
#'   logStreamName = "string",
#'   logEvents = list(
#'     list(
#'       timestamp = 123,
#'       message = "string"
#'     )
#'   ),
#'   sequenceToken = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_put_log_events
cloudwatchlogs_put_log_events <- function(logGroupName, logStreamName, logEvents, sequenceToken = NULL) {
  op <- new_operation(
    name = "PutLogEvents",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$put_log_events_input(logGroupName = logGroupName, logStreamName = logStreamName, logEvents = logEvents, sequenceToken = sequenceToken)
  output <- .cloudwatchlogs$put_log_events_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$put_log_events <- cloudwatchlogs_put_log_events

#' Creates or updates a metric filter and associates it with the specified
#' log group
#'
#' @description
#' Creates or updates a metric filter and associates it with the specified
#' log group. Metric filters allow you to configure rules to extract metric
#' data from log events ingested through
#' [`put_log_events`][cloudwatchlogs_put_log_events].
#' 
#' The maximum number of metric filters that can be associated with a log
#' group is 100.
#'
#' @usage
#' cloudwatchlogs_put_metric_filter(logGroupName, filterName,
#'   filterPattern, metricTransformations)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param filterName &#91;required&#93; A name for the metric filter.
#' @param filterPattern &#91;required&#93; A filter pattern for extracting metric data out of ingested log events.
#' @param metricTransformations &#91;required&#93; A collection of information that defines how metric data gets emitted.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$put_metric_filter(
#'   logGroupName = "string",
#'   filterName = "string",
#'   filterPattern = "string",
#'   metricTransformations = list(
#'     list(
#'       metricName = "string",
#'       metricNamespace = "string",
#'       metricValue = "string",
#'       defaultValue = 123.0
#'     )
#'   )
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_put_metric_filter
cloudwatchlogs_put_metric_filter <- function(logGroupName, filterName, filterPattern, metricTransformations) {
  op <- new_operation(
    name = "PutMetricFilter",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$put_metric_filter_input(logGroupName = logGroupName, filterName = filterName, filterPattern = filterPattern, metricTransformations = metricTransformations)
  output <- .cloudwatchlogs$put_metric_filter_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$put_metric_filter <- cloudwatchlogs_put_metric_filter

#' Creates or updates a query definition for CloudWatch Logs Insights
#'
#' @description
#' Creates or updates a query definition for CloudWatch Logs Insights. For
#' more information, see [Analyzing Log Data with CloudWatch Logs
#' Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html).
#' 
#' To update a query definition, specify its `queryDefinitionId` in your
#' request. The values of `name`, `queryString`, and `logGroupNames` are
#' changed to the values that you specify in your update operation. No
#' current values are retained from the current query definition. For
#' example, if you update a current query definition that includes log
#' groups, and you don't specify the `logGroupNames` parameter in your
#' update operation, the query definition changes to contain no log groups.
#' 
#' You must have the `logs:PutQueryDefinition` permission to be able to
#' perform this operation.
#'
#' @usage
#' cloudwatchlogs_put_query_definition(name, queryDefinitionId,
#'   logGroupNames, queryString)
#'
#' @param name &#91;required&#93; A name for the query definition. If you are saving a lot of query
#' definitions, we recommend that you name them so that you can easily find
#' the ones you want by using the first part of the name as a filter in the
#' `queryDefinitionNamePrefix` parameter of
#' [`describe_query_definitions`][cloudwatchlogs_describe_query_definitions].
#' @param queryDefinitionId If you are updating a query definition, use this parameter to specify
#' the ID of the query definition that you want to update. You can use
#' [`describe_query_definitions`][cloudwatchlogs_describe_query_definitions]
#' to retrieve the IDs of your saved query definitions.
#' 
#' If you are creating a query definition, do not specify this parameter.
#' CloudWatch generates a unique ID for the new query definition and
#' include it in the response to this operation.
#' @param logGroupNames Use this parameter to include specific log groups as part of your query
#' definition.
#' 
#' If you are updating a query definition and you omit this parameter, then
#' the updated definition will contain no log groups.
#' @param queryString &#91;required&#93; The query string to use for this definition. For more information, see
#' [CloudWatch Logs Insights Query
#' Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html).
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   queryDefinitionId = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$put_query_definition(
#'   name = "string",
#'   queryDefinitionId = "string",
#'   logGroupNames = list(
#'     "string"
#'   ),
#'   queryString = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_put_query_definition
cloudwatchlogs_put_query_definition <- function(name, queryDefinitionId = NULL, logGroupNames = NULL, queryString) {
  op <- new_operation(
    name = "PutQueryDefinition",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$put_query_definition_input(name = name, queryDefinitionId = queryDefinitionId, logGroupNames = logGroupNames, queryString = queryString)
  output <- .cloudwatchlogs$put_query_definition_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$put_query_definition <- cloudwatchlogs_put_query_definition

#' Creates or updates a resource policy allowing other AWS services to put
#' log events to this account, such as Amazon Route 53
#'
#' @description
#' Creates or updates a resource policy allowing other AWS services to put
#' log events to this account, such as Amazon Route 53. An account can have
#' up to 10 resource policies per AWS Region.
#'
#' @usage
#' cloudwatchlogs_put_resource_policy(policyName, policyDocument)
#'
#' @param policyName Name of the new policy. This parameter is required.
#' @param policyDocument Details of the new policy, including the identity of the principal that
#' is enabled to put logs to this account. This is formatted as a JSON
#' string. This parameter is required.
#' 
#' The following example creates a resource policy enabling the Route 53
#' service to put DNS query logs in to the specified log group. Replace
#' `"logArn"` with the ARN of your CloudWatch Logs resource, such as a log
#' group or log stream.
#' 
#' `{ "Version": "2012-10-17", "Statement": [ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": [ "route53.amazonaws.com" ] }, "Action":"logs:PutLogEvents", "Resource": "logArn" } ] } `
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   resourcePolicy = list(
#'     policyName = "string",
#'     policyDocument = "string",
#'     lastUpdatedTime = 123
#'   )
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$put_resource_policy(
#'   policyName = "string",
#'   policyDocument = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_put_resource_policy
cloudwatchlogs_put_resource_policy <- function(policyName = NULL, policyDocument = NULL) {
  op <- new_operation(
    name = "PutResourcePolicy",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$put_resource_policy_input(policyName = policyName, policyDocument = policyDocument)
  output <- .cloudwatchlogs$put_resource_policy_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$put_resource_policy <- cloudwatchlogs_put_resource_policy

#' Sets the retention of the specified log group
#'
#' @description
#' Sets the retention of the specified log group. A retention policy allows
#' you to configure the number of days for which to retain log events in
#' the specified log group.
#'
#' @usage
#' cloudwatchlogs_put_retention_policy(logGroupName, retentionInDays)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param retentionInDays &#91;required&#93; 
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$put_retention_policy(
#'   logGroupName = "string",
#'   retentionInDays = 123
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_put_retention_policy
cloudwatchlogs_put_retention_policy <- function(logGroupName, retentionInDays) {
  op <- new_operation(
    name = "PutRetentionPolicy",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$put_retention_policy_input(logGroupName = logGroupName, retentionInDays = retentionInDays)
  output <- .cloudwatchlogs$put_retention_policy_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$put_retention_policy <- cloudwatchlogs_put_retention_policy

#' Creates or updates a subscription filter and associates it with the
#' specified log group
#'
#' @description
#' Creates or updates a subscription filter and associates it with the
#' specified log group. Subscription filters allow you to subscribe to a
#' real-time stream of log events ingested through
#' [`put_log_events`][cloudwatchlogs_put_log_events] and have them
#' delivered to a specific destination. When log events are sent to the
#' receiving service, they are Base64 encoded and compressed with the gzip
#' format.
#' 
#' The following destinations are supported for subscription filters:
#' 
#' -   An Amazon Kinesis stream belonging to the same account as the
#'     subscription filter, for same-account delivery.
#' 
#' -   A logical destination that belongs to a different account, for
#'     cross-account delivery.
#' 
#' -   An Amazon Kinesis Firehose delivery stream that belongs to the same
#'     account as the subscription filter, for same-account delivery.
#' 
#' -   An AWS Lambda function that belongs to the same account as the
#'     subscription filter, for same-account delivery.
#' 
#' There can only be one subscription filter associated with a log group.
#' If you are updating an existing filter, you must specify the correct
#' name in `filterName`. Otherwise, the call fails because you cannot
#' associate a second filter with a log group.
#' 
#' To perform a
#' [`put_subscription_filter`][cloudwatchlogs_put_subscription_filter]
#' operation, you must also have the `iam:PassRole` permission.
#'
#' @usage
#' cloudwatchlogs_put_subscription_filter(logGroupName, filterName,
#'   filterPattern, destinationArn, roleArn, distribution)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param filterName &#91;required&#93; A name for the subscription filter. If you are updating an existing
#' filter, you must specify the correct name in `filterName`. Otherwise,
#' the call fails because you cannot associate a second filter with a log
#' group. To find the name of the filter currently associated with a log
#' group, use
#' [`describe_subscription_filters`][cloudwatchlogs_describe_subscription_filters].
#' @param filterPattern &#91;required&#93; A filter pattern for subscribing to a filtered stream of log events.
#' @param destinationArn &#91;required&#93; The ARN of the destination to deliver matching log events to. Currently,
#' the supported destinations are:
#' 
#' -   An Amazon Kinesis stream belonging to the same account as the
#'     subscription filter, for same-account delivery.
#' 
#' -   A logical destination (specified using an ARN) belonging to a
#'     different account, for cross-account delivery.
#' 
#' -   An Amazon Kinesis Firehose delivery stream belonging to the same
#'     account as the subscription filter, for same-account delivery.
#' 
#' -   An AWS Lambda function belonging to the same account as the
#'     subscription filter, for same-account delivery.
#' @param roleArn The ARN of an IAM role that grants CloudWatch Logs permissions to
#' deliver ingested log events to the destination stream. You don't need to
#' provide the ARN when you are working with a logical destination for
#' cross-account delivery.
#' @param distribution The method used to distribute log data to the destination. By default,
#' log data is grouped by log stream, but the grouping can be set to random
#' for a more even distribution. This property is only applicable when the
#' destination is an Amazon Kinesis stream.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$put_subscription_filter(
#'   logGroupName = "string",
#'   filterName = "string",
#'   filterPattern = "string",
#'   destinationArn = "string",
#'   roleArn = "string",
#'   distribution = "Random"|"ByLogStream"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_put_subscription_filter
cloudwatchlogs_put_subscription_filter <- function(logGroupName, filterName, filterPattern, destinationArn, roleArn = NULL, distribution = NULL) {
  op <- new_operation(
    name = "PutSubscriptionFilter",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$put_subscription_filter_input(logGroupName = logGroupName, filterName = filterName, filterPattern = filterPattern, destinationArn = destinationArn, roleArn = roleArn, distribution = distribution)
  output <- .cloudwatchlogs$put_subscription_filter_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$put_subscription_filter <- cloudwatchlogs_put_subscription_filter

#' Schedules a query of a log group using CloudWatch Logs Insights
#'
#' @description
#' Schedules a query of a log group using CloudWatch Logs Insights. You
#' specify the log group and time range to query and the query string to
#' use.
#' 
#' For more information, see [CloudWatch Logs Insights Query
#' Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html).
#' 
#' Queries time out after 15 minutes of execution. If your queries are
#' timing out, reduce the time range being searched or partition your query
#' into a number of queries.
#'
#' @usage
#' cloudwatchlogs_start_query(logGroupName, logGroupNames, startTime,
#'   endTime, queryString, limit)
#'
#' @param logGroupName The log group on which to perform the query.
#' 
#' A [`start_query`][cloudwatchlogs_start_query] operation must include a
#' `logGroupNames` or a `logGroupName` parameter, but not both.
#' @param logGroupNames The list of log groups to be queried. You can include up to 20 log
#' groups.
#' 
#' A [`start_query`][cloudwatchlogs_start_query] operation must include a
#' `logGroupNames` or a `logGroupName` parameter, but not both.
#' @param startTime &#91;required&#93; The beginning of the time range to query. The range is inclusive, so the
#' specified start time is included in the query. Specified as epoch time,
#' the number of seconds since January 1, 1970, 00:00:00 UTC.
#' @param endTime &#91;required&#93; The end of the time range to query. The range is inclusive, so the
#' specified end time is included in the query. Specified as epoch time,
#' the number of seconds since January 1, 1970, 00:00:00 UTC.
#' @param queryString &#91;required&#93; The query string to use. For more information, see [CloudWatch Logs
#' Insights Query
#' Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html).
#' @param limit The maximum number of log events to return in the query. If the query
#' string uses the `fields` command, only the specified fields and their
#' values are returned. The default is 1000.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   queryId = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$start_query(
#'   logGroupName = "string",
#'   logGroupNames = list(
#'     "string"
#'   ),
#'   startTime = 123,
#'   endTime = 123,
#'   queryString = "string",
#'   limit = 123
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_start_query
cloudwatchlogs_start_query <- function(logGroupName = NULL, logGroupNames = NULL, startTime, endTime, queryString, limit = NULL) {
  op <- new_operation(
    name = "StartQuery",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$start_query_input(logGroupName = logGroupName, logGroupNames = logGroupNames, startTime = startTime, endTime = endTime, queryString = queryString, limit = limit)
  output <- .cloudwatchlogs$start_query_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$start_query <- cloudwatchlogs_start_query

#' Stops a CloudWatch Logs Insights query that is in progress
#'
#' @description
#' Stops a CloudWatch Logs Insights query that is in progress. If the query
#' has already ended, the operation returns an error indicating that the
#' specified query is not running.
#'
#' @usage
#' cloudwatchlogs_stop_query(queryId)
#'
#' @param queryId &#91;required&#93; The ID number of the query to stop. To find this ID number, use
#' [`describe_queries`][cloudwatchlogs_describe_queries].
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   success = TRUE|FALSE
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$stop_query(
#'   queryId = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_stop_query
cloudwatchlogs_stop_query <- function(queryId) {
  op <- new_operation(
    name = "StopQuery",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$stop_query_input(queryId = queryId)
  output <- .cloudwatchlogs$stop_query_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$stop_query <- cloudwatchlogs_stop_query

#' Adds or updates the specified tags for the specified log group
#'
#' @description
#' Adds or updates the specified tags for the specified log group.
#' 
#' To list the tags for a log group, use
#' [`list_tags_log_group`][cloudwatchlogs_list_tags_log_group]. To remove
#' tags, use [`untag_log_group`][cloudwatchlogs_untag_log_group].
#' 
#' For more information about tags, see [Tag Log Groups in Amazon
#' CloudWatch
#' Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#log-group-tagging)
#' in the *Amazon CloudWatch Logs User Guide*.
#'
#' @usage
#' cloudwatchlogs_tag_log_group(logGroupName, tags)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param tags &#91;required&#93; The key-value pairs to use for the tags.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$tag_log_group(
#'   logGroupName = "string",
#'   tags = list(
#'     "string"
#'   )
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_tag_log_group
cloudwatchlogs_tag_log_group <- function(logGroupName, tags) {
  op <- new_operation(
    name = "TagLogGroup",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$tag_log_group_input(logGroupName = logGroupName, tags = tags)
  output <- .cloudwatchlogs$tag_log_group_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$tag_log_group <- cloudwatchlogs_tag_log_group

#' Tests the filter pattern of a metric filter against a sample of log
#' event messages
#'
#' @description
#' Tests the filter pattern of a metric filter against a sample of log
#' event messages. You can use this operation to validate the correctness
#' of a metric filter pattern.
#'
#' @usage
#' cloudwatchlogs_test_metric_filter(filterPattern, logEventMessages)
#'
#' @param filterPattern &#91;required&#93; 
#' @param logEventMessages &#91;required&#93; The log event messages to test.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   matches = list(
#'     list(
#'       eventNumber = 123,
#'       eventMessage = "string",
#'       extractedValues = list(
#'         "string"
#'       )
#'     )
#'   )
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$test_metric_filter(
#'   filterPattern = "string",
#'   logEventMessages = list(
#'     "string"
#'   )
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_test_metric_filter
cloudwatchlogs_test_metric_filter <- function(filterPattern, logEventMessages) {
  op <- new_operation(
    name = "TestMetricFilter",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$test_metric_filter_input(filterPattern = filterPattern, logEventMessages = logEventMessages)
  output <- .cloudwatchlogs$test_metric_filter_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$test_metric_filter <- cloudwatchlogs_test_metric_filter

#' Removes the specified tags from the specified log group
#'
#' @description
#' Removes the specified tags from the specified log group.
#' 
#' To list the tags for a log group, use
#' [`list_tags_log_group`][cloudwatchlogs_list_tags_log_group]. To add
#' tags, use [`tag_log_group`][cloudwatchlogs_tag_log_group].
#'
#' @usage
#' cloudwatchlogs_untag_log_group(logGroupName, tags)
#'
#' @param logGroupName &#91;required&#93; The name of the log group.
#' @param tags &#91;required&#93; The tag keys. The corresponding tags are removed from the log group.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$untag_log_group(
#'   logGroupName = "string",
#'   tags = list(
#'     "string"
#'   )
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname cloudwatchlogs_untag_log_group
cloudwatchlogs_untag_log_group <- function(logGroupName, tags) {
  op <- new_operation(
    name = "UntagLogGroup",
    http_method = "POST",
    http_path = "/",
    paginator = list()
  )
  input <- .cloudwatchlogs$untag_log_group_input(logGroupName = logGroupName, tags = tags)
  output <- .cloudwatchlogs$untag_log_group_output()
  config <- get_config()
  svc <- .cloudwatchlogs$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.cloudwatchlogs$operations$untag_log_group <- cloudwatchlogs_untag_log_group

Try the paws.management package in your browser

Any scripts or data that you put into this service are public.

paws.management documentation built on Aug. 23, 2021, 9:11 a.m.