{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudWatch.DeleteAnomalyDetector
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes the specified anomaly detection model from your account. For
-- more information about how to delete an anomaly detection model, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Anomaly_Detection_Alarm.html#Delete_Anomaly_Detection_Model Deleting an anomaly detection model>
-- in the /CloudWatch User Guide/.
module Amazonka.CloudWatch.DeleteAnomalyDetector
  ( -- * Creating a Request
    DeleteAnomalyDetector (..),
    newDeleteAnomalyDetector,

    -- * Request Lenses
    deleteAnomalyDetector_dimensions,
    deleteAnomalyDetector_metricMathAnomalyDetector,
    deleteAnomalyDetector_metricName,
    deleteAnomalyDetector_namespace,
    deleteAnomalyDetector_singleMetricAnomalyDetector,
    deleteAnomalyDetector_stat,

    -- * Destructuring the Response
    DeleteAnomalyDetectorResponse (..),
    newDeleteAnomalyDetectorResponse,

    -- * Response Lenses
    deleteAnomalyDetectorResponse_httpStatus,
  )
where

import Amazonka.CloudWatch.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDeleteAnomalyDetector' smart constructor.
data DeleteAnomalyDetector = DeleteAnomalyDetector'
  { -- | The metric dimensions associated with the anomaly detection model to
    -- delete.
    DeleteAnomalyDetector -> Maybe [Dimension]
dimensions :: Prelude.Maybe [Dimension],
    -- | The metric math anomaly detector to be deleted.
    --
    -- When using @MetricMathAnomalyDetector@, you cannot include following
    -- parameters in the same operation:
    --
    -- -   @Dimensions@,
    --
    -- -   @MetricName@
    --
    -- -   @Namespace@
    --
    -- -   @Stat@
    --
    -- -   the @SingleMetricAnomalyDetector@ parameters of
    --     @DeleteAnomalyDetectorInput@
    --
    -- Instead, specify the metric math anomaly detector attributes as part of
    -- the @MetricMathAnomalyDetector@ property.
    DeleteAnomalyDetector -> Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector :: Prelude.Maybe MetricMathAnomalyDetector,
    -- | The metric name associated with the anomaly detection model to delete.
    DeleteAnomalyDetector -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
    -- | The namespace associated with the anomaly detection model to delete.
    DeleteAnomalyDetector -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
    -- | A single metric anomaly detector to be deleted.
    --
    -- When using @SingleMetricAnomalyDetector@, you cannot include the
    -- following parameters in the same operation:
    --
    -- -   @Dimensions@,
    --
    -- -   @MetricName@
    --
    -- -   @Namespace@
    --
    -- -   @Stat@
    --
    -- -   the @MetricMathAnomalyDetector@ parameters of
    --     @DeleteAnomalyDetectorInput@
    --
    -- Instead, specify the single metric anomaly detector attributes as part
    -- of the @SingleMetricAnomalyDetector@ property.
    DeleteAnomalyDetector -> Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector :: Prelude.Maybe SingleMetricAnomalyDetector,
    -- | The statistic associated with the anomaly detection model to delete.
    DeleteAnomalyDetector -> Maybe Text
stat :: Prelude.Maybe Prelude.Text
  }
  deriving (DeleteAnomalyDetector -> DeleteAnomalyDetector -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAnomalyDetector -> DeleteAnomalyDetector -> Bool
$c/= :: DeleteAnomalyDetector -> DeleteAnomalyDetector -> Bool
== :: DeleteAnomalyDetector -> DeleteAnomalyDetector -> Bool
$c== :: DeleteAnomalyDetector -> DeleteAnomalyDetector -> Bool
Prelude.Eq, ReadPrec [DeleteAnomalyDetector]
ReadPrec DeleteAnomalyDetector
Int -> ReadS DeleteAnomalyDetector
ReadS [DeleteAnomalyDetector]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAnomalyDetector]
$creadListPrec :: ReadPrec [DeleteAnomalyDetector]
readPrec :: ReadPrec DeleteAnomalyDetector
$creadPrec :: ReadPrec DeleteAnomalyDetector
readList :: ReadS [DeleteAnomalyDetector]
$creadList :: ReadS [DeleteAnomalyDetector]
readsPrec :: Int -> ReadS DeleteAnomalyDetector
$creadsPrec :: Int -> ReadS DeleteAnomalyDetector
Prelude.Read, Int -> DeleteAnomalyDetector -> ShowS
[DeleteAnomalyDetector] -> ShowS
DeleteAnomalyDetector -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAnomalyDetector] -> ShowS
$cshowList :: [DeleteAnomalyDetector] -> ShowS
show :: DeleteAnomalyDetector -> String
$cshow :: DeleteAnomalyDetector -> String
showsPrec :: Int -> DeleteAnomalyDetector -> ShowS
$cshowsPrec :: Int -> DeleteAnomalyDetector -> ShowS
Prelude.Show, forall x. Rep DeleteAnomalyDetector x -> DeleteAnomalyDetector
forall x. DeleteAnomalyDetector -> Rep DeleteAnomalyDetector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAnomalyDetector x -> DeleteAnomalyDetector
$cfrom :: forall x. DeleteAnomalyDetector -> Rep DeleteAnomalyDetector x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAnomalyDetector' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'dimensions', 'deleteAnomalyDetector_dimensions' - The metric dimensions associated with the anomaly detection model to
-- delete.
--
-- 'metricMathAnomalyDetector', 'deleteAnomalyDetector_metricMathAnomalyDetector' - The metric math anomaly detector to be deleted.
--
-- When using @MetricMathAnomalyDetector@, you cannot include following
-- parameters in the same operation:
--
-- -   @Dimensions@,
--
-- -   @MetricName@
--
-- -   @Namespace@
--
-- -   @Stat@
--
-- -   the @SingleMetricAnomalyDetector@ parameters of
--     @DeleteAnomalyDetectorInput@
--
-- Instead, specify the metric math anomaly detector attributes as part of
-- the @MetricMathAnomalyDetector@ property.
--
-- 'metricName', 'deleteAnomalyDetector_metricName' - The metric name associated with the anomaly detection model to delete.
--
-- 'namespace', 'deleteAnomalyDetector_namespace' - The namespace associated with the anomaly detection model to delete.
--
-- 'singleMetricAnomalyDetector', 'deleteAnomalyDetector_singleMetricAnomalyDetector' - A single metric anomaly detector to be deleted.
--
-- When using @SingleMetricAnomalyDetector@, you cannot include the
-- following parameters in the same operation:
--
-- -   @Dimensions@,
--
-- -   @MetricName@
--
-- -   @Namespace@
--
-- -   @Stat@
--
-- -   the @MetricMathAnomalyDetector@ parameters of
--     @DeleteAnomalyDetectorInput@
--
-- Instead, specify the single metric anomaly detector attributes as part
-- of the @SingleMetricAnomalyDetector@ property.
--
-- 'stat', 'deleteAnomalyDetector_stat' - The statistic associated with the anomaly detection model to delete.
newDeleteAnomalyDetector ::
  DeleteAnomalyDetector
newDeleteAnomalyDetector :: DeleteAnomalyDetector
newDeleteAnomalyDetector =
  DeleteAnomalyDetector'
    { $sel:dimensions:DeleteAnomalyDetector' :: Maybe [Dimension]
dimensions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:metricMathAnomalyDetector:DeleteAnomalyDetector' :: Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector = forall a. Maybe a
Prelude.Nothing,
      $sel:metricName:DeleteAnomalyDetector' :: Maybe Text
metricName = forall a. Maybe a
Prelude.Nothing,
      $sel:namespace:DeleteAnomalyDetector' :: Maybe Text
namespace = forall a. Maybe a
Prelude.Nothing,
      $sel:singleMetricAnomalyDetector:DeleteAnomalyDetector' :: Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector = forall a. Maybe a
Prelude.Nothing,
      $sel:stat:DeleteAnomalyDetector' :: Maybe Text
stat = forall a. Maybe a
Prelude.Nothing
    }

-- | The metric dimensions associated with the anomaly detection model to
-- delete.
deleteAnomalyDetector_dimensions :: Lens.Lens' DeleteAnomalyDetector (Prelude.Maybe [Dimension])
deleteAnomalyDetector_dimensions :: Lens' DeleteAnomalyDetector (Maybe [Dimension])
deleteAnomalyDetector_dimensions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnomalyDetector' {Maybe [Dimension]
dimensions :: Maybe [Dimension]
$sel:dimensions:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe [Dimension]
dimensions} -> Maybe [Dimension]
dimensions) (\s :: DeleteAnomalyDetector
s@DeleteAnomalyDetector' {} Maybe [Dimension]
a -> DeleteAnomalyDetector
s {$sel:dimensions:DeleteAnomalyDetector' :: Maybe [Dimension]
dimensions = Maybe [Dimension]
a} :: DeleteAnomalyDetector) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The metric math anomaly detector to be deleted.
--
-- When using @MetricMathAnomalyDetector@, you cannot include following
-- parameters in the same operation:
--
-- -   @Dimensions@,
--
-- -   @MetricName@
--
-- -   @Namespace@
--
-- -   @Stat@
--
-- -   the @SingleMetricAnomalyDetector@ parameters of
--     @DeleteAnomalyDetectorInput@
--
-- Instead, specify the metric math anomaly detector attributes as part of
-- the @MetricMathAnomalyDetector@ property.
deleteAnomalyDetector_metricMathAnomalyDetector :: Lens.Lens' DeleteAnomalyDetector (Prelude.Maybe MetricMathAnomalyDetector)
deleteAnomalyDetector_metricMathAnomalyDetector :: Lens' DeleteAnomalyDetector (Maybe MetricMathAnomalyDetector)
deleteAnomalyDetector_metricMathAnomalyDetector = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnomalyDetector' {Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector :: Maybe MetricMathAnomalyDetector
$sel:metricMathAnomalyDetector:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector} -> Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector) (\s :: DeleteAnomalyDetector
s@DeleteAnomalyDetector' {} Maybe MetricMathAnomalyDetector
a -> DeleteAnomalyDetector
s {$sel:metricMathAnomalyDetector:DeleteAnomalyDetector' :: Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector = Maybe MetricMathAnomalyDetector
a} :: DeleteAnomalyDetector)

-- | The metric name associated with the anomaly detection model to delete.
deleteAnomalyDetector_metricName :: Lens.Lens' DeleteAnomalyDetector (Prelude.Maybe Prelude.Text)
deleteAnomalyDetector_metricName :: Lens' DeleteAnomalyDetector (Maybe Text)
deleteAnomalyDetector_metricName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnomalyDetector' {Maybe Text
metricName :: Maybe Text
$sel:metricName:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe Text
metricName} -> Maybe Text
metricName) (\s :: DeleteAnomalyDetector
s@DeleteAnomalyDetector' {} Maybe Text
a -> DeleteAnomalyDetector
s {$sel:metricName:DeleteAnomalyDetector' :: Maybe Text
metricName = Maybe Text
a} :: DeleteAnomalyDetector)

-- | The namespace associated with the anomaly detection model to delete.
deleteAnomalyDetector_namespace :: Lens.Lens' DeleteAnomalyDetector (Prelude.Maybe Prelude.Text)
deleteAnomalyDetector_namespace :: Lens' DeleteAnomalyDetector (Maybe Text)
deleteAnomalyDetector_namespace = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnomalyDetector' {Maybe Text
namespace :: Maybe Text
$sel:namespace:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: DeleteAnomalyDetector
s@DeleteAnomalyDetector' {} Maybe Text
a -> DeleteAnomalyDetector
s {$sel:namespace:DeleteAnomalyDetector' :: Maybe Text
namespace = Maybe Text
a} :: DeleteAnomalyDetector)

-- | A single metric anomaly detector to be deleted.
--
-- When using @SingleMetricAnomalyDetector@, you cannot include the
-- following parameters in the same operation:
--
-- -   @Dimensions@,
--
-- -   @MetricName@
--
-- -   @Namespace@
--
-- -   @Stat@
--
-- -   the @MetricMathAnomalyDetector@ parameters of
--     @DeleteAnomalyDetectorInput@
--
-- Instead, specify the single metric anomaly detector attributes as part
-- of the @SingleMetricAnomalyDetector@ property.
deleteAnomalyDetector_singleMetricAnomalyDetector :: Lens.Lens' DeleteAnomalyDetector (Prelude.Maybe SingleMetricAnomalyDetector)
deleteAnomalyDetector_singleMetricAnomalyDetector :: Lens' DeleteAnomalyDetector (Maybe SingleMetricAnomalyDetector)
deleteAnomalyDetector_singleMetricAnomalyDetector = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnomalyDetector' {Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector :: Maybe SingleMetricAnomalyDetector
$sel:singleMetricAnomalyDetector:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector} -> Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector) (\s :: DeleteAnomalyDetector
s@DeleteAnomalyDetector' {} Maybe SingleMetricAnomalyDetector
a -> DeleteAnomalyDetector
s {$sel:singleMetricAnomalyDetector:DeleteAnomalyDetector' :: Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector = Maybe SingleMetricAnomalyDetector
a} :: DeleteAnomalyDetector)

-- | The statistic associated with the anomaly detection model to delete.
deleteAnomalyDetector_stat :: Lens.Lens' DeleteAnomalyDetector (Prelude.Maybe Prelude.Text)
deleteAnomalyDetector_stat :: Lens' DeleteAnomalyDetector (Maybe Text)
deleteAnomalyDetector_stat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnomalyDetector' {Maybe Text
stat :: Maybe Text
$sel:stat:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe Text
stat} -> Maybe Text
stat) (\s :: DeleteAnomalyDetector
s@DeleteAnomalyDetector' {} Maybe Text
a -> DeleteAnomalyDetector
s {$sel:stat:DeleteAnomalyDetector' :: Maybe Text
stat = Maybe Text
a} :: DeleteAnomalyDetector)

instance Core.AWSRequest DeleteAnomalyDetector where
  type
    AWSResponse DeleteAnomalyDetector =
      DeleteAnomalyDetectorResponse
  request :: (Service -> Service)
-> DeleteAnomalyDetector -> Request DeleteAnomalyDetector
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteAnomalyDetector
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAnomalyDetector)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DeleteAnomalyDetectorResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int -> DeleteAnomalyDetectorResponse
DeleteAnomalyDetectorResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DeleteAnomalyDetector where
  hashWithSalt :: Int -> DeleteAnomalyDetector -> Int
hashWithSalt Int
_salt DeleteAnomalyDetector' {Maybe [Dimension]
Maybe Text
Maybe SingleMetricAnomalyDetector
Maybe MetricMathAnomalyDetector
stat :: Maybe Text
singleMetricAnomalyDetector :: Maybe SingleMetricAnomalyDetector
namespace :: Maybe Text
metricName :: Maybe Text
metricMathAnomalyDetector :: Maybe MetricMathAnomalyDetector
dimensions :: Maybe [Dimension]
$sel:stat:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe Text
$sel:singleMetricAnomalyDetector:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe SingleMetricAnomalyDetector
$sel:namespace:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe Text
$sel:metricName:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe Text
$sel:metricMathAnomalyDetector:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe MetricMathAnomalyDetector
$sel:dimensions:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe [Dimension]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Dimension]
dimensions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
metricName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
namespace
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stat

instance Prelude.NFData DeleteAnomalyDetector where
  rnf :: DeleteAnomalyDetector -> ()
rnf DeleteAnomalyDetector' {Maybe [Dimension]
Maybe Text
Maybe SingleMetricAnomalyDetector
Maybe MetricMathAnomalyDetector
stat :: Maybe Text
singleMetricAnomalyDetector :: Maybe SingleMetricAnomalyDetector
namespace :: Maybe Text
metricName :: Maybe Text
metricMathAnomalyDetector :: Maybe MetricMathAnomalyDetector
dimensions :: Maybe [Dimension]
$sel:stat:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe Text
$sel:singleMetricAnomalyDetector:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe SingleMetricAnomalyDetector
$sel:namespace:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe Text
$sel:metricName:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe Text
$sel:metricMathAnomalyDetector:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe MetricMathAnomalyDetector
$sel:dimensions:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe [Dimension]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Dimension]
dimensions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metricName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
namespace
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stat

instance Data.ToHeaders DeleteAnomalyDetector where
  toHeaders :: DeleteAnomalyDetector -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath DeleteAnomalyDetector where
  toPath :: DeleteAnomalyDetector -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery DeleteAnomalyDetector where
  toQuery :: DeleteAnomalyDetector -> QueryString
toQuery DeleteAnomalyDetector' {Maybe [Dimension]
Maybe Text
Maybe SingleMetricAnomalyDetector
Maybe MetricMathAnomalyDetector
stat :: Maybe Text
singleMetricAnomalyDetector :: Maybe SingleMetricAnomalyDetector
namespace :: Maybe Text
metricName :: Maybe Text
metricMathAnomalyDetector :: Maybe MetricMathAnomalyDetector
dimensions :: Maybe [Dimension]
$sel:stat:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe Text
$sel:singleMetricAnomalyDetector:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe SingleMetricAnomalyDetector
$sel:namespace:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe Text
$sel:metricName:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe Text
$sel:metricMathAnomalyDetector:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe MetricMathAnomalyDetector
$sel:dimensions:DeleteAnomalyDetector' :: DeleteAnomalyDetector -> Maybe [Dimension]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DeleteAnomalyDetector" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-08-01" :: Prelude.ByteString),
        ByteString
"Dimensions"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Dimension]
dimensions),
        ByteString
"MetricMathAnomalyDetector"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector,
        ByteString
"MetricName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
metricName,
        ByteString
"Namespace" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
namespace,
        ByteString
"SingleMetricAnomalyDetector"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector,
        ByteString
"Stat" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
stat
      ]

-- | /See:/ 'newDeleteAnomalyDetectorResponse' smart constructor.
data DeleteAnomalyDetectorResponse = DeleteAnomalyDetectorResponse'
  { -- | The response's http status code.
    DeleteAnomalyDetectorResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteAnomalyDetectorResponse
-> DeleteAnomalyDetectorResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAnomalyDetectorResponse
-> DeleteAnomalyDetectorResponse -> Bool
$c/= :: DeleteAnomalyDetectorResponse
-> DeleteAnomalyDetectorResponse -> Bool
== :: DeleteAnomalyDetectorResponse
-> DeleteAnomalyDetectorResponse -> Bool
$c== :: DeleteAnomalyDetectorResponse
-> DeleteAnomalyDetectorResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAnomalyDetectorResponse]
ReadPrec DeleteAnomalyDetectorResponse
Int -> ReadS DeleteAnomalyDetectorResponse
ReadS [DeleteAnomalyDetectorResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAnomalyDetectorResponse]
$creadListPrec :: ReadPrec [DeleteAnomalyDetectorResponse]
readPrec :: ReadPrec DeleteAnomalyDetectorResponse
$creadPrec :: ReadPrec DeleteAnomalyDetectorResponse
readList :: ReadS [DeleteAnomalyDetectorResponse]
$creadList :: ReadS [DeleteAnomalyDetectorResponse]
readsPrec :: Int -> ReadS DeleteAnomalyDetectorResponse
$creadsPrec :: Int -> ReadS DeleteAnomalyDetectorResponse
Prelude.Read, Int -> DeleteAnomalyDetectorResponse -> ShowS
[DeleteAnomalyDetectorResponse] -> ShowS
DeleteAnomalyDetectorResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAnomalyDetectorResponse] -> ShowS
$cshowList :: [DeleteAnomalyDetectorResponse] -> ShowS
show :: DeleteAnomalyDetectorResponse -> String
$cshow :: DeleteAnomalyDetectorResponse -> String
showsPrec :: Int -> DeleteAnomalyDetectorResponse -> ShowS
$cshowsPrec :: Int -> DeleteAnomalyDetectorResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteAnomalyDetectorResponse x
-> DeleteAnomalyDetectorResponse
forall x.
DeleteAnomalyDetectorResponse
-> Rep DeleteAnomalyDetectorResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAnomalyDetectorResponse x
-> DeleteAnomalyDetectorResponse
$cfrom :: forall x.
DeleteAnomalyDetectorResponse
-> Rep DeleteAnomalyDetectorResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAnomalyDetectorResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'deleteAnomalyDetectorResponse_httpStatus' - The response's http status code.
newDeleteAnomalyDetectorResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteAnomalyDetectorResponse
newDeleteAnomalyDetectorResponse :: Int -> DeleteAnomalyDetectorResponse
newDeleteAnomalyDetectorResponse Int
pHttpStatus_ =
  DeleteAnomalyDetectorResponse'
    { $sel:httpStatus:DeleteAnomalyDetectorResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteAnomalyDetectorResponse_httpStatus :: Lens.Lens' DeleteAnomalyDetectorResponse Prelude.Int
deleteAnomalyDetectorResponse_httpStatus :: Lens' DeleteAnomalyDetectorResponse Int
deleteAnomalyDetectorResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnomalyDetectorResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteAnomalyDetectorResponse' :: DeleteAnomalyDetectorResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteAnomalyDetectorResponse
s@DeleteAnomalyDetectorResponse' {} Int
a -> DeleteAnomalyDetectorResponse
s {$sel:httpStatus:DeleteAnomalyDetectorResponse' :: Int
httpStatus = Int
a} :: DeleteAnomalyDetectorResponse)

instance Prelude.NFData DeleteAnomalyDetectorResponse where
  rnf :: DeleteAnomalyDetectorResponse -> ()
rnf DeleteAnomalyDetectorResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteAnomalyDetectorResponse' :: DeleteAnomalyDetectorResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus