{-# 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 #-}
module Amazonka.LookoutMetrics.UpdateAnomalyDetector
(
UpdateAnomalyDetector (..),
newUpdateAnomalyDetector,
updateAnomalyDetector_anomalyDetectorConfig,
updateAnomalyDetector_anomalyDetectorDescription,
updateAnomalyDetector_kmsKeyArn,
updateAnomalyDetector_anomalyDetectorArn,
UpdateAnomalyDetectorResponse (..),
newUpdateAnomalyDetectorResponse,
updateAnomalyDetectorResponse_anomalyDetectorArn,
updateAnomalyDetectorResponse_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
data UpdateAnomalyDetector = UpdateAnomalyDetector'
{
UpdateAnomalyDetector -> Maybe AnomalyDetectorConfig
anomalyDetectorConfig :: Prelude.Maybe AnomalyDetectorConfig,
UpdateAnomalyDetector -> Maybe Text
anomalyDetectorDescription :: Prelude.Maybe Prelude.Text,
UpdateAnomalyDetector -> Maybe Text
kmsKeyArn :: Prelude.Maybe Prelude.Text,
UpdateAnomalyDetector -> Text
anomalyDetectorArn :: Prelude.Text
}
deriving (UpdateAnomalyDetector -> UpdateAnomalyDetector -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAnomalyDetector -> UpdateAnomalyDetector -> Bool
$c/= :: UpdateAnomalyDetector -> UpdateAnomalyDetector -> Bool
== :: UpdateAnomalyDetector -> UpdateAnomalyDetector -> Bool
$c== :: UpdateAnomalyDetector -> UpdateAnomalyDetector -> Bool
Prelude.Eq, ReadPrec [UpdateAnomalyDetector]
ReadPrec UpdateAnomalyDetector
Int -> ReadS UpdateAnomalyDetector
ReadS [UpdateAnomalyDetector]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAnomalyDetector]
$creadListPrec :: ReadPrec [UpdateAnomalyDetector]
readPrec :: ReadPrec UpdateAnomalyDetector
$creadPrec :: ReadPrec UpdateAnomalyDetector
readList :: ReadS [UpdateAnomalyDetector]
$creadList :: ReadS [UpdateAnomalyDetector]
readsPrec :: Int -> ReadS UpdateAnomalyDetector
$creadsPrec :: Int -> ReadS UpdateAnomalyDetector
Prelude.Read, Int -> UpdateAnomalyDetector -> ShowS
[UpdateAnomalyDetector] -> ShowS
UpdateAnomalyDetector -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAnomalyDetector] -> ShowS
$cshowList :: [UpdateAnomalyDetector] -> ShowS
show :: UpdateAnomalyDetector -> String
$cshow :: UpdateAnomalyDetector -> String
showsPrec :: Int -> UpdateAnomalyDetector -> ShowS
$cshowsPrec :: Int -> UpdateAnomalyDetector -> ShowS
Prelude.Show, forall x. Rep UpdateAnomalyDetector x -> UpdateAnomalyDetector
forall x. UpdateAnomalyDetector -> Rep UpdateAnomalyDetector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAnomalyDetector x -> UpdateAnomalyDetector
$cfrom :: forall x. UpdateAnomalyDetector -> Rep UpdateAnomalyDetector x
Prelude.Generic)
newUpdateAnomalyDetector ::
Prelude.Text ->
UpdateAnomalyDetector
newUpdateAnomalyDetector :: Text -> UpdateAnomalyDetector
newUpdateAnomalyDetector Text
pAnomalyDetectorArn_ =
UpdateAnomalyDetector'
{ $sel:anomalyDetectorConfig:UpdateAnomalyDetector' :: Maybe AnomalyDetectorConfig
anomalyDetectorConfig =
forall a. Maybe a
Prelude.Nothing,
$sel:anomalyDetectorDescription:UpdateAnomalyDetector' :: Maybe Text
anomalyDetectorDescription = forall a. Maybe a
Prelude.Nothing,
$sel:kmsKeyArn:UpdateAnomalyDetector' :: Maybe Text
kmsKeyArn = forall a. Maybe a
Prelude.Nothing,
$sel:anomalyDetectorArn:UpdateAnomalyDetector' :: Text
anomalyDetectorArn = Text
pAnomalyDetectorArn_
}
updateAnomalyDetector_anomalyDetectorConfig :: Lens.Lens' UpdateAnomalyDetector (Prelude.Maybe AnomalyDetectorConfig)
updateAnomalyDetector_anomalyDetectorConfig :: Lens' UpdateAnomalyDetector (Maybe AnomalyDetectorConfig)
updateAnomalyDetector_anomalyDetectorConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnomalyDetector' {Maybe AnomalyDetectorConfig
anomalyDetectorConfig :: Maybe AnomalyDetectorConfig
$sel:anomalyDetectorConfig:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Maybe AnomalyDetectorConfig
anomalyDetectorConfig} -> Maybe AnomalyDetectorConfig
anomalyDetectorConfig) (\s :: UpdateAnomalyDetector
s@UpdateAnomalyDetector' {} Maybe AnomalyDetectorConfig
a -> UpdateAnomalyDetector
s {$sel:anomalyDetectorConfig:UpdateAnomalyDetector' :: Maybe AnomalyDetectorConfig
anomalyDetectorConfig = Maybe AnomalyDetectorConfig
a} :: UpdateAnomalyDetector)
updateAnomalyDetector_anomalyDetectorDescription :: Lens.Lens' UpdateAnomalyDetector (Prelude.Maybe Prelude.Text)
updateAnomalyDetector_anomalyDetectorDescription :: Lens' UpdateAnomalyDetector (Maybe Text)
updateAnomalyDetector_anomalyDetectorDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnomalyDetector' {Maybe Text
anomalyDetectorDescription :: Maybe Text
$sel:anomalyDetectorDescription:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Maybe Text
anomalyDetectorDescription} -> Maybe Text
anomalyDetectorDescription) (\s :: UpdateAnomalyDetector
s@UpdateAnomalyDetector' {} Maybe Text
a -> UpdateAnomalyDetector
s {$sel:anomalyDetectorDescription:UpdateAnomalyDetector' :: Maybe Text
anomalyDetectorDescription = Maybe Text
a} :: UpdateAnomalyDetector)
updateAnomalyDetector_kmsKeyArn :: Lens.Lens' UpdateAnomalyDetector (Prelude.Maybe Prelude.Text)
updateAnomalyDetector_kmsKeyArn :: Lens' UpdateAnomalyDetector (Maybe Text)
updateAnomalyDetector_kmsKeyArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnomalyDetector' {Maybe Text
kmsKeyArn :: Maybe Text
$sel:kmsKeyArn:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Maybe Text
kmsKeyArn} -> Maybe Text
kmsKeyArn) (\s :: UpdateAnomalyDetector
s@UpdateAnomalyDetector' {} Maybe Text
a -> UpdateAnomalyDetector
s {$sel:kmsKeyArn:UpdateAnomalyDetector' :: Maybe Text
kmsKeyArn = Maybe Text
a} :: UpdateAnomalyDetector)
updateAnomalyDetector_anomalyDetectorArn :: Lens.Lens' UpdateAnomalyDetector Prelude.Text
updateAnomalyDetector_anomalyDetectorArn :: Lens' UpdateAnomalyDetector Text
updateAnomalyDetector_anomalyDetectorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnomalyDetector' {Text
anomalyDetectorArn :: Text
$sel:anomalyDetectorArn:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Text
anomalyDetectorArn} -> Text
anomalyDetectorArn) (\s :: UpdateAnomalyDetector
s@UpdateAnomalyDetector' {} Text
a -> UpdateAnomalyDetector
s {$sel:anomalyDetectorArn:UpdateAnomalyDetector' :: Text
anomalyDetectorArn = Text
a} :: UpdateAnomalyDetector)
instance Core.AWSRequest UpdateAnomalyDetector where
type
AWSResponse UpdateAnomalyDetector =
UpdateAnomalyDetectorResponse
request :: (Service -> Service)
-> UpdateAnomalyDetector -> Request UpdateAnomalyDetector
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 UpdateAnomalyDetector
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateAnomalyDetector)))
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 -> Int -> UpdateAnomalyDetectorResponse
UpdateAnomalyDetectorResponse'
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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdateAnomalyDetector where
hashWithSalt :: Int -> UpdateAnomalyDetector -> Int
hashWithSalt Int
_salt UpdateAnomalyDetector' {Maybe Text
Maybe AnomalyDetectorConfig
Text
anomalyDetectorArn :: Text
kmsKeyArn :: Maybe Text
anomalyDetectorDescription :: Maybe Text
anomalyDetectorConfig :: Maybe AnomalyDetectorConfig
$sel:anomalyDetectorArn:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Text
$sel:kmsKeyArn:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Maybe Text
$sel:anomalyDetectorDescription:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Maybe Text
$sel:anomalyDetectorConfig:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Maybe AnomalyDetectorConfig
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnomalyDetectorConfig
anomalyDetectorConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
anomalyDetectorDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
anomalyDetectorArn
instance Prelude.NFData UpdateAnomalyDetector where
rnf :: UpdateAnomalyDetector -> ()
rnf UpdateAnomalyDetector' {Maybe Text
Maybe AnomalyDetectorConfig
Text
anomalyDetectorArn :: Text
kmsKeyArn :: Maybe Text
anomalyDetectorDescription :: Maybe Text
anomalyDetectorConfig :: Maybe AnomalyDetectorConfig
$sel:anomalyDetectorArn:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Text
$sel:kmsKeyArn:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Maybe Text
$sel:anomalyDetectorDescription:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Maybe Text
$sel:anomalyDetectorConfig:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Maybe AnomalyDetectorConfig
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AnomalyDetectorConfig
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
kmsKeyArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
anomalyDetectorArn
instance Data.ToHeaders UpdateAnomalyDetector where
toHeaders :: UpdateAnomalyDetector -> 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 UpdateAnomalyDetector where
toJSON :: UpdateAnomalyDetector -> Value
toJSON UpdateAnomalyDetector' {Maybe Text
Maybe AnomalyDetectorConfig
Text
anomalyDetectorArn :: Text
kmsKeyArn :: Maybe Text
anomalyDetectorDescription :: Maybe Text
anomalyDetectorConfig :: Maybe AnomalyDetectorConfig
$sel:anomalyDetectorArn:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Text
$sel:kmsKeyArn:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Maybe Text
$sel:anomalyDetectorDescription:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Maybe Text
$sel:anomalyDetectorConfig:UpdateAnomalyDetector' :: UpdateAnomalyDetector -> Maybe AnomalyDetectorConfig
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AnomalyDetectorConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AnomalyDetectorConfig
anomalyDetectorConfig,
(Key
"AnomalyDetectorDescription" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
anomalyDetectorDescription,
(Key
"KmsKeyArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyArn,
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 UpdateAnomalyDetector where
toPath :: UpdateAnomalyDetector -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/UpdateAnomalyDetector"
instance Data.ToQuery UpdateAnomalyDetector where
toQuery :: UpdateAnomalyDetector -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateAnomalyDetectorResponse = UpdateAnomalyDetectorResponse'
{
UpdateAnomalyDetectorResponse -> Maybe Text
anomalyDetectorArn :: Prelude.Maybe Prelude.Text,
UpdateAnomalyDetectorResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateAnomalyDetectorResponse
-> UpdateAnomalyDetectorResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAnomalyDetectorResponse
-> UpdateAnomalyDetectorResponse -> Bool
$c/= :: UpdateAnomalyDetectorResponse
-> UpdateAnomalyDetectorResponse -> Bool
== :: UpdateAnomalyDetectorResponse
-> UpdateAnomalyDetectorResponse -> Bool
$c== :: UpdateAnomalyDetectorResponse
-> UpdateAnomalyDetectorResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAnomalyDetectorResponse]
ReadPrec UpdateAnomalyDetectorResponse
Int -> ReadS UpdateAnomalyDetectorResponse
ReadS [UpdateAnomalyDetectorResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAnomalyDetectorResponse]
$creadListPrec :: ReadPrec [UpdateAnomalyDetectorResponse]
readPrec :: ReadPrec UpdateAnomalyDetectorResponse
$creadPrec :: ReadPrec UpdateAnomalyDetectorResponse
readList :: ReadS [UpdateAnomalyDetectorResponse]
$creadList :: ReadS [UpdateAnomalyDetectorResponse]
readsPrec :: Int -> ReadS UpdateAnomalyDetectorResponse
$creadsPrec :: Int -> ReadS UpdateAnomalyDetectorResponse
Prelude.Read, Int -> UpdateAnomalyDetectorResponse -> ShowS
[UpdateAnomalyDetectorResponse] -> ShowS
UpdateAnomalyDetectorResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAnomalyDetectorResponse] -> ShowS
$cshowList :: [UpdateAnomalyDetectorResponse] -> ShowS
show :: UpdateAnomalyDetectorResponse -> String
$cshow :: UpdateAnomalyDetectorResponse -> String
showsPrec :: Int -> UpdateAnomalyDetectorResponse -> ShowS
$cshowsPrec :: Int -> UpdateAnomalyDetectorResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateAnomalyDetectorResponse x
-> UpdateAnomalyDetectorResponse
forall x.
UpdateAnomalyDetectorResponse
-> Rep UpdateAnomalyDetectorResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAnomalyDetectorResponse x
-> UpdateAnomalyDetectorResponse
$cfrom :: forall x.
UpdateAnomalyDetectorResponse
-> Rep UpdateAnomalyDetectorResponse x
Prelude.Generic)
newUpdateAnomalyDetectorResponse ::
Prelude.Int ->
UpdateAnomalyDetectorResponse
newUpdateAnomalyDetectorResponse :: Int -> UpdateAnomalyDetectorResponse
newUpdateAnomalyDetectorResponse Int
pHttpStatus_ =
UpdateAnomalyDetectorResponse'
{ $sel:anomalyDetectorArn:UpdateAnomalyDetectorResponse' :: Maybe Text
anomalyDetectorArn =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateAnomalyDetectorResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateAnomalyDetectorResponse_anomalyDetectorArn :: Lens.Lens' UpdateAnomalyDetectorResponse (Prelude.Maybe Prelude.Text)
updateAnomalyDetectorResponse_anomalyDetectorArn :: Lens' UpdateAnomalyDetectorResponse (Maybe Text)
updateAnomalyDetectorResponse_anomalyDetectorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnomalyDetectorResponse' {Maybe Text
anomalyDetectorArn :: Maybe Text
$sel:anomalyDetectorArn:UpdateAnomalyDetectorResponse' :: UpdateAnomalyDetectorResponse -> Maybe Text
anomalyDetectorArn} -> Maybe Text
anomalyDetectorArn) (\s :: UpdateAnomalyDetectorResponse
s@UpdateAnomalyDetectorResponse' {} Maybe Text
a -> UpdateAnomalyDetectorResponse
s {$sel:anomalyDetectorArn:UpdateAnomalyDetectorResponse' :: Maybe Text
anomalyDetectorArn = Maybe Text
a} :: UpdateAnomalyDetectorResponse)
updateAnomalyDetectorResponse_httpStatus :: Lens.Lens' UpdateAnomalyDetectorResponse Prelude.Int
updateAnomalyDetectorResponse_httpStatus :: Lens' UpdateAnomalyDetectorResponse Int
updateAnomalyDetectorResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnomalyDetectorResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateAnomalyDetectorResponse' :: UpdateAnomalyDetectorResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateAnomalyDetectorResponse
s@UpdateAnomalyDetectorResponse' {} Int
a -> UpdateAnomalyDetectorResponse
s {$sel:httpStatus:UpdateAnomalyDetectorResponse' :: Int
httpStatus = Int
a} :: UpdateAnomalyDetectorResponse)
instance Prelude.NFData UpdateAnomalyDetectorResponse where
rnf :: UpdateAnomalyDetectorResponse -> ()
rnf UpdateAnomalyDetectorResponse' {Int
Maybe Text
httpStatus :: Int
anomalyDetectorArn :: Maybe Text
$sel:httpStatus:UpdateAnomalyDetectorResponse' :: UpdateAnomalyDetectorResponse -> Int
$sel:anomalyDetectorArn:UpdateAnomalyDetectorResponse' :: UpdateAnomalyDetectorResponse -> 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 Int
httpStatus