{-# 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.CreateAnomalyDetector
-- 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 detector.
module Amazonka.LookoutMetrics.CreateAnomalyDetector
  ( -- * Creating a Request
    CreateAnomalyDetector (..),
    newCreateAnomalyDetector,

    -- * Request Lenses
    createAnomalyDetector_kmsKeyArn,
    createAnomalyDetector_anomalyDetectorDescription,
    createAnomalyDetector_tags,
    createAnomalyDetector_anomalyDetectorName,
    createAnomalyDetector_anomalyDetectorConfig,

    -- * Destructuring the Response
    CreateAnomalyDetectorResponse (..),
    newCreateAnomalyDetectorResponse,

    -- * Response Lenses
    createAnomalyDetectorResponse_anomalyDetectorArn,
    createAnomalyDetectorResponse_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:/ 'newCreateAnomalyDetector' smart constructor.
data CreateAnomalyDetector = CreateAnomalyDetector'
  { -- | The ARN of the KMS key to use to encrypt your data.
    CreateAnomalyDetector -> Maybe Text
kmsKeyArn :: Prelude.Maybe Prelude.Text,
    -- | A description of the detector.
    CreateAnomalyDetector -> Maybe Text
anomalyDetectorDescription :: Prelude.Maybe Prelude.Text,
    -- | A list of
    -- <https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html tags>
    -- to apply to the anomaly detector.
    CreateAnomalyDetector -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the detector.
    CreateAnomalyDetector -> Text
anomalyDetectorName :: Prelude.Text,
    -- | Contains information about the configuration of the anomaly detector.
    CreateAnomalyDetector -> AnomalyDetectorConfig
anomalyDetectorConfig :: AnomalyDetectorConfig
  }
  deriving (CreateAnomalyDetector -> CreateAnomalyDetector -> Bool
(CreateAnomalyDetector -> CreateAnomalyDetector -> Bool)
-> (CreateAnomalyDetector -> CreateAnomalyDetector -> Bool)
-> Eq CreateAnomalyDetector
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAnomalyDetector -> CreateAnomalyDetector -> Bool
$c/= :: CreateAnomalyDetector -> CreateAnomalyDetector -> Bool
== :: CreateAnomalyDetector -> CreateAnomalyDetector -> Bool
$c== :: CreateAnomalyDetector -> CreateAnomalyDetector -> Bool
Prelude.Eq, ReadPrec [CreateAnomalyDetector]
ReadPrec CreateAnomalyDetector
Int -> ReadS CreateAnomalyDetector
ReadS [CreateAnomalyDetector]
(Int -> ReadS CreateAnomalyDetector)
-> ReadS [CreateAnomalyDetector]
-> ReadPrec CreateAnomalyDetector
-> ReadPrec [CreateAnomalyDetector]
-> Read CreateAnomalyDetector
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAnomalyDetector]
$creadListPrec :: ReadPrec [CreateAnomalyDetector]
readPrec :: ReadPrec CreateAnomalyDetector
$creadPrec :: ReadPrec CreateAnomalyDetector
readList :: ReadS [CreateAnomalyDetector]
$creadList :: ReadS [CreateAnomalyDetector]
readsPrec :: Int -> ReadS CreateAnomalyDetector
$creadsPrec :: Int -> ReadS CreateAnomalyDetector
Prelude.Read, Int -> CreateAnomalyDetector -> ShowS
[CreateAnomalyDetector] -> ShowS
CreateAnomalyDetector -> String
(Int -> CreateAnomalyDetector -> ShowS)
-> (CreateAnomalyDetector -> String)
-> ([CreateAnomalyDetector] -> ShowS)
-> Show CreateAnomalyDetector
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAnomalyDetector] -> ShowS
$cshowList :: [CreateAnomalyDetector] -> ShowS
show :: CreateAnomalyDetector -> String
$cshow :: CreateAnomalyDetector -> String
showsPrec :: Int -> CreateAnomalyDetector -> ShowS
$cshowsPrec :: Int -> CreateAnomalyDetector -> ShowS
Prelude.Show, (forall x. CreateAnomalyDetector -> Rep CreateAnomalyDetector x)
-> (forall x. Rep CreateAnomalyDetector x -> CreateAnomalyDetector)
-> Generic CreateAnomalyDetector
forall x. Rep CreateAnomalyDetector x -> CreateAnomalyDetector
forall x. CreateAnomalyDetector -> Rep CreateAnomalyDetector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAnomalyDetector x -> CreateAnomalyDetector
$cfrom :: forall x. CreateAnomalyDetector -> Rep CreateAnomalyDetector x
Prelude.Generic)

-- |
-- Create a value of 'CreateAnomalyDetector' 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:
--
-- 'kmsKeyArn', 'createAnomalyDetector_kmsKeyArn' - The ARN of the KMS key to use to encrypt your data.
--
-- 'anomalyDetectorDescription', 'createAnomalyDetector_anomalyDetectorDescription' - A description of the detector.
--
-- 'tags', 'createAnomalyDetector_tags' - A list of
-- <https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html tags>
-- to apply to the anomaly detector.
--
-- 'anomalyDetectorName', 'createAnomalyDetector_anomalyDetectorName' - The name of the detector.
--
-- 'anomalyDetectorConfig', 'createAnomalyDetector_anomalyDetectorConfig' - Contains information about the configuration of the anomaly detector.
newCreateAnomalyDetector ::
  -- | 'anomalyDetectorName'
  Prelude.Text ->
  -- | 'anomalyDetectorConfig'
  AnomalyDetectorConfig ->
  CreateAnomalyDetector
newCreateAnomalyDetector :: Text -> AnomalyDetectorConfig -> CreateAnomalyDetector
newCreateAnomalyDetector
  Text
pAnomalyDetectorName_
  AnomalyDetectorConfig
pAnomalyDetectorConfig_ =
    CreateAnomalyDetector' :: Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> AnomalyDetectorConfig
-> CreateAnomalyDetector
CreateAnomalyDetector'
      { $sel:kmsKeyArn:CreateAnomalyDetector' :: Maybe Text
kmsKeyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:anomalyDetectorDescription:CreateAnomalyDetector' :: Maybe Text
anomalyDetectorDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateAnomalyDetector' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:anomalyDetectorName:CreateAnomalyDetector' :: Text
anomalyDetectorName = Text
pAnomalyDetectorName_,
        $sel:anomalyDetectorConfig:CreateAnomalyDetector' :: AnomalyDetectorConfig
anomalyDetectorConfig = AnomalyDetectorConfig
pAnomalyDetectorConfig_
      }

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

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

-- | A list of
-- <https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html tags>
-- to apply to the anomaly detector.
createAnomalyDetector_tags :: Lens.Lens' CreateAnomalyDetector (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createAnomalyDetector_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateAnomalyDetector -> f CreateAnomalyDetector
createAnomalyDetector_tags = (CreateAnomalyDetector -> Maybe (HashMap Text Text))
-> (CreateAnomalyDetector
    -> Maybe (HashMap Text Text) -> CreateAnomalyDetector)
-> Lens
     CreateAnomalyDetector
     CreateAnomalyDetector
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnomalyDetector' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateAnomalyDetector' :: CreateAnomalyDetector -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateAnomalyDetector
s@CreateAnomalyDetector' {} Maybe (HashMap Text Text)
a -> CreateAnomalyDetector
s {$sel:tags:CreateAnomalyDetector' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateAnomalyDetector) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateAnomalyDetector -> f CreateAnomalyDetector)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateAnomalyDetector
-> f CreateAnomalyDetector
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | Contains information about the configuration of the anomaly detector.
createAnomalyDetector_anomalyDetectorConfig :: Lens.Lens' CreateAnomalyDetector AnomalyDetectorConfig
createAnomalyDetector_anomalyDetectorConfig :: (AnomalyDetectorConfig -> f AnomalyDetectorConfig)
-> CreateAnomalyDetector -> f CreateAnomalyDetector
createAnomalyDetector_anomalyDetectorConfig = (CreateAnomalyDetector -> AnomalyDetectorConfig)
-> (CreateAnomalyDetector
    -> AnomalyDetectorConfig -> CreateAnomalyDetector)
-> Lens
     CreateAnomalyDetector
     CreateAnomalyDetector
     AnomalyDetectorConfig
     AnomalyDetectorConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnomalyDetector' {AnomalyDetectorConfig
anomalyDetectorConfig :: AnomalyDetectorConfig
$sel:anomalyDetectorConfig:CreateAnomalyDetector' :: CreateAnomalyDetector -> AnomalyDetectorConfig
anomalyDetectorConfig} -> AnomalyDetectorConfig
anomalyDetectorConfig) (\s :: CreateAnomalyDetector
s@CreateAnomalyDetector' {} AnomalyDetectorConfig
a -> CreateAnomalyDetector
s {$sel:anomalyDetectorConfig:CreateAnomalyDetector' :: AnomalyDetectorConfig
anomalyDetectorConfig = AnomalyDetectorConfig
a} :: CreateAnomalyDetector)

instance Core.AWSRequest CreateAnomalyDetector where
  type
    AWSResponse CreateAnomalyDetector =
      CreateAnomalyDetectorResponse
  request :: CreateAnomalyDetector -> Request CreateAnomalyDetector
request = Service -> CreateAnomalyDetector -> Request CreateAnomalyDetector
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateAnomalyDetector
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateAnomalyDetector)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateAnomalyDetector))
-> Logger
-> Service
-> Proxy CreateAnomalyDetector
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateAnomalyDetector)))
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 Text -> Int -> CreateAnomalyDetectorResponse
CreateAnomalyDetectorResponse'
            (Maybe Text -> Int -> CreateAnomalyDetectorResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateAnomalyDetectorResponse)
forall (f :: * -> *) a b. Functor 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 (Int -> CreateAnomalyDetectorResponse)
-> Either String Int -> Either String CreateAnomalyDetectorResponse
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 CreateAnomalyDetector

instance Prelude.NFData CreateAnomalyDetector

instance Core.ToHeaders CreateAnomalyDetector where
  toHeaders :: CreateAnomalyDetector -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateAnomalyDetector -> 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 CreateAnomalyDetector where
  toJSON :: CreateAnomalyDetector -> Value
toJSON CreateAnomalyDetector' {Maybe Text
Maybe (HashMap Text Text)
Text
AnomalyDetectorConfig
anomalyDetectorConfig :: AnomalyDetectorConfig
anomalyDetectorName :: Text
tags :: Maybe (HashMap Text Text)
anomalyDetectorDescription :: Maybe Text
kmsKeyArn :: Maybe Text
$sel:anomalyDetectorConfig:CreateAnomalyDetector' :: CreateAnomalyDetector -> AnomalyDetectorConfig
$sel:anomalyDetectorName:CreateAnomalyDetector' :: CreateAnomalyDetector -> Text
$sel:tags:CreateAnomalyDetector' :: CreateAnomalyDetector -> Maybe (HashMap Text Text)
$sel:anomalyDetectorDescription:CreateAnomalyDetector' :: CreateAnomalyDetector -> Maybe Text
$sel:kmsKeyArn:CreateAnomalyDetector' :: CreateAnomalyDetector -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"KmsKeyArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyArn,
            (Text
"AnomalyDetectorDescription" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
anomalyDetectorDescription,
            (Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"AnomalyDetectorName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
anomalyDetectorName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"AnomalyDetectorConfig"
                  Text -> AnomalyDetectorConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AnomalyDetectorConfig
anomalyDetectorConfig
              )
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateAnomalyDetectorResponse' 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', 'createAnomalyDetectorResponse_anomalyDetectorArn' - The ARN of the detector.
--
-- 'httpStatus', 'createAnomalyDetectorResponse_httpStatus' - The response's http status code.
newCreateAnomalyDetectorResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateAnomalyDetectorResponse
newCreateAnomalyDetectorResponse :: Int -> CreateAnomalyDetectorResponse
newCreateAnomalyDetectorResponse Int
pHttpStatus_ =
  CreateAnomalyDetectorResponse' :: Maybe Text -> Int -> CreateAnomalyDetectorResponse
CreateAnomalyDetectorResponse'
    { $sel:anomalyDetectorArn:CreateAnomalyDetectorResponse' :: Maybe Text
anomalyDetectorArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateAnomalyDetectorResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

instance Prelude.NFData CreateAnomalyDetectorResponse