{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.IoTEventsData.Types.UpdateDetectorRequest where
import qualified Amazonka.Core as Core
import Amazonka.IoTEventsData.Types.DetectorStateDefinition
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UpdateDetectorRequest = UpdateDetectorRequest'
{
UpdateDetectorRequest -> Maybe Text
keyValue :: Prelude.Maybe Prelude.Text,
UpdateDetectorRequest -> Text
messageId :: Prelude.Text,
UpdateDetectorRequest -> Text
detectorModelName :: Prelude.Text,
UpdateDetectorRequest -> DetectorStateDefinition
state :: DetectorStateDefinition
}
deriving (UpdateDetectorRequest -> UpdateDetectorRequest -> Bool
(UpdateDetectorRequest -> UpdateDetectorRequest -> Bool)
-> (UpdateDetectorRequest -> UpdateDetectorRequest -> Bool)
-> Eq UpdateDetectorRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDetectorRequest -> UpdateDetectorRequest -> Bool
$c/= :: UpdateDetectorRequest -> UpdateDetectorRequest -> Bool
== :: UpdateDetectorRequest -> UpdateDetectorRequest -> Bool
$c== :: UpdateDetectorRequest -> UpdateDetectorRequest -> Bool
Prelude.Eq, ReadPrec [UpdateDetectorRequest]
ReadPrec UpdateDetectorRequest
Int -> ReadS UpdateDetectorRequest
ReadS [UpdateDetectorRequest]
(Int -> ReadS UpdateDetectorRequest)
-> ReadS [UpdateDetectorRequest]
-> ReadPrec UpdateDetectorRequest
-> ReadPrec [UpdateDetectorRequest]
-> Read UpdateDetectorRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDetectorRequest]
$creadListPrec :: ReadPrec [UpdateDetectorRequest]
readPrec :: ReadPrec UpdateDetectorRequest
$creadPrec :: ReadPrec UpdateDetectorRequest
readList :: ReadS [UpdateDetectorRequest]
$creadList :: ReadS [UpdateDetectorRequest]
readsPrec :: Int -> ReadS UpdateDetectorRequest
$creadsPrec :: Int -> ReadS UpdateDetectorRequest
Prelude.Read, Int -> UpdateDetectorRequest -> ShowS
[UpdateDetectorRequest] -> ShowS
UpdateDetectorRequest -> String
(Int -> UpdateDetectorRequest -> ShowS)
-> (UpdateDetectorRequest -> String)
-> ([UpdateDetectorRequest] -> ShowS)
-> Show UpdateDetectorRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDetectorRequest] -> ShowS
$cshowList :: [UpdateDetectorRequest] -> ShowS
show :: UpdateDetectorRequest -> String
$cshow :: UpdateDetectorRequest -> String
showsPrec :: Int -> UpdateDetectorRequest -> ShowS
$cshowsPrec :: Int -> UpdateDetectorRequest -> ShowS
Prelude.Show, (forall x. UpdateDetectorRequest -> Rep UpdateDetectorRequest x)
-> (forall x. Rep UpdateDetectorRequest x -> UpdateDetectorRequest)
-> Generic UpdateDetectorRequest
forall x. Rep UpdateDetectorRequest x -> UpdateDetectorRequest
forall x. UpdateDetectorRequest -> Rep UpdateDetectorRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDetectorRequest x -> UpdateDetectorRequest
$cfrom :: forall x. UpdateDetectorRequest -> Rep UpdateDetectorRequest x
Prelude.Generic)
newUpdateDetectorRequest ::
Prelude.Text ->
Prelude.Text ->
DetectorStateDefinition ->
UpdateDetectorRequest
newUpdateDetectorRequest :: Text -> Text -> DetectorStateDefinition -> UpdateDetectorRequest
newUpdateDetectorRequest
Text
pMessageId_
Text
pDetectorModelName_
DetectorStateDefinition
pState_ =
UpdateDetectorRequest' :: Maybe Text
-> Text -> Text -> DetectorStateDefinition -> UpdateDetectorRequest
UpdateDetectorRequest'
{ $sel:keyValue:UpdateDetectorRequest' :: Maybe Text
keyValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:messageId:UpdateDetectorRequest' :: Text
messageId = Text
pMessageId_,
$sel:detectorModelName:UpdateDetectorRequest' :: Text
detectorModelName = Text
pDetectorModelName_,
$sel:state:UpdateDetectorRequest' :: DetectorStateDefinition
state = DetectorStateDefinition
pState_
}
updateDetectorRequest_keyValue :: Lens.Lens' UpdateDetectorRequest (Prelude.Maybe Prelude.Text)
updateDetectorRequest_keyValue :: (Maybe Text -> f (Maybe Text))
-> UpdateDetectorRequest -> f UpdateDetectorRequest
updateDetectorRequest_keyValue = (UpdateDetectorRequest -> Maybe Text)
-> (UpdateDetectorRequest -> Maybe Text -> UpdateDetectorRequest)
-> Lens
UpdateDetectorRequest
UpdateDetectorRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDetectorRequest' {Maybe Text
keyValue :: Maybe Text
$sel:keyValue:UpdateDetectorRequest' :: UpdateDetectorRequest -> Maybe Text
keyValue} -> Maybe Text
keyValue) (\s :: UpdateDetectorRequest
s@UpdateDetectorRequest' {} Maybe Text
a -> UpdateDetectorRequest
s {$sel:keyValue:UpdateDetectorRequest' :: Maybe Text
keyValue = Maybe Text
a} :: UpdateDetectorRequest)
updateDetectorRequest_messageId :: Lens.Lens' UpdateDetectorRequest Prelude.Text
updateDetectorRequest_messageId :: (Text -> f Text)
-> UpdateDetectorRequest -> f UpdateDetectorRequest
updateDetectorRequest_messageId = (UpdateDetectorRequest -> Text)
-> (UpdateDetectorRequest -> Text -> UpdateDetectorRequest)
-> Lens UpdateDetectorRequest UpdateDetectorRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDetectorRequest' {Text
messageId :: Text
$sel:messageId:UpdateDetectorRequest' :: UpdateDetectorRequest -> Text
messageId} -> Text
messageId) (\s :: UpdateDetectorRequest
s@UpdateDetectorRequest' {} Text
a -> UpdateDetectorRequest
s {$sel:messageId:UpdateDetectorRequest' :: Text
messageId = Text
a} :: UpdateDetectorRequest)
updateDetectorRequest_detectorModelName :: Lens.Lens' UpdateDetectorRequest Prelude.Text
updateDetectorRequest_detectorModelName :: (Text -> f Text)
-> UpdateDetectorRequest -> f UpdateDetectorRequest
updateDetectorRequest_detectorModelName = (UpdateDetectorRequest -> Text)
-> (UpdateDetectorRequest -> Text -> UpdateDetectorRequest)
-> Lens UpdateDetectorRequest UpdateDetectorRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDetectorRequest' {Text
detectorModelName :: Text
$sel:detectorModelName:UpdateDetectorRequest' :: UpdateDetectorRequest -> Text
detectorModelName} -> Text
detectorModelName) (\s :: UpdateDetectorRequest
s@UpdateDetectorRequest' {} Text
a -> UpdateDetectorRequest
s {$sel:detectorModelName:UpdateDetectorRequest' :: Text
detectorModelName = Text
a} :: UpdateDetectorRequest)
updateDetectorRequest_state :: Lens.Lens' UpdateDetectorRequest DetectorStateDefinition
updateDetectorRequest_state :: (DetectorStateDefinition -> f DetectorStateDefinition)
-> UpdateDetectorRequest -> f UpdateDetectorRequest
updateDetectorRequest_state = (UpdateDetectorRequest -> DetectorStateDefinition)
-> (UpdateDetectorRequest
-> DetectorStateDefinition -> UpdateDetectorRequest)
-> Lens
UpdateDetectorRequest
UpdateDetectorRequest
DetectorStateDefinition
DetectorStateDefinition
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDetectorRequest' {DetectorStateDefinition
state :: DetectorStateDefinition
$sel:state:UpdateDetectorRequest' :: UpdateDetectorRequest -> DetectorStateDefinition
state} -> DetectorStateDefinition
state) (\s :: UpdateDetectorRequest
s@UpdateDetectorRequest' {} DetectorStateDefinition
a -> UpdateDetectorRequest
s {$sel:state:UpdateDetectorRequest' :: DetectorStateDefinition
state = DetectorStateDefinition
a} :: UpdateDetectorRequest)
instance Prelude.Hashable UpdateDetectorRequest
instance Prelude.NFData UpdateDetectorRequest
instance Core.ToJSON UpdateDetectorRequest where
toJSON :: UpdateDetectorRequest -> Value
toJSON UpdateDetectorRequest' {Maybe Text
Text
DetectorStateDefinition
state :: DetectorStateDefinition
detectorModelName :: Text
messageId :: Text
keyValue :: Maybe Text
$sel:state:UpdateDetectorRequest' :: UpdateDetectorRequest -> DetectorStateDefinition
$sel:detectorModelName:UpdateDetectorRequest' :: UpdateDetectorRequest -> Text
$sel:messageId:UpdateDetectorRequest' :: UpdateDetectorRequest -> Text
$sel:keyValue:UpdateDetectorRequest' :: UpdateDetectorRequest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"keyValue" 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
keyValue,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"messageId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
messageId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"detectorModelName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
detectorModelName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"state" Text -> DetectorStateDefinition -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DetectorStateDefinition
state)
]
)