# WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
# See https://github.com/aws-beam/aws-codegen for more details.

defmodule AWS.LookoutMetrics do
  @moduledoc """
  This is the *Amazon Lookout for Metrics API Reference*.

  For an introduction to the service
  with tutorials for getting started, visit [Amazon Lookout for Metrics Developer
  Guide](https://docs.aws.amazon.com/lookoutmetrics/latest/dev).
  """

  alias AWS.Client
  alias AWS.Request

  @typedoc """

  ## Example:

      get_data_quality_metrics_response() :: %{
        "AnomalyDetectorDataQualityMetricList" => list(anomaly_detector_data_quality_metric())
      }

  """
  @type get_data_quality_metrics_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      anomaly_detector_config_summary() :: %{
        "AnomalyDetectorFrequency" => list(any())
      }

  """
  @type anomaly_detector_config_summary() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      detected_csv_format_descriptor() :: %{
        "Charset" => detected_field(),
        "ContainsHeader" => detected_field(),
        "Delimiter" => detected_field(),
        "FileCompression" => detected_field(),
        "HeaderList" => detected_field(),
        "QuoteSymbol" => detected_field()
      }

  """
  @type detected_csv_format_descriptor() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      activate_anomaly_detector_response() :: %{}

  """
  @type activate_anomaly_detector_response() :: %{}

  @typedoc """

  ## Example:

      put_feedback_request() :: %{
        required("AnomalyDetectorArn") => String.t() | atom(),
        required("AnomalyGroupTimeSeriesFeedback") => anomaly_group_time_series_feedback()
      }

  """
  @type put_feedback_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      inter_metric_impact_details() :: %{
        "AnomalyGroupId" => String.t() | atom(),
        "ContributionPercentage" => float(),
        "MetricName" => String.t() | atom(),
        "RelationshipType" => list(any())
      }

  """
  @type inter_metric_impact_details() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      update_metric_set_request() :: %{
        optional("DimensionFilterList") => list(metric_set_dimension_filter()),
        optional("DimensionList") => list(String.t() | atom()),
        optional("MetricList") => list(metric()),
        optional("MetricSetDescription") => String.t() | atom(),
        optional("MetricSetFrequency") => list(any()),
        optional("MetricSource") => metric_source(),
        optional("Offset") => integer(),
        optional("TimestampColumn") => timestamp_column(),
        required("MetricSetArn") => String.t() | atom()
      }

  """
  @type update_metric_set_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      tag_resource_request() :: %{
        required("Tags") => map()
      }

  """
  @type tag_resource_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      dimension_contribution() :: %{
        "DimensionName" => String.t() | atom(),
        "DimensionValueContributionList" => list(dimension_value_contribution())
      }

  """
  @type dimension_contribution() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_anomaly_group_summaries_response() :: %{
        "AnomalyGroupStatistics" => anomaly_group_statistics(),
        "AnomalyGroupSummaryList" => list(anomaly_group_summary()),
        "NextToken" => String.t() | atom()
      }

  """
  @type list_anomaly_group_summaries_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      detected_field() :: %{
        "Confidence" => list(any()),
        "Message" => String.t() | atom(),
        "Value" => attribute_value()
      }

  """
  @type detected_field() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      anomaly_group() :: %{
        "AnomalyGroupId" => String.t() | atom(),
        "AnomalyGroupScore" => float(),
        "EndTime" => String.t() | atom(),
        "MetricLevelImpactList" => list(metric_level_impact()),
        "PrimaryMetricName" => String.t() | atom(),
        "StartTime" => String.t() | atom()
      }

  """
  @type anomaly_group() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      vpc_configuration() :: %{
        "SecurityGroupIdList" => list(String.t() | atom()),
        "SubnetIdList" => list(String.t() | atom())
      }

  """
  @type vpc_configuration() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_metric_sets_response() :: %{
        "MetricSetSummaryList" => list(metric_set_summary()),
        "NextToken" => String.t() | atom()
      }

  """
  @type list_metric_sets_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      describe_alert_request() :: %{
        required("AlertArn") => String.t() | atom()
      }

  """
  @type describe_alert_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      anomaly_group_time_series() :: %{
        "AnomalyGroupId" => String.t() | atom(),
        "TimeSeriesId" => String.t() | atom()
      }

  """
  @type anomaly_group_time_series() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      metric_set_summary() :: %{
        "AnomalyDetectorArn" => String.t() | atom(),
        "CreationTime" => non_neg_integer(),
        "LastModificationTime" => non_neg_integer(),
        "MetricSetArn" => String.t() | atom(),
        "MetricSetDescription" => String.t() | atom(),
        "MetricSetName" => String.t() | atom(),
        "Tags" => map()
      }

  """
  @type metric_set_summary() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_metric_sets_request() :: %{
        optional("AnomalyDetectorArn") => String.t() | atom(),
        optional("MaxResults") => integer(),
        optional("NextToken") => String.t() | atom()
      }

  """
  @type list_metric_sets_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      deactivate_anomaly_detector_request() :: %{
        required("AnomalyDetectorArn") => String.t() | atom()
      }

  """
  @type deactivate_anomaly_detector_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      untag_resource_response() :: %{}

  """
  @type untag_resource_response() :: %{}

  @typedoc """

  ## Example:

      metric() :: %{
        "AggregationFunction" => list(any()),
        "MetricName" => String.t() | atom(),
        "Namespace" => String.t() | atom()
      }

  """
  @type metric() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      detected_file_format_descriptor() :: %{
        "CsvFormatDescriptor" => detected_csv_format_descriptor(),
        "JsonFormatDescriptor" => detected_json_format_descriptor()
      }

  """
  @type detected_file_format_descriptor() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      detected_json_format_descriptor() :: %{
        "Charset" => detected_field(),
        "FileCompression" => detected_field()
      }

  """
  @type detected_json_format_descriptor() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_alerts_request() :: %{
        optional("AnomalyDetectorArn") => String.t() | atom(),
        optional("MaxResults") => integer(),
        optional("NextToken") => String.t() | atom()
      }

  """
  @type list_alerts_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      metric_set_dimension_filter() :: %{
        "FilterList" => list(filter()),
        "Name" => String.t() | atom()
      }

  """
  @type metric_set_dimension_filter() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      dimension_name_value() :: %{
        "DimensionName" => String.t() | atom(),
        "DimensionValue" => String.t() | atom()
      }

  """
  @type dimension_name_value() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      detect_metric_set_config_request() :: %{
        required("AnomalyDetectorArn") => String.t() | atom(),
        required("AutoDetectionMetricSource") => auto_detection_metric_source()
      }

  """
  @type detect_metric_set_config_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      cloud_watch_config() :: %{
        "BackTestConfiguration" => back_test_configuration(),
        "RoleArn" => String.t() | atom()
      }

  """
  @type cloud_watch_config() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      put_feedback_response() :: %{}

  """
  @type put_feedback_response() :: %{}

  @typedoc """

  ## Example:

      untag_resource_request() :: %{
        required("TagKeys") => list(String.t() | atom())
      }

  """
  @type untag_resource_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      too_many_requests_exception() :: %{
        "Message" => String.t() | atom()
      }

  """
  @type too_many_requests_exception() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      execution_status() :: %{
        "FailureReason" => String.t() | atom(),
        "Status" => list(any()),
        "Timestamp" => String.t() | atom()
      }

  """
  @type execution_status() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_anomaly_group_time_series_request() :: %{
        optional("MaxResults") => integer(),
        optional("NextToken") => String.t() | atom(),
        required("AnomalyDetectorArn") => String.t() | atom(),
        required("AnomalyGroupId") => String.t() | atom(),
        required("MetricName") => String.t() | atom()
      }

  """
  @type list_anomaly_group_time_series_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      auto_detection_s3_source_config() :: %{
        "HistoricalDataPathList" => list(String.t() | atom()),
        "TemplatedPathList" => list(String.t() | atom())
      }

  """
  @type auto_detection_s3_source_config() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      json_format_descriptor() :: %{
        "Charset" => String.t() | atom(),
        "FileCompression" => list(any())
      }

  """
  @type json_format_descriptor() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      anomaly_group_time_series_feedback() :: %{
        "AnomalyGroupId" => String.t() | atom(),
        "IsAnomaly" => boolean(),
        "TimeSeriesId" => String.t() | atom()
      }

  """
  @type anomaly_group_time_series_feedback() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_sample_data_response() :: %{
        "HeaderValues" => list(String.t() | atom()),
        "SampleRows" => list(list(String.t() | atom())())
      }

  """
  @type get_sample_data_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_sample_data_request() :: %{
        optional("S3SourceConfig") => sample_data_s3_source_config()
      }

  """
  @type get_sample_data_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      redshift_source_config() :: %{
        "ClusterIdentifier" => String.t() | atom(),
        "DatabaseHost" => String.t() | atom(),
        "DatabaseName" => String.t() | atom(),
        "DatabasePort" => integer(),
        "RoleArn" => String.t() | atom(),
        "SecretManagerArn" => String.t() | atom(),
        "TableName" => String.t() | atom(),
        "VpcConfiguration" => vpc_configuration()
      }

  """
  @type redshift_source_config() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      describe_metric_set_request() :: %{
        required("MetricSetArn") => String.t() | atom()
      }

  """
  @type describe_metric_set_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_anomaly_group_related_metrics_request() :: %{
        optional("MaxResults") => integer(),
        optional("NextToken") => String.t() | atom(),
        optional("RelationshipTypeFilter") => list(any()),
        required("AnomalyDetectorArn") => String.t() | atom(),
        required("AnomalyGroupId") => String.t() | atom()
      }

  """
  @type list_anomaly_group_related_metrics_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      anomaly_detector_data_quality_metric() :: %{
        "MetricSetDataQualityMetricList" => list(metric_set_data_quality_metric()),
        "StartTimestamp" => non_neg_integer()
      }

  """
  @type anomaly_detector_data_quality_metric() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      timestamp_column() :: %{
        "ColumnFormat" => String.t() | atom(),
        "ColumnName" => String.t() | atom()
      }

  """
  @type timestamp_column() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      conflict_exception() :: %{
        "Message" => String.t() | atom(),
        "ResourceId" => String.t() | atom(),
        "ResourceType" => String.t() | atom()
      }

  """
  @type conflict_exception() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      resource_not_found_exception() :: %{
        "Message" => String.t() | atom(),
        "ResourceId" => String.t() | atom(),
        "ResourceType" => String.t() | atom()
      }

  """
  @type resource_not_found_exception() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      back_test_configuration() :: %{
        "RunBackTestMode" => boolean()
      }

  """
  @type back_test_configuration() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      back_test_anomaly_detector_response() :: %{}

  """
  @type back_test_anomaly_detector_response() :: %{}

  @typedoc """

  ## Example:

      describe_alert_response() :: %{
        "Alert" => alert()
      }

  """
  @type describe_alert_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      metric_set_data_quality_metric() :: %{
        "DataQualityMetricList" => list(data_quality_metric()),
        "MetricSetArn" => String.t() | atom()
      }

  """
  @type metric_set_data_quality_metric() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      metric_source() :: %{
        "AppFlowConfig" => app_flow_config(),
        "AthenaSourceConfig" => athena_source_config(),
        "CloudWatchConfig" => cloud_watch_config(),
        "RDSSourceConfig" => rds_source_config(),
        "RedshiftSourceConfig" => redshift_source_config(),
        "S3SourceConfig" => s3_source_config()
      }

  """
  @type metric_source() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      describe_anomaly_detector_response() :: %{
        "AnomalyDetectorArn" => String.t() | atom(),
        "AnomalyDetectorConfig" => anomaly_detector_config_summary(),
        "AnomalyDetectorDescription" => String.t() | atom(),
        "AnomalyDetectorName" => String.t() | atom(),
        "CreationTime" => non_neg_integer(),
        "FailureReason" => String.t() | atom(),
        "FailureType" => list(any()),
        "KmsKeyArn" => String.t() | atom(),
        "LastModificationTime" => non_neg_integer(),
        "Status" => list(any())
      }

  """
  @type describe_anomaly_detector_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      csv_format_descriptor() :: %{
        "Charset" => String.t() | atom(),
        "ContainsHeader" => boolean(),
        "Delimiter" => String.t() | atom(),
        "FileCompression" => list(any()),
        "HeaderList" => list(String.t() | atom()),
        "QuoteSymbol" => String.t() | atom()
      }

  """
  @type csv_format_descriptor() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      file_format_descriptor() :: %{
        "CsvFormatDescriptor" => csv_format_descriptor(),
        "JsonFormatDescriptor" => json_format_descriptor()
      }

  """
  @type file_format_descriptor() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      service_quota_exceeded_exception() :: %{
        "Message" => String.t() | atom(),
        "QuotaCode" => String.t() | atom(),
        "ResourceId" => String.t() | atom(),
        "ResourceType" => String.t() | atom(),
        "ServiceCode" => String.t() | atom()
      }

  """
  @type service_quota_exceeded_exception() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      delete_anomaly_detector_response() :: %{}

  """
  @type delete_anomaly_detector_response() :: %{}

  @typedoc """

  ## Example:

      sample_data_s3_source_config() :: %{
        "FileFormatDescriptor" => file_format_descriptor(),
        "HistoricalDataPathList" => list(String.t() | atom()),
        "RoleArn" => String.t() | atom(),
        "TemplatedPathList" => list(String.t() | atom())
      }

  """
  @type sample_data_s3_source_config() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      app_flow_config() :: %{
        "FlowName" => String.t() | atom(),
        "RoleArn" => String.t() | atom()
      }

  """
  @type app_flow_config() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      time_series() :: %{
        "DimensionList" => list(dimension_name_value()),
        "MetricValueList" => list(float()),
        "TimeSeriesId" => String.t() | atom()
      }

  """
  @type time_series() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      activate_anomaly_detector_request() :: %{
        required("AnomalyDetectorArn") => String.t() | atom()
      }

  """
  @type activate_anomaly_detector_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      alert_summary() :: %{
        "AlertArn" => String.t() | atom(),
        "AlertName" => String.t() | atom(),
        "AlertSensitivityThreshold" => integer(),
        "AlertStatus" => list(any()),
        "AlertType" => list(any()),
        "AnomalyDetectorArn" => String.t() | atom(),
        "CreationTime" => non_neg_integer(),
        "LastModificationTime" => non_neg_integer(),
        "Tags" => map()
      }

  """
  @type alert_summary() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      detected_s3_source_config() :: %{
        "FileFormatDescriptor" => detected_file_format_descriptor()
      }

  """
  @type detected_s3_source_config() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      delete_alert_request() :: %{
        required("AlertArn") => String.t() | atom()
      }

  """
  @type delete_alert_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      create_alert_response() :: %{
        "AlertArn" => String.t() | atom()
      }

  """
  @type create_alert_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_anomaly_group_summaries_request() :: %{
        optional("MaxResults") => integer(),
        optional("NextToken") => String.t() | atom(),
        required("AnomalyDetectorArn") => String.t() | atom(),
        required("SensitivityThreshold") => integer()
      }

  """
  @type list_anomaly_group_summaries_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_tags_for_resource_response() :: %{
        "Tags" => map()
      }

  """
  @type list_tags_for_resource_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      itemized_metric_stats() :: %{
        "MetricName" => String.t() | atom(),
        "OccurrenceCount" => integer()
      }

  """
  @type itemized_metric_stats() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      validation_exception_field() :: %{
        "Message" => String.t() | atom(),
        "Name" => String.t() | atom()
      }

  """
  @type validation_exception_field() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      create_anomaly_detector_response() :: %{
        "AnomalyDetectorArn" => String.t() | atom()
      }

  """
  @type create_anomaly_detector_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      attribute_value() :: %{
        "B" => String.t() | atom(),
        "BS" => list(String.t() | atom()),
        "N" => String.t() | atom(),
        "NS" => list(String.t() | atom()),
        "S" => String.t() | atom(),
        "SS" => list(String.t() | atom())
      }

  """
  @type attribute_value() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      create_alert_request() :: %{
        optional("AlertDescription") => String.t() | atom(),
        optional("AlertFilters") => alert_filters(),
        optional("AlertSensitivityThreshold") => integer(),
        optional("Tags") => map(),
        required("Action") => action(),
        required("AlertName") => String.t() | atom(),
        required("AnomalyDetectorArn") => String.t() | atom()
      }

  """
  @type create_alert_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      filter() :: %{
        "DimensionValue" => String.t() | atom(),
        "FilterOperation" => list(any())
      }

  """
  @type filter() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      dimension_value_contribution() :: %{
        "ContributionScore" => float(),
        "DimensionValue" => String.t() | atom()
      }

  """
  @type dimension_value_contribution() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      s3_source_config() :: %{
        "FileFormatDescriptor" => file_format_descriptor(),
        "HistoricalDataPathList" => list(String.t() | atom()),
        "RoleArn" => String.t() | atom(),
        "TemplatedPathList" => list(String.t() | atom())
      }

  """
  @type s3_source_config() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_anomaly_group_request() :: %{
        required("AnomalyDetectorArn") => String.t() | atom(),
        required("AnomalyGroupId") => String.t() | atom()
      }

  """
  @type get_anomaly_group_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_feedback_request() :: %{
        optional("MaxResults") => integer(),
        optional("NextToken") => String.t() | atom(),
        required("AnomalyDetectorArn") => String.t() | atom(),
        required("AnomalyGroupTimeSeriesFeedback") => anomaly_group_time_series()
      }

  """
  @type get_feedback_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_anomaly_group_related_metrics_response() :: %{
        "InterMetricImpactList" => list(inter_metric_impact_details()),
        "NextToken" => String.t() | atom()
      }

  """
  @type list_anomaly_group_related_metrics_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      athena_source_config() :: %{
        "BackTestConfiguration" => back_test_configuration(),
        "DataCatalog" => String.t() | atom(),
        "DatabaseName" => String.t() | atom(),
        "RoleArn" => String.t() | atom(),
        "S3ResultsPath" => String.t() | atom(),
        "TableName" => String.t() | atom(),
        "WorkGroupName" => String.t() | atom()
      }

  """
  @type athena_source_config() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      internal_server_exception() :: %{
        "Message" => String.t() | atom()
      }

  """
  @type internal_server_exception() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      anomaly_detector_summary() :: %{
        "AnomalyDetectorArn" => String.t() | atom(),
        "AnomalyDetectorDescription" => String.t() | atom(),
        "AnomalyDetectorName" => String.t() | atom(),
        "CreationTime" => non_neg_integer(),
        "LastModificationTime" => non_neg_integer(),
        "Status" => list(any()),
        "Tags" => map()
      }

  """
  @type anomaly_detector_summary() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      rds_source_config() :: %{
        "DBInstanceIdentifier" => String.t() | atom(),
        "DatabaseHost" => String.t() | atom(),
        "DatabaseName" => String.t() | atom(),
        "DatabasePort" => integer(),
        "RoleArn" => String.t() | atom(),
        "SecretManagerArn" => String.t() | atom(),
        "TableName" => String.t() | atom(),
        "VpcConfiguration" => vpc_configuration()
      }

  """
  @type rds_source_config() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      auto_detection_metric_source() :: %{
        "S3SourceConfig" => auto_detection_s3_source_config()
      }

  """
  @type auto_detection_metric_source() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      action() :: %{
        "LambdaConfiguration" => lambda_configuration(),
        "SNSConfiguration" => s_n_s_configuration()
      }

  """
  @type action() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_anomaly_group_time_series_response() :: %{
        "AnomalyGroupId" => String.t() | atom(),
        "MetricName" => String.t() | atom(),
        "NextToken" => String.t() | atom(),
        "TimeSeriesList" => list(time_series()),
        "TimestampList" => list(String.t() | atom())
      }

  """
  @type list_anomaly_group_time_series_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      describe_anomaly_detection_executions_response() :: %{
        "ExecutionList" => list(execution_status()),
        "NextToken" => String.t() | atom()
      }

  """
  @type describe_anomaly_detection_executions_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      update_metric_set_response() :: %{
        "MetricSetArn" => String.t() | atom()
      }

  """
  @type update_metric_set_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      lambda_configuration() :: %{
        "LambdaArn" => String.t() | atom(),
        "RoleArn" => String.t() | atom()
      }

  """
  @type lambda_configuration() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      access_denied_exception() :: %{
        "Message" => String.t() | atom()
      }

  """
  @type access_denied_exception() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      tag_resource_response() :: %{}

  """
  @type tag_resource_response() :: %{}

  @typedoc """

  ## Example:

      s_n_s_configuration() :: %{
        "RoleArn" => String.t() | atom(),
        "SnsFormat" => list(any()),
        "SnsTopicArn" => String.t() | atom()
      }

  """
  @type s_n_s_configuration() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_feedback_response() :: %{
        "AnomalyGroupTimeSeriesFeedback" => list(time_series_feedback()),
        "NextToken" => String.t() | atom()
      }

  """
  @type get_feedback_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_anomaly_group_response() :: %{
        "AnomalyGroup" => anomaly_group()
      }

  """
  @type get_anomaly_group_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      delete_alert_response() :: %{}

  """
  @type delete_alert_response() :: %{}

  @typedoc """

  ## Example:

      describe_metric_set_response() :: %{
        "AnomalyDetectorArn" => String.t() | atom(),
        "CreationTime" => non_neg_integer(),
        "DimensionFilterList" => list(metric_set_dimension_filter()),
        "DimensionList" => list(String.t() | atom()),
        "LastModificationTime" => non_neg_integer(),
        "MetricList" => list(metric()),
        "MetricSetArn" => String.t() | atom(),
        "MetricSetDescription" => String.t() | atom(),
        "MetricSetFrequency" => list(any()),
        "MetricSetName" => String.t() | atom(),
        "MetricSource" => metric_source(),
        "Offset" => integer(),
        "TimestampColumn" => timestamp_column(),
        "Timezone" => String.t() | atom()
      }

  """
  @type describe_metric_set_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      contribution_matrix() :: %{
        "DimensionContributionList" => list(dimension_contribution())
      }

  """
  @type contribution_matrix() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      detected_metric_set_config() :: %{
        "MetricSetFrequency" => detected_field(),
        "MetricSource" => detected_metric_source(),
        "Offset" => detected_field()
      }

  """
  @type detected_metric_set_config() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      validation_exception() :: %{
        "Fields" => list(validation_exception_field()),
        "Message" => String.t() | atom(),
        "Reason" => list(any())
      }

  """
  @type validation_exception() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_tags_for_resource_request() :: %{}

  """
  @type list_tags_for_resource_request() :: %{}

  @typedoc """

  ## Example:

      list_anomaly_detectors_request() :: %{
        optional("MaxResults") => integer(),
        optional("NextToken") => String.t() | atom()
      }

  """
  @type list_anomaly_detectors_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      delete_anomaly_detector_request() :: %{
        required("AnomalyDetectorArn") => String.t() | atom()
      }

  """
  @type delete_anomaly_detector_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      alert() :: %{
        "Action" => action(),
        "AlertArn" => String.t() | atom(),
        "AlertDescription" => String.t() | atom(),
        "AlertFilters" => alert_filters(),
        "AlertName" => String.t() | atom(),
        "AlertSensitivityThreshold" => integer(),
        "AlertStatus" => list(any()),
        "AlertType" => list(any()),
        "AnomalyDetectorArn" => String.t() | atom(),
        "CreationTime" => non_neg_integer(),
        "LastModificationTime" => non_neg_integer()
      }

  """
  @type alert() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      create_metric_set_response() :: %{
        "MetricSetArn" => String.t() | atom()
      }

  """
  @type create_metric_set_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      get_data_quality_metrics_request() :: %{
        optional("MetricSetArn") => String.t() | atom(),
        required("AnomalyDetectorArn") => String.t() | atom()
      }

  """
  @type get_data_quality_metrics_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      alert_filters() :: %{
        "DimensionFilterList" => list(dimension_filter()),
        "MetricList" => list(String.t() | atom())
      }

  """
  @type alert_filters() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      detected_metric_source() :: %{
        "S3SourceConfig" => detected_s3_source_config()
      }

  """
  @type detected_metric_source() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      update_anomaly_detector_request() :: %{
        optional("AnomalyDetectorConfig") => anomaly_detector_config(),
        optional("AnomalyDetectorDescription") => String.t() | atom(),
        optional("KmsKeyArn") => String.t() | atom(),
        required("AnomalyDetectorArn") => String.t() | atom()
      }

  """
  @type update_anomaly_detector_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      describe_anomaly_detection_executions_request() :: %{
        optional("MaxResults") => integer(),
        optional("NextToken") => String.t() | atom(),
        optional("Timestamp") => String.t() | atom(),
        required("AnomalyDetectorArn") => String.t() | atom()
      }

  """
  @type describe_anomaly_detection_executions_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_alerts_response() :: %{
        "AlertSummaryList" => list(alert_summary()),
        "NextToken" => String.t() | atom()
      }

  """
  @type list_alerts_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      anomaly_group_summary() :: %{
        "AnomalyGroupId" => String.t() | atom(),
        "AnomalyGroupScore" => float(),
        "EndTime" => String.t() | atom(),
        "PrimaryMetricName" => String.t() | atom(),
        "StartTime" => String.t() | atom()
      }

  """
  @type anomaly_group_summary() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      list_anomaly_detectors_response() :: %{
        "AnomalyDetectorSummaryList" => list(anomaly_detector_summary()),
        "NextToken" => String.t() | atom()
      }

  """
  @type list_anomaly_detectors_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      time_series_feedback() :: %{
        "IsAnomaly" => boolean(),
        "TimeSeriesId" => String.t() | atom()
      }

  """
  @type time_series_feedback() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      anomaly_group_statistics() :: %{
        "EvaluationStartDate" => String.t() | atom(),
        "ItemizedMetricStatsList" => list(itemized_metric_stats()),
        "TotalCount" => integer()
      }

  """
  @type anomaly_group_statistics() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      update_alert_response() :: %{
        "AlertArn" => String.t() | atom()
      }

  """
  @type update_alert_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      update_alert_request() :: %{
        optional("Action") => action(),
        optional("AlertDescription") => String.t() | atom(),
        optional("AlertFilters") => alert_filters(),
        optional("AlertSensitivityThreshold") => integer(),
        required("AlertArn") => String.t() | atom()
      }

  """
  @type update_alert_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      back_test_anomaly_detector_request() :: %{
        required("AnomalyDetectorArn") => String.t() | atom()
      }

  """
  @type back_test_anomaly_detector_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      metric_level_impact() :: %{
        "ContributionMatrix" => contribution_matrix(),
        "MetricName" => String.t() | atom(),
        "NumTimeSeries" => integer()
      }

  """
  @type metric_level_impact() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      dimension_filter() :: %{
        "DimensionName" => String.t() | atom(),
        "DimensionValueList" => list(String.t() | atom())
      }

  """
  @type dimension_filter() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      create_anomaly_detector_request() :: %{
        optional("AnomalyDetectorDescription") => String.t() | atom(),
        optional("KmsKeyArn") => String.t() | atom(),
        optional("Tags") => map(),
        required("AnomalyDetectorConfig") => anomaly_detector_config(),
        required("AnomalyDetectorName") => String.t() | atom()
      }

  """
  @type create_anomaly_detector_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      deactivate_anomaly_detector_response() :: %{}

  """
  @type deactivate_anomaly_detector_response() :: %{}

  @typedoc """

  ## Example:

      anomaly_detector_config() :: %{
        "AnomalyDetectorFrequency" => list(any())
      }

  """
  @type anomaly_detector_config() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      create_metric_set_request() :: %{
        optional("DimensionFilterList") => list(metric_set_dimension_filter()),
        optional("DimensionList") => list(String.t() | atom()),
        optional("MetricSetDescription") => String.t() | atom(),
        optional("MetricSetFrequency") => list(any()),
        optional("Offset") => integer(),
        optional("Tags") => map(),
        optional("TimestampColumn") => timestamp_column(),
        optional("Timezone") => String.t() | atom(),
        required("AnomalyDetectorArn") => String.t() | atom(),
        required("MetricList") => list(metric()),
        required("MetricSetName") => String.t() | atom(),
        required("MetricSource") => metric_source()
      }

  """
  @type create_metric_set_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      detect_metric_set_config_response() :: %{
        "DetectedMetricSetConfig" => detected_metric_set_config()
      }

  """
  @type detect_metric_set_config_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      describe_anomaly_detector_request() :: %{
        required("AnomalyDetectorArn") => String.t() | atom()
      }

  """
  @type describe_anomaly_detector_request() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      update_anomaly_detector_response() :: %{
        "AnomalyDetectorArn" => String.t() | atom()
      }

  """
  @type update_anomaly_detector_response() :: %{(String.t() | atom()) => any()}

  @typedoc """

  ## Example:

      data_quality_metric() :: %{
        "MetricDescription" => String.t() | atom(),
        "MetricType" => list(any()),
        "MetricValue" => float(),
        "RelatedColumnName" => String.t() | atom()
      }

  """
  @type data_quality_metric() :: %{(String.t() | atom()) => any()}

  @type activate_anomaly_detector_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()
          | too_many_requests_exception()

  @type back_test_anomaly_detector_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type create_alert_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | service_quota_exceeded_exception()
          | resource_not_found_exception()
          | conflict_exception()
          | too_many_requests_exception()

  @type create_anomaly_detector_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | service_quota_exceeded_exception()
          | conflict_exception()
          | too_many_requests_exception()

  @type create_metric_set_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | service_quota_exceeded_exception()
          | resource_not_found_exception()
          | conflict_exception()
          | too_many_requests_exception()

  @type deactivate_anomaly_detector_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()
          | too_many_requests_exception()

  @type delete_alert_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type delete_anomaly_detector_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | conflict_exception()
          | too_many_requests_exception()

  @type describe_alert_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type describe_anomaly_detection_executions_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type describe_anomaly_detector_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type describe_metric_set_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type detect_metric_set_config_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type get_anomaly_group_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type get_data_quality_metrics_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type get_feedback_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type get_sample_data_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type list_alerts_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type list_anomaly_detectors_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type list_anomaly_group_related_metrics_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type list_anomaly_group_summaries_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type list_anomaly_group_time_series_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type list_metric_sets_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type list_tags_for_resource_errors() ::
          validation_exception() | internal_server_exception() | resource_not_found_exception()

  @type put_feedback_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type tag_resource_errors() ::
          validation_exception() | internal_server_exception() | resource_not_found_exception()

  @type untag_resource_errors() ::
          validation_exception() | internal_server_exception() | resource_not_found_exception()

  @type update_alert_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type update_anomaly_detector_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  @type update_metric_set_errors() ::
          validation_exception()
          | access_denied_exception()
          | internal_server_exception()
          | service_quota_exceeded_exception()
          | resource_not_found_exception()
          | too_many_requests_exception()

  def metadata do
    %{
      api_version: "2017-07-25",
      content_type: "application/x-amz-json-1.1",
      credential_scope: nil,
      endpoint_prefix: "lookoutmetrics",
      global?: false,
      hostname: nil,
      protocol: "rest-json",
      service_id: "LookoutMetrics",
      signature_version: "v4",
      signing_name: "lookoutmetrics",
      target_prefix: nil
    }
  end

  @doc """
  Activates an anomaly detector.
  """
  @spec activate_anomaly_detector(map(), activate_anomaly_detector_request(), list()) ::
          {:ok, activate_anomaly_detector_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, activate_anomaly_detector_errors()}
  def activate_anomaly_detector(%Client{} = client, input, options \\ []) do
    url_path = "/ActivateAnomalyDetector"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Runs a backtest for anomaly detection for the specified resource.
  """
  @spec back_test_anomaly_detector(map(), back_test_anomaly_detector_request(), list()) ::
          {:ok, back_test_anomaly_detector_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, back_test_anomaly_detector_errors()}
  def back_test_anomaly_detector(%Client{} = client, input, options \\ []) do
    url_path = "/BackTestAnomalyDetector"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Creates an alert for an anomaly detector.
  """
  @spec create_alert(map(), create_alert_request(), list()) ::
          {:ok, create_alert_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, create_alert_errors()}
  def create_alert(%Client{} = client, input, options \\ []) do
    url_path = "/CreateAlert"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Creates an anomaly detector.
  """
  @spec create_anomaly_detector(map(), create_anomaly_detector_request(), list()) ::
          {:ok, create_anomaly_detector_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, create_anomaly_detector_errors()}
  def create_anomaly_detector(%Client{} = client, input, options \\ []) do
    url_path = "/CreateAnomalyDetector"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Creates a dataset.
  """
  @spec create_metric_set(map(), create_metric_set_request(), list()) ::
          {:ok, create_metric_set_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, create_metric_set_errors()}
  def create_metric_set(%Client{} = client, input, options \\ []) do
    url_path = "/CreateMetricSet"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Deactivates an anomaly detector.
  """
  @spec deactivate_anomaly_detector(map(), deactivate_anomaly_detector_request(), list()) ::
          {:ok, deactivate_anomaly_detector_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, deactivate_anomaly_detector_errors()}
  def deactivate_anomaly_detector(%Client{} = client, input, options \\ []) do
    url_path = "/DeactivateAnomalyDetector"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Deletes an alert.
  """
  @spec delete_alert(map(), delete_alert_request(), list()) ::
          {:ok, delete_alert_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, delete_alert_errors()}
  def delete_alert(%Client{} = client, input, options \\ []) do
    url_path = "/DeleteAlert"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Deletes a detector.

  Deleting an anomaly detector will delete all of its corresponding resources
  including any
  configured datasets and alerts.
  """
  @spec delete_anomaly_detector(map(), delete_anomaly_detector_request(), list()) ::
          {:ok, delete_anomaly_detector_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, delete_anomaly_detector_errors()}
  def delete_anomaly_detector(%Client{} = client, input, options \\ []) do
    url_path = "/DeleteAnomalyDetector"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Describes an alert.

  Amazon Lookout for Metrics API actions are eventually consistent. If you do a
  read operation on a resource
  immediately after creating or modifying it, use retries to allow time for the
  write operation to complete.
  """
  @spec describe_alert(map(), describe_alert_request(), list()) ::
          {:ok, describe_alert_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, describe_alert_errors()}
  def describe_alert(%Client{} = client, input, options \\ []) do
    url_path = "/DescribeAlert"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Returns information about the status of the specified anomaly detection jobs.
  """
  @spec describe_anomaly_detection_executions(
          map(),
          describe_anomaly_detection_executions_request(),
          list()
        ) ::
          {:ok, describe_anomaly_detection_executions_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, describe_anomaly_detection_executions_errors()}
  def describe_anomaly_detection_executions(%Client{} = client, input, options \\ []) do
    url_path = "/DescribeAnomalyDetectionExecutions"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Describes a detector.

  Amazon Lookout for Metrics API actions are eventually consistent. If you do a
  read operation on a resource
  immediately after creating or modifying it, use retries to allow time for the
  write operation to complete.
  """
  @spec describe_anomaly_detector(map(), describe_anomaly_detector_request(), list()) ::
          {:ok, describe_anomaly_detector_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, describe_anomaly_detector_errors()}
  def describe_anomaly_detector(%Client{} = client, input, options \\ []) do
    url_path = "/DescribeAnomalyDetector"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Describes a dataset.

  Amazon Lookout for Metrics API actions are eventually consistent. If you do a
  read operation on a resource
  immediately after creating or modifying it, use retries to allow time for the
  write operation to complete.
  """
  @spec describe_metric_set(map(), describe_metric_set_request(), list()) ::
          {:ok, describe_metric_set_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, describe_metric_set_errors()}
  def describe_metric_set(%Client{} = client, input, options \\ []) do
    url_path = "/DescribeMetricSet"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Detects an Amazon S3 dataset's file format, interval, and offset.
  """
  @spec detect_metric_set_config(map(), detect_metric_set_config_request(), list()) ::
          {:ok, detect_metric_set_config_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, detect_metric_set_config_errors()}
  def detect_metric_set_config(%Client{} = client, input, options \\ []) do
    url_path = "/DetectMetricSetConfig"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Returns details about a group of anomalous metrics.
  """
  @spec get_anomaly_group(map(), get_anomaly_group_request(), list()) ::
          {:ok, get_anomaly_group_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, get_anomaly_group_errors()}
  def get_anomaly_group(%Client{} = client, input, options \\ []) do
    url_path = "/GetAnomalyGroup"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Returns details about the requested data quality metrics.
  """
  @spec get_data_quality_metrics(map(), get_data_quality_metrics_request(), list()) ::
          {:ok, get_data_quality_metrics_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, get_data_quality_metrics_errors()}
  def get_data_quality_metrics(%Client{} = client, input, options \\ []) do
    url_path = "/GetDataQualityMetrics"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Get feedback for an anomaly group.
  """
  @spec get_feedback(map(), get_feedback_request(), list()) ::
          {:ok, get_feedback_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, get_feedback_errors()}
  def get_feedback(%Client{} = client, input, options \\ []) do
    url_path = "/GetFeedback"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Returns a selection of sample records from an Amazon S3 datasource.
  """
  @spec get_sample_data(map(), get_sample_data_request(), list()) ::
          {:ok, get_sample_data_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, get_sample_data_errors()}
  def get_sample_data(%Client{} = client, input, options \\ []) do
    url_path = "/GetSampleData"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Lists the alerts attached to a detector.

  Amazon Lookout for Metrics API actions are eventually consistent. If you do a
  read operation on a resource
  immediately after creating or modifying it, use retries to allow time for the
  write operation to complete.
  """
  @spec list_alerts(map(), list_alerts_request(), list()) ::
          {:ok, list_alerts_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, list_alerts_errors()}
  def list_alerts(%Client{} = client, input, options \\ []) do
    url_path = "/ListAlerts"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Lists the detectors in the current AWS Region.

  Amazon Lookout for Metrics API actions are eventually consistent. If you do a
  read operation on a resource
  immediately after creating or modifying it, use retries to allow time for the
  write operation to complete.
  """
  @spec list_anomaly_detectors(map(), list_anomaly_detectors_request(), list()) ::
          {:ok, list_anomaly_detectors_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, list_anomaly_detectors_errors()}
  def list_anomaly_detectors(%Client{} = client, input, options \\ []) do
    url_path = "/ListAnomalyDetectors"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Returns a list of measures that are potential causes or effects of an
  anomaly group.
  """
  @spec list_anomaly_group_related_metrics(
          map(),
          list_anomaly_group_related_metrics_request(),
          list()
        ) ::
          {:ok, list_anomaly_group_related_metrics_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, list_anomaly_group_related_metrics_errors()}
  def list_anomaly_group_related_metrics(%Client{} = client, input, options \\ []) do
    url_path = "/ListAnomalyGroupRelatedMetrics"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Returns a list of anomaly groups.
  """
  @spec list_anomaly_group_summaries(map(), list_anomaly_group_summaries_request(), list()) ::
          {:ok, list_anomaly_group_summaries_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, list_anomaly_group_summaries_errors()}
  def list_anomaly_group_summaries(%Client{} = client, input, options \\ []) do
    url_path = "/ListAnomalyGroupSummaries"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Gets a list of anomalous metrics for a measure in an anomaly group.
  """
  @spec list_anomaly_group_time_series(map(), list_anomaly_group_time_series_request(), list()) ::
          {:ok, list_anomaly_group_time_series_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, list_anomaly_group_time_series_errors()}
  def list_anomaly_group_time_series(%Client{} = client, input, options \\ []) do
    url_path = "/ListAnomalyGroupTimeSeries"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Lists the datasets in the current AWS Region.

  Amazon Lookout for Metrics API actions are eventually consistent. If you do a
  read operation on a resource
  immediately after creating or modifying it, use retries to allow time for the
  write operation to complete.
  """
  @spec list_metric_sets(map(), list_metric_sets_request(), list()) ::
          {:ok, list_metric_sets_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, list_metric_sets_errors()}
  def list_metric_sets(%Client{} = client, input, options \\ []) do
    url_path = "/ListMetricSets"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Gets a list of
  [tags](https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html)
  for a detector, dataset, or alert.
  """
  @spec list_tags_for_resource(map(), String.t() | atom(), list()) ::
          {:ok, list_tags_for_resource_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, list_tags_for_resource_errors()}
  def list_tags_for_resource(%Client{} = client, resource_arn, options \\ []) do
    url_path = "/tags/#{AWS.Util.encode_uri(resource_arn)}"
    headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(client, meta, :get, url_path, query_params, headers, nil, options, 200)
  end

  @doc """
  Add feedback for an anomalous metric.
  """
  @spec put_feedback(map(), put_feedback_request(), list()) ::
          {:ok, put_feedback_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, put_feedback_errors()}
  def put_feedback(%Client{} = client, input, options \\ []) do
    url_path = "/PutFeedback"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Adds
  [tags](https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html)
  to a detector, dataset, or alert.
  """
  @spec tag_resource(map(), String.t() | atom(), tag_resource_request(), list()) ::
          {:ok, tag_resource_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, tag_resource_errors()}
  def tag_resource(%Client{} = client, resource_arn, input, options \\ []) do
    url_path = "/tags/#{AWS.Util.encode_uri(resource_arn)}"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      204
    )
  end

  @doc """
  Removes
  [tags](https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html)
  from a detector, dataset, or alert.
  """
  @spec untag_resource(map(), String.t() | atom(), untag_resource_request(), list()) ::
          {:ok, untag_resource_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, untag_resource_errors()}
  def untag_resource(%Client{} = client, resource_arn, input, options \\ []) do
    url_path = "/tags/#{AWS.Util.encode_uri(resource_arn)}"
    headers = []
    custom_headers = []

    {query_params, input} =
      [
        {"TagKeys", "tagKeys"}
      ]
      |> Request.build_params(input)

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :delete,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      204
    )
  end

  @doc """
  Make changes to an existing alert.
  """
  @spec update_alert(map(), update_alert_request(), list()) ::
          {:ok, update_alert_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, update_alert_errors()}
  def update_alert(%Client{} = client, input, options \\ []) do
    url_path = "/UpdateAlert"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Updates a detector.

  After activation, you can only change a detector's ingestion delay and
  description.
  """
  @spec update_anomaly_detector(map(), update_anomaly_detector_request(), list()) ::
          {:ok, update_anomaly_detector_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, update_anomaly_detector_errors()}
  def update_anomaly_detector(%Client{} = client, input, options \\ []) do
    url_path = "/UpdateAnomalyDetector"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end

  @doc """
  Updates a dataset.
  """
  @spec update_metric_set(map(), update_metric_set_request(), list()) ::
          {:ok, update_metric_set_response(), any()}
          | {:error, {:unexpected_response, any()}}
          | {:error, term()}
          | {:error, update_metric_set_errors()}
  def update_metric_set(%Client{} = client, input, options \\ []) do
    url_path = "/UpdateMetricSet"
    headers = []
    custom_headers = []
    query_params = []

    meta = metadata()

    Request.request_rest(
      client,
      meta,
      :post,
      url_path,
      query_params,
      custom_headers ++ headers,
      input,
      options,
      200
    )
  end
end
