{-# 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.LookoutMetrics.DescribeAnomalyDetector
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- 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.
module Amazonka.LookoutMetrics.DescribeAnomalyDetector
  ( -- * Creating a Request
    DescribeAnomalyDetector (..),
    newDescribeAnomalyDetector,

    -- * Request Lenses
    describeAnomalyDetector_anomalyDetectorArn,

    -- * Destructuring the Response
    DescribeAnomalyDetectorResponse (..),
    newDescribeAnomalyDetectorResponse,

    -- * Response Lenses
    describeAnomalyDetectorResponse_anomalyDetectorArn,
    describeAnomalyDetectorResponse_anomalyDetectorConfig,
    describeAnomalyDetectorResponse_anomalyDetectorDescription,
    describeAnomalyDetectorResponse_anomalyDetectorName,
    describeAnomalyDetectorResponse_creationTime,
    describeAnomalyDetectorResponse_failureReason,
    describeAnomalyDetectorResponse_failureType,
    describeAnomalyDetectorResponse_kmsKeyArn,
    describeAnomalyDetectorResponse_lastModificationTime,
    describeAnomalyDetectorResponse_status,
    describeAnomalyDetectorResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeAnomalyDetector' smart constructor.
data DescribeAnomalyDetector = DescribeAnomalyDetector'
  { -- | The ARN of the detector to describe.
    DescribeAnomalyDetector -> Text
anomalyDetectorArn :: Prelude.Text
  }
  deriving (DescribeAnomalyDetector -> DescribeAnomalyDetector -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAnomalyDetector -> DescribeAnomalyDetector -> Bool
$c/= :: DescribeAnomalyDetector -> DescribeAnomalyDetector -> Bool
== :: DescribeAnomalyDetector -> DescribeAnomalyDetector -> Bool
$c== :: DescribeAnomalyDetector -> DescribeAnomalyDetector -> Bool
Prelude.Eq, ReadPrec [DescribeAnomalyDetector]
ReadPrec DescribeAnomalyDetector
Int -> ReadS DescribeAnomalyDetector
ReadS [DescribeAnomalyDetector]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAnomalyDetector]
$creadListPrec :: ReadPrec [DescribeAnomalyDetector]
readPrec :: ReadPrec DescribeAnomalyDetector
$creadPrec :: ReadPrec DescribeAnomalyDetector
readList :: ReadS [DescribeAnomalyDetector]
$creadList :: ReadS [DescribeAnomalyDetector]
readsPrec :: Int -> ReadS DescribeAnomalyDetector
$creadsPrec :: Int -> ReadS DescribeAnomalyDetector
Prelude.Read, Int -> DescribeAnomalyDetector -> ShowS
[DescribeAnomalyDetector] -> ShowS
DescribeAnomalyDetector -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAnomalyDetector] -> ShowS
$cshowList :: [DescribeAnomalyDetector] -> ShowS
show :: DescribeAnomalyDetector -> String
$cshow :: DescribeAnomalyDetector -> String
showsPrec :: Int -> DescribeAnomalyDetector -> ShowS
$cshowsPrec :: Int -> DescribeAnomalyDetector -> ShowS
Prelude.Show, forall x. Rep DescribeAnomalyDetector x -> DescribeAnomalyDetector
forall x. DescribeAnomalyDetector -> Rep DescribeAnomalyDetector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAnomalyDetector x -> DescribeAnomalyDetector
$cfrom :: forall x. DescribeAnomalyDetector -> Rep DescribeAnomalyDetector x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAnomalyDetector' 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:
--
-- 'anomalyDetectorArn', 'describeAnomalyDetector_anomalyDetectorArn' - The ARN of the detector to describe.
newDescribeAnomalyDetector ::
  -- | 'anomalyDetectorArn'
  Prelude.Text ->
  DescribeAnomalyDetector
newDescribeAnomalyDetector :: Text -> DescribeAnomalyDetector
newDescribeAnomalyDetector Text
pAnomalyDetectorArn_ =
  DescribeAnomalyDetector'
    { $sel:anomalyDetectorArn:DescribeAnomalyDetector' :: Text
anomalyDetectorArn =
        Text
pAnomalyDetectorArn_
    }

-- | The ARN of the detector to describe.
describeAnomalyDetector_anomalyDetectorArn :: Lens.Lens' DescribeAnomalyDetector Prelude.Text
describeAnomalyDetector_anomalyDetectorArn :: Lens' DescribeAnomalyDetector Text
describeAnomalyDetector_anomalyDetectorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAnomalyDetector' {Text
anomalyDetectorArn :: Text
$sel:anomalyDetectorArn:DescribeAnomalyDetector' :: DescribeAnomalyDetector -> Text
anomalyDetectorArn} -> Text
anomalyDetectorArn) (\s :: DescribeAnomalyDetector
s@DescribeAnomalyDetector' {} Text
a -> DescribeAnomalyDetector
s {$sel:anomalyDetectorArn:DescribeAnomalyDetector' :: Text
anomalyDetectorArn = Text
a} :: DescribeAnomalyDetector)

instance Core.AWSRequest DescribeAnomalyDetector where
  type
    AWSResponse DescribeAnomalyDetector =
      DescribeAnomalyDetectorResponse
  request :: (Service -> Service)
-> DescribeAnomalyDetector -> Request DescribeAnomalyDetector
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeAnomalyDetector
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAnomalyDetector)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe AnomalyDetectorConfigSummary
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe AnomalyDetectorFailureType
-> Maybe Text
-> Maybe POSIX
-> Maybe AnomalyDetectorStatus
-> Int
-> DescribeAnomalyDetectorResponse
DescribeAnomalyDetectorResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"AnomalyDetectorArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"AnomalyDetectorConfig")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"AnomalyDetectorDescription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"AnomalyDetectorName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"FailureReason")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"FailureType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"KmsKeyArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LastModificationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Status")
            forall (f :: * -> *) a b. Applicative f => 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 DescribeAnomalyDetector where
  hashWithSalt :: Int -> DescribeAnomalyDetector -> Int
hashWithSalt Int
_salt DescribeAnomalyDetector' {Text
anomalyDetectorArn :: Text
$sel:anomalyDetectorArn:DescribeAnomalyDetector' :: DescribeAnomalyDetector -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
anomalyDetectorArn

instance Prelude.NFData DescribeAnomalyDetector where
  rnf :: DescribeAnomalyDetector -> ()
rnf DescribeAnomalyDetector' {Text
anomalyDetectorArn :: Text
$sel:anomalyDetectorArn:DescribeAnomalyDetector' :: DescribeAnomalyDetector -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
anomalyDetectorArn

instance Data.ToHeaders DescribeAnomalyDetector where
  toHeaders :: DescribeAnomalyDetector -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DescribeAnomalyDetector where
  toJSON :: DescribeAnomalyDetector -> Value
toJSON DescribeAnomalyDetector' {Text
anomalyDetectorArn :: Text
$sel:anomalyDetectorArn:DescribeAnomalyDetector' :: DescribeAnomalyDetector -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"AnomalyDetectorArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
anomalyDetectorArn)
          ]
      )

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

instance Data.ToQuery DescribeAnomalyDetector where
  toQuery :: DescribeAnomalyDetector -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeAnomalyDetectorResponse' smart constructor.
data DescribeAnomalyDetectorResponse = DescribeAnomalyDetectorResponse'
  { -- | The ARN of the detector.
    DescribeAnomalyDetectorResponse -> Maybe Text
anomalyDetectorArn :: Prelude.Maybe Prelude.Text,
    -- | Contains information about the detector\'s configuration.
    DescribeAnomalyDetectorResponse
-> Maybe AnomalyDetectorConfigSummary
anomalyDetectorConfig :: Prelude.Maybe AnomalyDetectorConfigSummary,
    -- | A description of the detector.
    DescribeAnomalyDetectorResponse -> Maybe Text
anomalyDetectorDescription :: Prelude.Maybe Prelude.Text,
    -- | The name of the detector.
    DescribeAnomalyDetectorResponse -> Maybe Text
anomalyDetectorName :: Prelude.Maybe Prelude.Text,
    -- | The time at which the detector was created.
    DescribeAnomalyDetectorResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | The reason that the detector failed.
    DescribeAnomalyDetectorResponse -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The process that caused the detector to fail.
    DescribeAnomalyDetectorResponse -> Maybe AnomalyDetectorFailureType
failureType :: Prelude.Maybe AnomalyDetectorFailureType,
    -- | The ARN of the KMS key to use to encrypt your data.
    DescribeAnomalyDetectorResponse -> Maybe Text
kmsKeyArn :: Prelude.Maybe Prelude.Text,
    -- | The time at which the detector was last modified.
    DescribeAnomalyDetectorResponse -> Maybe POSIX
lastModificationTime :: Prelude.Maybe Data.POSIX,
    -- | The status of the detector.
    DescribeAnomalyDetectorResponse -> Maybe AnomalyDetectorStatus
status :: Prelude.Maybe AnomalyDetectorStatus,
    -- | The response's http status code.
    DescribeAnomalyDetectorResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAnomalyDetectorResponse
-> DescribeAnomalyDetectorResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAnomalyDetectorResponse
-> DescribeAnomalyDetectorResponse -> Bool
$c/= :: DescribeAnomalyDetectorResponse
-> DescribeAnomalyDetectorResponse -> Bool
== :: DescribeAnomalyDetectorResponse
-> DescribeAnomalyDetectorResponse -> Bool
$c== :: DescribeAnomalyDetectorResponse
-> DescribeAnomalyDetectorResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAnomalyDetectorResponse]
ReadPrec DescribeAnomalyDetectorResponse
Int -> ReadS DescribeAnomalyDetectorResponse
ReadS [DescribeAnomalyDetectorResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAnomalyDetectorResponse]
$creadListPrec :: ReadPrec [DescribeAnomalyDetectorResponse]
readPrec :: ReadPrec DescribeAnomalyDetectorResponse
$creadPrec :: ReadPrec DescribeAnomalyDetectorResponse
readList :: ReadS [DescribeAnomalyDetectorResponse]
$creadList :: ReadS [DescribeAnomalyDetectorResponse]
readsPrec :: Int -> ReadS DescribeAnomalyDetectorResponse
$creadsPrec :: Int -> ReadS DescribeAnomalyDetectorResponse
Prelude.Read, Int -> DescribeAnomalyDetectorResponse -> ShowS
[DescribeAnomalyDetectorResponse] -> ShowS
DescribeAnomalyDetectorResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAnomalyDetectorResponse] -> ShowS
$cshowList :: [DescribeAnomalyDetectorResponse] -> ShowS
show :: DescribeAnomalyDetectorResponse -> String
$cshow :: DescribeAnomalyDetectorResponse -> String
showsPrec :: Int -> DescribeAnomalyDetectorResponse -> ShowS
$cshowsPrec :: Int -> DescribeAnomalyDetectorResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeAnomalyDetectorResponse x
-> DescribeAnomalyDetectorResponse
forall x.
DescribeAnomalyDetectorResponse
-> Rep DescribeAnomalyDetectorResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAnomalyDetectorResponse x
-> DescribeAnomalyDetectorResponse
$cfrom :: forall x.
DescribeAnomalyDetectorResponse
-> Rep DescribeAnomalyDetectorResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAnomalyDetectorResponse' 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:
--
-- 'anomalyDetectorArn', 'describeAnomalyDetectorResponse_anomalyDetectorArn' - The ARN of the detector.
--
-- 'anomalyDetectorConfig', 'describeAnomalyDetectorResponse_anomalyDetectorConfig' - Contains information about the detector\'s configuration.
--
-- 'anomalyDetectorDescription', 'describeAnomalyDetectorResponse_anomalyDetectorDescription' - A description of the detector.
--
-- 'anomalyDetectorName', 'describeAnomalyDetectorResponse_anomalyDetectorName' - The name of the detector.
--
-- 'creationTime', 'describeAnomalyDetectorResponse_creationTime' - The time at which the detector was created.
--
-- 'failureReason', 'describeAnomalyDetectorResponse_failureReason' - The reason that the detector failed.
--
-- 'failureType', 'describeAnomalyDetectorResponse_failureType' - The process that caused the detector to fail.
--
-- 'kmsKeyArn', 'describeAnomalyDetectorResponse_kmsKeyArn' - The ARN of the KMS key to use to encrypt your data.
--
-- 'lastModificationTime', 'describeAnomalyDetectorResponse_lastModificationTime' - The time at which the detector was last modified.
--
-- 'status', 'describeAnomalyDetectorResponse_status' - The status of the detector.
--
-- 'httpStatus', 'describeAnomalyDetectorResponse_httpStatus' - The response's http status code.
newDescribeAnomalyDetectorResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAnomalyDetectorResponse
newDescribeAnomalyDetectorResponse :: Int -> DescribeAnomalyDetectorResponse
newDescribeAnomalyDetectorResponse Int
pHttpStatus_ =
  DescribeAnomalyDetectorResponse'
    { $sel:anomalyDetectorArn:DescribeAnomalyDetectorResponse' :: Maybe Text
anomalyDetectorArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:anomalyDetectorConfig:DescribeAnomalyDetectorResponse' :: Maybe AnomalyDetectorConfigSummary
anomalyDetectorConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:anomalyDetectorDescription:DescribeAnomalyDetectorResponse' :: Maybe Text
anomalyDetectorDescription =
        forall a. Maybe a
Prelude.Nothing,
      $sel:anomalyDetectorName:DescribeAnomalyDetectorResponse' :: Maybe Text
anomalyDetectorName = forall a. Maybe a
Prelude.Nothing,
      $sel:creationTime:DescribeAnomalyDetectorResponse' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:failureReason:DescribeAnomalyDetectorResponse' :: Maybe Text
failureReason = forall a. Maybe a
Prelude.Nothing,
      $sel:failureType:DescribeAnomalyDetectorResponse' :: Maybe AnomalyDetectorFailureType
failureType = forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyArn:DescribeAnomalyDetectorResponse' :: Maybe Text
kmsKeyArn = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModificationTime:DescribeAnomalyDetectorResponse' :: Maybe POSIX
lastModificationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:status:DescribeAnomalyDetectorResponse' :: Maybe AnomalyDetectorStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeAnomalyDetectorResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the detector.
describeAnomalyDetectorResponse_anomalyDetectorArn :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe Prelude.Text)
describeAnomalyDetectorResponse_anomalyDetectorArn :: Lens' DescribeAnomalyDetectorResponse (Maybe Text)
describeAnomalyDetectorResponse_anomalyDetectorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAnomalyDetectorResponse' {Maybe Text
anomalyDetectorArn :: Maybe Text
$sel:anomalyDetectorArn:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe Text
anomalyDetectorArn} -> Maybe Text
anomalyDetectorArn) (\s :: DescribeAnomalyDetectorResponse
s@DescribeAnomalyDetectorResponse' {} Maybe Text
a -> DescribeAnomalyDetectorResponse
s {$sel:anomalyDetectorArn:DescribeAnomalyDetectorResponse' :: Maybe Text
anomalyDetectorArn = Maybe Text
a} :: DescribeAnomalyDetectorResponse)

-- | Contains information about the detector\'s configuration.
describeAnomalyDetectorResponse_anomalyDetectorConfig :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe AnomalyDetectorConfigSummary)
describeAnomalyDetectorResponse_anomalyDetectorConfig :: Lens'
  DescribeAnomalyDetectorResponse
  (Maybe AnomalyDetectorConfigSummary)
describeAnomalyDetectorResponse_anomalyDetectorConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAnomalyDetectorResponse' {Maybe AnomalyDetectorConfigSummary
anomalyDetectorConfig :: Maybe AnomalyDetectorConfigSummary
$sel:anomalyDetectorConfig:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse
-> Maybe AnomalyDetectorConfigSummary
anomalyDetectorConfig} -> Maybe AnomalyDetectorConfigSummary
anomalyDetectorConfig) (\s :: DescribeAnomalyDetectorResponse
s@DescribeAnomalyDetectorResponse' {} Maybe AnomalyDetectorConfigSummary
a -> DescribeAnomalyDetectorResponse
s {$sel:anomalyDetectorConfig:DescribeAnomalyDetectorResponse' :: Maybe AnomalyDetectorConfigSummary
anomalyDetectorConfig = Maybe AnomalyDetectorConfigSummary
a} :: DescribeAnomalyDetectorResponse)

-- | A description of the detector.
describeAnomalyDetectorResponse_anomalyDetectorDescription :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe Prelude.Text)
describeAnomalyDetectorResponse_anomalyDetectorDescription :: Lens' DescribeAnomalyDetectorResponse (Maybe Text)
describeAnomalyDetectorResponse_anomalyDetectorDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAnomalyDetectorResponse' {Maybe Text
anomalyDetectorDescription :: Maybe Text
$sel:anomalyDetectorDescription:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe Text
anomalyDetectorDescription} -> Maybe Text
anomalyDetectorDescription) (\s :: DescribeAnomalyDetectorResponse
s@DescribeAnomalyDetectorResponse' {} Maybe Text
a -> DescribeAnomalyDetectorResponse
s {$sel:anomalyDetectorDescription:DescribeAnomalyDetectorResponse' :: Maybe Text
anomalyDetectorDescription = Maybe Text
a} :: DescribeAnomalyDetectorResponse)

-- | The name of the detector.
describeAnomalyDetectorResponse_anomalyDetectorName :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe Prelude.Text)
describeAnomalyDetectorResponse_anomalyDetectorName :: Lens' DescribeAnomalyDetectorResponse (Maybe Text)
describeAnomalyDetectorResponse_anomalyDetectorName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAnomalyDetectorResponse' {Maybe Text
anomalyDetectorName :: Maybe Text
$sel:anomalyDetectorName:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe Text
anomalyDetectorName} -> Maybe Text
anomalyDetectorName) (\s :: DescribeAnomalyDetectorResponse
s@DescribeAnomalyDetectorResponse' {} Maybe Text
a -> DescribeAnomalyDetectorResponse
s {$sel:anomalyDetectorName:DescribeAnomalyDetectorResponse' :: Maybe Text
anomalyDetectorName = Maybe Text
a} :: DescribeAnomalyDetectorResponse)

-- | The time at which the detector was created.
describeAnomalyDetectorResponse_creationTime :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe Prelude.UTCTime)
describeAnomalyDetectorResponse_creationTime :: Lens' DescribeAnomalyDetectorResponse (Maybe UTCTime)
describeAnomalyDetectorResponse_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAnomalyDetectorResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DescribeAnomalyDetectorResponse
s@DescribeAnomalyDetectorResponse' {} Maybe POSIX
a -> DescribeAnomalyDetectorResponse
s {$sel:creationTime:DescribeAnomalyDetectorResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DescribeAnomalyDetectorResponse) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The reason that the detector failed.
describeAnomalyDetectorResponse_failureReason :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe Prelude.Text)
describeAnomalyDetectorResponse_failureReason :: Lens' DescribeAnomalyDetectorResponse (Maybe Text)
describeAnomalyDetectorResponse_failureReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAnomalyDetectorResponse' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: DescribeAnomalyDetectorResponse
s@DescribeAnomalyDetectorResponse' {} Maybe Text
a -> DescribeAnomalyDetectorResponse
s {$sel:failureReason:DescribeAnomalyDetectorResponse' :: Maybe Text
failureReason = Maybe Text
a} :: DescribeAnomalyDetectorResponse)

-- | The process that caused the detector to fail.
describeAnomalyDetectorResponse_failureType :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe AnomalyDetectorFailureType)
describeAnomalyDetectorResponse_failureType :: Lens'
  DescribeAnomalyDetectorResponse (Maybe AnomalyDetectorFailureType)
describeAnomalyDetectorResponse_failureType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAnomalyDetectorResponse' {Maybe AnomalyDetectorFailureType
failureType :: Maybe AnomalyDetectorFailureType
$sel:failureType:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe AnomalyDetectorFailureType
failureType} -> Maybe AnomalyDetectorFailureType
failureType) (\s :: DescribeAnomalyDetectorResponse
s@DescribeAnomalyDetectorResponse' {} Maybe AnomalyDetectorFailureType
a -> DescribeAnomalyDetectorResponse
s {$sel:failureType:DescribeAnomalyDetectorResponse' :: Maybe AnomalyDetectorFailureType
failureType = Maybe AnomalyDetectorFailureType
a} :: DescribeAnomalyDetectorResponse)

-- | The ARN of the KMS key to use to encrypt your data.
describeAnomalyDetectorResponse_kmsKeyArn :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe Prelude.Text)
describeAnomalyDetectorResponse_kmsKeyArn :: Lens' DescribeAnomalyDetectorResponse (Maybe Text)
describeAnomalyDetectorResponse_kmsKeyArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAnomalyDetectorResponse' {Maybe Text
kmsKeyArn :: Maybe Text
$sel:kmsKeyArn:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe Text
kmsKeyArn} -> Maybe Text
kmsKeyArn) (\s :: DescribeAnomalyDetectorResponse
s@DescribeAnomalyDetectorResponse' {} Maybe Text
a -> DescribeAnomalyDetectorResponse
s {$sel:kmsKeyArn:DescribeAnomalyDetectorResponse' :: Maybe Text
kmsKeyArn = Maybe Text
a} :: DescribeAnomalyDetectorResponse)

-- | The time at which the detector was last modified.
describeAnomalyDetectorResponse_lastModificationTime :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe Prelude.UTCTime)
describeAnomalyDetectorResponse_lastModificationTime :: Lens' DescribeAnomalyDetectorResponse (Maybe UTCTime)
describeAnomalyDetectorResponse_lastModificationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAnomalyDetectorResponse' {Maybe POSIX
lastModificationTime :: Maybe POSIX
$sel:lastModificationTime:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe POSIX
lastModificationTime} -> Maybe POSIX
lastModificationTime) (\s :: DescribeAnomalyDetectorResponse
s@DescribeAnomalyDetectorResponse' {} Maybe POSIX
a -> DescribeAnomalyDetectorResponse
s {$sel:lastModificationTime:DescribeAnomalyDetectorResponse' :: Maybe POSIX
lastModificationTime = Maybe POSIX
a} :: DescribeAnomalyDetectorResponse) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The status of the detector.
describeAnomalyDetectorResponse_status :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe AnomalyDetectorStatus)
describeAnomalyDetectorResponse_status :: Lens' DescribeAnomalyDetectorResponse (Maybe AnomalyDetectorStatus)
describeAnomalyDetectorResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAnomalyDetectorResponse' {Maybe AnomalyDetectorStatus
status :: Maybe AnomalyDetectorStatus
$sel:status:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe AnomalyDetectorStatus
status} -> Maybe AnomalyDetectorStatus
status) (\s :: DescribeAnomalyDetectorResponse
s@DescribeAnomalyDetectorResponse' {} Maybe AnomalyDetectorStatus
a -> DescribeAnomalyDetectorResponse
s {$sel:status:DescribeAnomalyDetectorResponse' :: Maybe AnomalyDetectorStatus
status = Maybe AnomalyDetectorStatus
a} :: DescribeAnomalyDetectorResponse)

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

instance
  Prelude.NFData
    DescribeAnomalyDetectorResponse
  where
  rnf :: DescribeAnomalyDetectorResponse -> ()
rnf DescribeAnomalyDetectorResponse' {Int
Maybe Text
Maybe POSIX
Maybe AnomalyDetectorFailureType
Maybe AnomalyDetectorStatus
Maybe AnomalyDetectorConfigSummary
httpStatus :: Int
status :: Maybe AnomalyDetectorStatus
lastModificationTime :: Maybe POSIX
kmsKeyArn :: Maybe Text
failureType :: Maybe AnomalyDetectorFailureType
failureReason :: Maybe Text
creationTime :: Maybe POSIX
anomalyDetectorName :: Maybe Text
anomalyDetectorDescription :: Maybe Text
anomalyDetectorConfig :: Maybe AnomalyDetectorConfigSummary
anomalyDetectorArn :: Maybe Text
$sel:httpStatus:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Int
$sel:status:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe AnomalyDetectorStatus
$sel:lastModificationTime:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe POSIX
$sel:kmsKeyArn:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe Text
$sel:failureType:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe AnomalyDetectorFailureType
$sel:failureReason:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe Text
$sel:creationTime:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe POSIX
$sel:anomalyDetectorName:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe Text
$sel:anomalyDetectorDescription:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe Text
$sel:anomalyDetectorConfig:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse
-> Maybe AnomalyDetectorConfigSummary
$sel:anomalyDetectorArn:DescribeAnomalyDetectorResponse' :: DescribeAnomalyDetectorResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
anomalyDetectorArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AnomalyDetectorConfigSummary
anomalyDetectorConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
anomalyDetectorDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
anomalyDetectorName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
failureReason
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AnomalyDetectorFailureType
failureType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModificationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AnomalyDetectorStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus