{-# 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-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)
--
-- 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_creationTime,
    describeAnomalyDetectorResponse_status,
    describeAnomalyDetectorResponse_failureReason,
    describeAnomalyDetectorResponse_kmsKeyArn,
    describeAnomalyDetectorResponse_anomalyDetectorArn,
    describeAnomalyDetectorResponse_anomalyDetectorConfig,
    describeAnomalyDetectorResponse_anomalyDetectorName,
    describeAnomalyDetectorResponse_anomalyDetectorDescription,
    describeAnomalyDetectorResponse_lastModificationTime,
    describeAnomalyDetectorResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(DescribeAnomalyDetector -> DescribeAnomalyDetector -> Bool)
-> (DescribeAnomalyDetector -> DescribeAnomalyDetector -> Bool)
-> Eq DescribeAnomalyDetector
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]
(Int -> ReadS DescribeAnomalyDetector)
-> ReadS [DescribeAnomalyDetector]
-> ReadPrec DescribeAnomalyDetector
-> ReadPrec [DescribeAnomalyDetector]
-> Read 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
(Int -> DescribeAnomalyDetector -> ShowS)
-> (DescribeAnomalyDetector -> String)
-> ([DescribeAnomalyDetector] -> ShowS)
-> Show DescribeAnomalyDetector
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.
 DescribeAnomalyDetector -> Rep DescribeAnomalyDetector x)
-> (forall x.
    Rep DescribeAnomalyDetector x -> DescribeAnomalyDetector)
-> Generic DescribeAnomalyDetector
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' :: Text -> DescribeAnomalyDetector
DescribeAnomalyDetector'
    { $sel:anomalyDetectorArn:DescribeAnomalyDetector' :: Text
anomalyDetectorArn =
        Text
pAnomalyDetectorArn_
    }

-- | The ARN of the detector to describe.
describeAnomalyDetector_anomalyDetectorArn :: Lens.Lens' DescribeAnomalyDetector Prelude.Text
describeAnomalyDetector_anomalyDetectorArn :: (Text -> f Text)
-> DescribeAnomalyDetector -> f DescribeAnomalyDetector
describeAnomalyDetector_anomalyDetectorArn = (DescribeAnomalyDetector -> Text)
-> (DescribeAnomalyDetector -> Text -> DescribeAnomalyDetector)
-> Lens DescribeAnomalyDetector DescribeAnomalyDetector Text Text
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 :: DescribeAnomalyDetector -> Request DescribeAnomalyDetector
request = Service
-> DescribeAnomalyDetector -> Request DescribeAnomalyDetector
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeAnomalyDetector
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAnomalyDetector)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeAnomalyDetector))
-> Logger
-> Service
-> Proxy DescribeAnomalyDetector
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAnomalyDetector)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe POSIX
-> Maybe AnomalyDetectorStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AnomalyDetectorConfigSummary
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Int
-> DescribeAnomalyDetectorResponse
DescribeAnomalyDetectorResponse'
            (Maybe POSIX
 -> Maybe AnomalyDetectorStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AnomalyDetectorConfigSummary
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Int
 -> DescribeAnomalyDetectorResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe AnomalyDetectorStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AnomalyDetectorConfigSummary
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> DescribeAnomalyDetectorResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationTime")
            Either
  String
  (Maybe AnomalyDetectorStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AnomalyDetectorConfigSummary
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> DescribeAnomalyDetectorResponse)
-> Either String (Maybe AnomalyDetectorStatus)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AnomalyDetectorConfigSummary
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> DescribeAnomalyDetectorResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AnomalyDetectorStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AnomalyDetectorConfigSummary
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> DescribeAnomalyDetectorResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe AnomalyDetectorConfigSummary
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> DescribeAnomalyDetectorResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FailureReason")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe AnomalyDetectorConfigSummary
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> DescribeAnomalyDetectorResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe AnomalyDetectorConfigSummary
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> DescribeAnomalyDetectorResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"KmsKeyArn")
            Either
  String
  (Maybe Text
   -> Maybe AnomalyDetectorConfigSummary
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> DescribeAnomalyDetectorResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe AnomalyDetectorConfigSummary
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> DescribeAnomalyDetectorResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AnomalyDetectorArn")
            Either
  String
  (Maybe AnomalyDetectorConfigSummary
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> DescribeAnomalyDetectorResponse)
-> Either String (Maybe AnomalyDetectorConfigSummary)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> DescribeAnomalyDetectorResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe AnomalyDetectorConfigSummary)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AnomalyDetectorConfig")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> DescribeAnomalyDetectorResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX -> Int -> DescribeAnomalyDetectorResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AnomalyDetectorName")
            Either
  String
  (Maybe Text
   -> Maybe POSIX -> Int -> DescribeAnomalyDetectorResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe POSIX -> Int -> DescribeAnomalyDetectorResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AnomalyDetectorDescription")
            Either
  String (Maybe POSIX -> Int -> DescribeAnomalyDetectorResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> DescribeAnomalyDetectorResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LastModificationTime")
            Either String (Int -> DescribeAnomalyDetectorResponse)
-> Either String Int
-> Either String DescribeAnomalyDetectorResponse
forall (f :: * -> *) a b. Applicative f => 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 DescribeAnomalyDetector

instance Prelude.NFData DescribeAnomalyDetector

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

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

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

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

-- | /See:/ 'newDescribeAnomalyDetectorResponse' smart constructor.
data DescribeAnomalyDetectorResponse = DescribeAnomalyDetectorResponse'
  { -- | The time at which the detector was created.
    DescribeAnomalyDetectorResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status of the detector.
    DescribeAnomalyDetectorResponse -> Maybe AnomalyDetectorStatus
status :: Prelude.Maybe AnomalyDetectorStatus,
    -- | The reason that the detector failed, if any.
    DescribeAnomalyDetectorResponse -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the KMS key to use to encrypt your data.
    DescribeAnomalyDetectorResponse -> Maybe Text
kmsKeyArn :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | The name of the detector.
    DescribeAnomalyDetectorResponse -> Maybe Text
anomalyDetectorName :: Prelude.Maybe Prelude.Text,
    -- | A description of the detector.
    DescribeAnomalyDetectorResponse -> Maybe Text
anomalyDetectorDescription :: Prelude.Maybe Prelude.Text,
    -- | The time at which the detector was last modified.
    DescribeAnomalyDetectorResponse -> Maybe POSIX
lastModificationTime :: Prelude.Maybe Core.POSIX,
    -- | The response's http status code.
    DescribeAnomalyDetectorResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAnomalyDetectorResponse
-> DescribeAnomalyDetectorResponse -> Bool
(DescribeAnomalyDetectorResponse
 -> DescribeAnomalyDetectorResponse -> Bool)
-> (DescribeAnomalyDetectorResponse
    -> DescribeAnomalyDetectorResponse -> Bool)
-> Eq DescribeAnomalyDetectorResponse
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]
(Int -> ReadS DescribeAnomalyDetectorResponse)
-> ReadS [DescribeAnomalyDetectorResponse]
-> ReadPrec DescribeAnomalyDetectorResponse
-> ReadPrec [DescribeAnomalyDetectorResponse]
-> Read 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
(Int -> DescribeAnomalyDetectorResponse -> ShowS)
-> (DescribeAnomalyDetectorResponse -> String)
-> ([DescribeAnomalyDetectorResponse] -> ShowS)
-> Show DescribeAnomalyDetectorResponse
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.
 DescribeAnomalyDetectorResponse
 -> Rep DescribeAnomalyDetectorResponse x)
-> (forall x.
    Rep DescribeAnomalyDetectorResponse x
    -> DescribeAnomalyDetectorResponse)
-> Generic DescribeAnomalyDetectorResponse
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:
--
-- 'creationTime', 'describeAnomalyDetectorResponse_creationTime' - The time at which the detector was created.
--
-- 'status', 'describeAnomalyDetectorResponse_status' - The status of the detector.
--
-- 'failureReason', 'describeAnomalyDetectorResponse_failureReason' - The reason that the detector failed, if any.
--
-- 'kmsKeyArn', 'describeAnomalyDetectorResponse_kmsKeyArn' - The ARN of the KMS key to use to encrypt your data.
--
-- 'anomalyDetectorArn', 'describeAnomalyDetectorResponse_anomalyDetectorArn' - The ARN of the detector.
--
-- 'anomalyDetectorConfig', 'describeAnomalyDetectorResponse_anomalyDetectorConfig' - Contains information about the detector\'s configuration.
--
-- 'anomalyDetectorName', 'describeAnomalyDetectorResponse_anomalyDetectorName' - The name of the detector.
--
-- 'anomalyDetectorDescription', 'describeAnomalyDetectorResponse_anomalyDetectorDescription' - A description of the detector.
--
-- 'lastModificationTime', 'describeAnomalyDetectorResponse_lastModificationTime' - The time at which the detector was last modified.
--
-- 'httpStatus', 'describeAnomalyDetectorResponse_httpStatus' - The response's http status code.
newDescribeAnomalyDetectorResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAnomalyDetectorResponse
newDescribeAnomalyDetectorResponse :: Int -> DescribeAnomalyDetectorResponse
newDescribeAnomalyDetectorResponse Int
pHttpStatus_ =
  DescribeAnomalyDetectorResponse' :: Maybe POSIX
-> Maybe AnomalyDetectorStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AnomalyDetectorConfigSummary
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Int
-> DescribeAnomalyDetectorResponse
DescribeAnomalyDetectorResponse'
    { $sel:creationTime:DescribeAnomalyDetectorResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:DescribeAnomalyDetectorResponse' :: Maybe AnomalyDetectorStatus
status = Maybe AnomalyDetectorStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:failureReason:DescribeAnomalyDetectorResponse' :: Maybe Text
failureReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyArn:DescribeAnomalyDetectorResponse' :: Maybe Text
kmsKeyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:anomalyDetectorArn:DescribeAnomalyDetectorResponse' :: Maybe Text
anomalyDetectorArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:anomalyDetectorConfig:DescribeAnomalyDetectorResponse' :: Maybe AnomalyDetectorConfigSummary
anomalyDetectorConfig = Maybe AnomalyDetectorConfigSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:anomalyDetectorName:DescribeAnomalyDetectorResponse' :: Maybe Text
anomalyDetectorName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:anomalyDetectorDescription:DescribeAnomalyDetectorResponse' :: Maybe Text
anomalyDetectorDescription =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModificationTime:DescribeAnomalyDetectorResponse' :: Maybe POSIX
lastModificationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeAnomalyDetectorResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The time at which the detector was created.
describeAnomalyDetectorResponse_creationTime :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe Prelude.UTCTime)
describeAnomalyDetectorResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAnomalyDetectorResponse
-> f DescribeAnomalyDetectorResponse
describeAnomalyDetectorResponse_creationTime = (DescribeAnomalyDetectorResponse -> Maybe POSIX)
-> (DescribeAnomalyDetectorResponse
    -> Maybe POSIX -> DescribeAnomalyDetectorResponse)
-> Lens
     DescribeAnomalyDetectorResponse
     DescribeAnomalyDetectorResponse
     (Maybe POSIX)
     (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeAnomalyDetectorResponse
 -> f DescribeAnomalyDetectorResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAnomalyDetectorResponse
-> f DescribeAnomalyDetectorResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The status of the detector.
describeAnomalyDetectorResponse_status :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe AnomalyDetectorStatus)
describeAnomalyDetectorResponse_status :: (Maybe AnomalyDetectorStatus -> f (Maybe AnomalyDetectorStatus))
-> DescribeAnomalyDetectorResponse
-> f DescribeAnomalyDetectorResponse
describeAnomalyDetectorResponse_status = (DescribeAnomalyDetectorResponse -> Maybe AnomalyDetectorStatus)
-> (DescribeAnomalyDetectorResponse
    -> Maybe AnomalyDetectorStatus -> DescribeAnomalyDetectorResponse)
-> Lens
     DescribeAnomalyDetectorResponse
     DescribeAnomalyDetectorResponse
     (Maybe AnomalyDetectorStatus)
     (Maybe AnomalyDetectorStatus)
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 reason that the detector failed, if any.
describeAnomalyDetectorResponse_failureReason :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe Prelude.Text)
describeAnomalyDetectorResponse_failureReason :: (Maybe Text -> f (Maybe Text))
-> DescribeAnomalyDetectorResponse
-> f DescribeAnomalyDetectorResponse
describeAnomalyDetectorResponse_failureReason = (DescribeAnomalyDetectorResponse -> Maybe Text)
-> (DescribeAnomalyDetectorResponse
    -> Maybe Text -> DescribeAnomalyDetectorResponse)
-> Lens
     DescribeAnomalyDetectorResponse
     DescribeAnomalyDetectorResponse
     (Maybe Text)
     (Maybe Text)
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 ARN of the KMS key to use to encrypt your data.
describeAnomalyDetectorResponse_kmsKeyArn :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe Prelude.Text)
describeAnomalyDetectorResponse_kmsKeyArn :: (Maybe Text -> f (Maybe Text))
-> DescribeAnomalyDetectorResponse
-> f DescribeAnomalyDetectorResponse
describeAnomalyDetectorResponse_kmsKeyArn = (DescribeAnomalyDetectorResponse -> Maybe Text)
-> (DescribeAnomalyDetectorResponse
    -> Maybe Text -> DescribeAnomalyDetectorResponse)
-> Lens
     DescribeAnomalyDetectorResponse
     DescribeAnomalyDetectorResponse
     (Maybe Text)
     (Maybe Text)
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 ARN of the detector.
describeAnomalyDetectorResponse_anomalyDetectorArn :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe Prelude.Text)
describeAnomalyDetectorResponse_anomalyDetectorArn :: (Maybe Text -> f (Maybe Text))
-> DescribeAnomalyDetectorResponse
-> f DescribeAnomalyDetectorResponse
describeAnomalyDetectorResponse_anomalyDetectorArn = (DescribeAnomalyDetectorResponse -> Maybe Text)
-> (DescribeAnomalyDetectorResponse
    -> Maybe Text -> DescribeAnomalyDetectorResponse)
-> Lens
     DescribeAnomalyDetectorResponse
     DescribeAnomalyDetectorResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe AnomalyDetectorConfigSummary
 -> f (Maybe AnomalyDetectorConfigSummary))
-> DescribeAnomalyDetectorResponse
-> f DescribeAnomalyDetectorResponse
describeAnomalyDetectorResponse_anomalyDetectorConfig = (DescribeAnomalyDetectorResponse
 -> Maybe AnomalyDetectorConfigSummary)
-> (DescribeAnomalyDetectorResponse
    -> Maybe AnomalyDetectorConfigSummary
    -> DescribeAnomalyDetectorResponse)
-> Lens
     DescribeAnomalyDetectorResponse
     DescribeAnomalyDetectorResponse
     (Maybe AnomalyDetectorConfigSummary)
     (Maybe AnomalyDetectorConfigSummary)
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)

-- | The name of the detector.
describeAnomalyDetectorResponse_anomalyDetectorName :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe Prelude.Text)
describeAnomalyDetectorResponse_anomalyDetectorName :: (Maybe Text -> f (Maybe Text))
-> DescribeAnomalyDetectorResponse
-> f DescribeAnomalyDetectorResponse
describeAnomalyDetectorResponse_anomalyDetectorName = (DescribeAnomalyDetectorResponse -> Maybe Text)
-> (DescribeAnomalyDetectorResponse
    -> Maybe Text -> DescribeAnomalyDetectorResponse)
-> Lens
     DescribeAnomalyDetectorResponse
     DescribeAnomalyDetectorResponse
     (Maybe Text)
     (Maybe Text)
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)

-- | A description of the detector.
describeAnomalyDetectorResponse_anomalyDetectorDescription :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe Prelude.Text)
describeAnomalyDetectorResponse_anomalyDetectorDescription :: (Maybe Text -> f (Maybe Text))
-> DescribeAnomalyDetectorResponse
-> f DescribeAnomalyDetectorResponse
describeAnomalyDetectorResponse_anomalyDetectorDescription = (DescribeAnomalyDetectorResponse -> Maybe Text)
-> (DescribeAnomalyDetectorResponse
    -> Maybe Text -> DescribeAnomalyDetectorResponse)
-> Lens
     DescribeAnomalyDetectorResponse
     DescribeAnomalyDetectorResponse
     (Maybe Text)
     (Maybe Text)
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 time at which the detector was last modified.
describeAnomalyDetectorResponse_lastModificationTime :: Lens.Lens' DescribeAnomalyDetectorResponse (Prelude.Maybe Prelude.UTCTime)
describeAnomalyDetectorResponse_lastModificationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAnomalyDetectorResponse
-> f DescribeAnomalyDetectorResponse
describeAnomalyDetectorResponse_lastModificationTime = (DescribeAnomalyDetectorResponse -> Maybe POSIX)
-> (DescribeAnomalyDetectorResponse
    -> Maybe POSIX -> DescribeAnomalyDetectorResponse)
-> Lens
     DescribeAnomalyDetectorResponse
     DescribeAnomalyDetectorResponse
     (Maybe POSIX)
     (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeAnomalyDetectorResponse
 -> f DescribeAnomalyDetectorResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAnomalyDetectorResponse
-> f DescribeAnomalyDetectorResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The response's http status code.
describeAnomalyDetectorResponse_httpStatus :: Lens.Lens' DescribeAnomalyDetectorResponse Prelude.Int
describeAnomalyDetectorResponse_httpStatus :: (Int -> f Int)
-> DescribeAnomalyDetectorResponse
-> f DescribeAnomalyDetectorResponse
describeAnomalyDetectorResponse_httpStatus = (DescribeAnomalyDetectorResponse -> Int)
-> (DescribeAnomalyDetectorResponse
    -> Int -> DescribeAnomalyDetectorResponse)
-> Lens
     DescribeAnomalyDetectorResponse
     DescribeAnomalyDetectorResponse
     Int
     Int
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