{-# 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.PutAnomalyDetector
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an anomaly detection model for a CloudWatch metric. You can use
-- the model to display a band of expected normal values when the metric is
-- graphed.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Anomaly_Detection.html CloudWatch Anomaly Detection>.
module Amazonka.CloudWatch.PutAnomalyDetector
  ( -- * Creating a Request
    PutAnomalyDetector (..),
    newPutAnomalyDetector,

    -- * Request Lenses
    putAnomalyDetector_configuration,
    putAnomalyDetector_dimensions,
    putAnomalyDetector_namespace,
    putAnomalyDetector_metricName,
    putAnomalyDetector_stat,

    -- * Destructuring the Response
    PutAnomalyDetectorResponse (..),
    newPutAnomalyDetectorResponse,

    -- * Response Lenses
    putAnomalyDetectorResponse_httpStatus,
  )
where

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

-- | /See:/ 'newPutAnomalyDetector' smart constructor.
data PutAnomalyDetector = PutAnomalyDetector'
  { -- | The configuration specifies details about how the anomaly detection
    -- model is to be trained, including time ranges to exclude when training
    -- and updating the model. You can specify as many as 10 time ranges.
    --
    -- The configuration can also include the time zone to use for the metric.
    PutAnomalyDetector -> Maybe AnomalyDetectorConfiguration
configuration :: Prelude.Maybe AnomalyDetectorConfiguration,
    -- | The metric dimensions to create the anomaly detection model for.
    PutAnomalyDetector -> Maybe [Dimension]
dimensions :: Prelude.Maybe [Dimension],
    -- | The namespace of the metric to create the anomaly detection model for.
    PutAnomalyDetector -> Text
namespace :: Prelude.Text,
    -- | The name of the metric to create the anomaly detection model for.
    PutAnomalyDetector -> Text
metricName :: Prelude.Text,
    -- | The statistic to use for the metric and the anomaly detection model.
    PutAnomalyDetector -> Text
stat :: Prelude.Text
  }
  deriving (PutAnomalyDetector -> PutAnomalyDetector -> Bool
(PutAnomalyDetector -> PutAnomalyDetector -> Bool)
-> (PutAnomalyDetector -> PutAnomalyDetector -> Bool)
-> Eq PutAnomalyDetector
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAnomalyDetector -> PutAnomalyDetector -> Bool
$c/= :: PutAnomalyDetector -> PutAnomalyDetector -> Bool
== :: PutAnomalyDetector -> PutAnomalyDetector -> Bool
$c== :: PutAnomalyDetector -> PutAnomalyDetector -> Bool
Prelude.Eq, ReadPrec [PutAnomalyDetector]
ReadPrec PutAnomalyDetector
Int -> ReadS PutAnomalyDetector
ReadS [PutAnomalyDetector]
(Int -> ReadS PutAnomalyDetector)
-> ReadS [PutAnomalyDetector]
-> ReadPrec PutAnomalyDetector
-> ReadPrec [PutAnomalyDetector]
-> Read PutAnomalyDetector
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAnomalyDetector]
$creadListPrec :: ReadPrec [PutAnomalyDetector]
readPrec :: ReadPrec PutAnomalyDetector
$creadPrec :: ReadPrec PutAnomalyDetector
readList :: ReadS [PutAnomalyDetector]
$creadList :: ReadS [PutAnomalyDetector]
readsPrec :: Int -> ReadS PutAnomalyDetector
$creadsPrec :: Int -> ReadS PutAnomalyDetector
Prelude.Read, Int -> PutAnomalyDetector -> ShowS
[PutAnomalyDetector] -> ShowS
PutAnomalyDetector -> String
(Int -> PutAnomalyDetector -> ShowS)
-> (PutAnomalyDetector -> String)
-> ([PutAnomalyDetector] -> ShowS)
-> Show PutAnomalyDetector
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAnomalyDetector] -> ShowS
$cshowList :: [PutAnomalyDetector] -> ShowS
show :: PutAnomalyDetector -> String
$cshow :: PutAnomalyDetector -> String
showsPrec :: Int -> PutAnomalyDetector -> ShowS
$cshowsPrec :: Int -> PutAnomalyDetector -> ShowS
Prelude.Show, (forall x. PutAnomalyDetector -> Rep PutAnomalyDetector x)
-> (forall x. Rep PutAnomalyDetector x -> PutAnomalyDetector)
-> Generic PutAnomalyDetector
forall x. Rep PutAnomalyDetector x -> PutAnomalyDetector
forall x. PutAnomalyDetector -> Rep PutAnomalyDetector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutAnomalyDetector x -> PutAnomalyDetector
$cfrom :: forall x. PutAnomalyDetector -> Rep PutAnomalyDetector x
Prelude.Generic)

-- |
-- Create a value of 'PutAnomalyDetector' 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:
--
-- 'configuration', 'putAnomalyDetector_configuration' - The configuration specifies details about how the anomaly detection
-- model is to be trained, including time ranges to exclude when training
-- and updating the model. You can specify as many as 10 time ranges.
--
-- The configuration can also include the time zone to use for the metric.
--
-- 'dimensions', 'putAnomalyDetector_dimensions' - The metric dimensions to create the anomaly detection model for.
--
-- 'namespace', 'putAnomalyDetector_namespace' - The namespace of the metric to create the anomaly detection model for.
--
-- 'metricName', 'putAnomalyDetector_metricName' - The name of the metric to create the anomaly detection model for.
--
-- 'stat', 'putAnomalyDetector_stat' - The statistic to use for the metric and the anomaly detection model.
newPutAnomalyDetector ::
  -- | 'namespace'
  Prelude.Text ->
  -- | 'metricName'
  Prelude.Text ->
  -- | 'stat'
  Prelude.Text ->
  PutAnomalyDetector
newPutAnomalyDetector :: Text -> Text -> Text -> PutAnomalyDetector
newPutAnomalyDetector Text
pNamespace_ Text
pMetricName_ Text
pStat_ =
  PutAnomalyDetector' :: Maybe AnomalyDetectorConfiguration
-> Maybe [Dimension] -> Text -> Text -> Text -> PutAnomalyDetector
PutAnomalyDetector'
    { $sel:configuration:PutAnomalyDetector' :: Maybe AnomalyDetectorConfiguration
configuration =
        Maybe AnomalyDetectorConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:dimensions:PutAnomalyDetector' :: Maybe [Dimension]
dimensions = Maybe [Dimension]
forall a. Maybe a
Prelude.Nothing,
      $sel:namespace:PutAnomalyDetector' :: Text
namespace = Text
pNamespace_,
      $sel:metricName:PutAnomalyDetector' :: Text
metricName = Text
pMetricName_,
      $sel:stat:PutAnomalyDetector' :: Text
stat = Text
pStat_
    }

-- | The configuration specifies details about how the anomaly detection
-- model is to be trained, including time ranges to exclude when training
-- and updating the model. You can specify as many as 10 time ranges.
--
-- The configuration can also include the time zone to use for the metric.
putAnomalyDetector_configuration :: Lens.Lens' PutAnomalyDetector (Prelude.Maybe AnomalyDetectorConfiguration)
putAnomalyDetector_configuration :: (Maybe AnomalyDetectorConfiguration
 -> f (Maybe AnomalyDetectorConfiguration))
-> PutAnomalyDetector -> f PutAnomalyDetector
putAnomalyDetector_configuration = (PutAnomalyDetector -> Maybe AnomalyDetectorConfiguration)
-> (PutAnomalyDetector
    -> Maybe AnomalyDetectorConfiguration -> PutAnomalyDetector)
-> Lens
     PutAnomalyDetector
     PutAnomalyDetector
     (Maybe AnomalyDetectorConfiguration)
     (Maybe AnomalyDetectorConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAnomalyDetector' {Maybe AnomalyDetectorConfiguration
configuration :: Maybe AnomalyDetectorConfiguration
$sel:configuration:PutAnomalyDetector' :: PutAnomalyDetector -> Maybe AnomalyDetectorConfiguration
configuration} -> Maybe AnomalyDetectorConfiguration
configuration) (\s :: PutAnomalyDetector
s@PutAnomalyDetector' {} Maybe AnomalyDetectorConfiguration
a -> PutAnomalyDetector
s {$sel:configuration:PutAnomalyDetector' :: Maybe AnomalyDetectorConfiguration
configuration = Maybe AnomalyDetectorConfiguration
a} :: PutAnomalyDetector)

-- | The metric dimensions to create the anomaly detection model for.
putAnomalyDetector_dimensions :: Lens.Lens' PutAnomalyDetector (Prelude.Maybe [Dimension])
putAnomalyDetector_dimensions :: (Maybe [Dimension] -> f (Maybe [Dimension]))
-> PutAnomalyDetector -> f PutAnomalyDetector
putAnomalyDetector_dimensions = (PutAnomalyDetector -> Maybe [Dimension])
-> (PutAnomalyDetector -> Maybe [Dimension] -> PutAnomalyDetector)
-> Lens
     PutAnomalyDetector
     PutAnomalyDetector
     (Maybe [Dimension])
     (Maybe [Dimension])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAnomalyDetector' {Maybe [Dimension]
dimensions :: Maybe [Dimension]
$sel:dimensions:PutAnomalyDetector' :: PutAnomalyDetector -> Maybe [Dimension]
dimensions} -> Maybe [Dimension]
dimensions) (\s :: PutAnomalyDetector
s@PutAnomalyDetector' {} Maybe [Dimension]
a -> PutAnomalyDetector
s {$sel:dimensions:PutAnomalyDetector' :: Maybe [Dimension]
dimensions = Maybe [Dimension]
a} :: PutAnomalyDetector) ((Maybe [Dimension] -> f (Maybe [Dimension]))
 -> PutAnomalyDetector -> f PutAnomalyDetector)
-> ((Maybe [Dimension] -> f (Maybe [Dimension]))
    -> Maybe [Dimension] -> f (Maybe [Dimension]))
-> (Maybe [Dimension] -> f (Maybe [Dimension]))
-> PutAnomalyDetector
-> f PutAnomalyDetector
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Dimension] [Dimension] [Dimension] [Dimension]
-> Iso
     (Maybe [Dimension])
     (Maybe [Dimension])
     (Maybe [Dimension])
     (Maybe [Dimension])
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 AnIso [Dimension] [Dimension] [Dimension] [Dimension]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The namespace of the metric to create the anomaly detection model for.
putAnomalyDetector_namespace :: Lens.Lens' PutAnomalyDetector Prelude.Text
putAnomalyDetector_namespace :: (Text -> f Text) -> PutAnomalyDetector -> f PutAnomalyDetector
putAnomalyDetector_namespace = (PutAnomalyDetector -> Text)
-> (PutAnomalyDetector -> Text -> PutAnomalyDetector)
-> Lens PutAnomalyDetector PutAnomalyDetector Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAnomalyDetector' {Text
namespace :: Text
$sel:namespace:PutAnomalyDetector' :: PutAnomalyDetector -> Text
namespace} -> Text
namespace) (\s :: PutAnomalyDetector
s@PutAnomalyDetector' {} Text
a -> PutAnomalyDetector
s {$sel:namespace:PutAnomalyDetector' :: Text
namespace = Text
a} :: PutAnomalyDetector)

-- | The name of the metric to create the anomaly detection model for.
putAnomalyDetector_metricName :: Lens.Lens' PutAnomalyDetector Prelude.Text
putAnomalyDetector_metricName :: (Text -> f Text) -> PutAnomalyDetector -> f PutAnomalyDetector
putAnomalyDetector_metricName = (PutAnomalyDetector -> Text)
-> (PutAnomalyDetector -> Text -> PutAnomalyDetector)
-> Lens PutAnomalyDetector PutAnomalyDetector Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAnomalyDetector' {Text
metricName :: Text
$sel:metricName:PutAnomalyDetector' :: PutAnomalyDetector -> Text
metricName} -> Text
metricName) (\s :: PutAnomalyDetector
s@PutAnomalyDetector' {} Text
a -> PutAnomalyDetector
s {$sel:metricName:PutAnomalyDetector' :: Text
metricName = Text
a} :: PutAnomalyDetector)

-- | The statistic to use for the metric and the anomaly detection model.
putAnomalyDetector_stat :: Lens.Lens' PutAnomalyDetector Prelude.Text
putAnomalyDetector_stat :: (Text -> f Text) -> PutAnomalyDetector -> f PutAnomalyDetector
putAnomalyDetector_stat = (PutAnomalyDetector -> Text)
-> (PutAnomalyDetector -> Text -> PutAnomalyDetector)
-> Lens PutAnomalyDetector PutAnomalyDetector Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAnomalyDetector' {Text
stat :: Text
$sel:stat:PutAnomalyDetector' :: PutAnomalyDetector -> Text
stat} -> Text
stat) (\s :: PutAnomalyDetector
s@PutAnomalyDetector' {} Text
a -> PutAnomalyDetector
s {$sel:stat:PutAnomalyDetector' :: Text
stat = Text
a} :: PutAnomalyDetector)

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

instance Prelude.Hashable PutAnomalyDetector

instance Prelude.NFData PutAnomalyDetector

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

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

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

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

-- |
-- Create a value of 'PutAnomalyDetectorResponse' 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', 'putAnomalyDetectorResponse_httpStatus' - The response's http status code.
newPutAnomalyDetectorResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PutAnomalyDetectorResponse
newPutAnomalyDetectorResponse :: Int -> PutAnomalyDetectorResponse
newPutAnomalyDetectorResponse Int
pHttpStatus_ =
  PutAnomalyDetectorResponse' :: Int -> PutAnomalyDetectorResponse
PutAnomalyDetectorResponse'
    { $sel:httpStatus:PutAnomalyDetectorResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance Prelude.NFData PutAnomalyDetectorResponse