{-# 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.CloudWatchEvents.Types.PutTargetsResultEntry where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PutTargetsResultEntry = PutTargetsResultEntry'
{
PutTargetsResultEntry -> Maybe Text
targetId :: Prelude.Maybe Prelude.Text,
PutTargetsResultEntry -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
PutTargetsResultEntry -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text
}
deriving (PutTargetsResultEntry -> PutTargetsResultEntry -> Bool
(PutTargetsResultEntry -> PutTargetsResultEntry -> Bool)
-> (PutTargetsResultEntry -> PutTargetsResultEntry -> Bool)
-> Eq PutTargetsResultEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutTargetsResultEntry -> PutTargetsResultEntry -> Bool
$c/= :: PutTargetsResultEntry -> PutTargetsResultEntry -> Bool
== :: PutTargetsResultEntry -> PutTargetsResultEntry -> Bool
$c== :: PutTargetsResultEntry -> PutTargetsResultEntry -> Bool
Prelude.Eq, ReadPrec [PutTargetsResultEntry]
ReadPrec PutTargetsResultEntry
Int -> ReadS PutTargetsResultEntry
ReadS [PutTargetsResultEntry]
(Int -> ReadS PutTargetsResultEntry)
-> ReadS [PutTargetsResultEntry]
-> ReadPrec PutTargetsResultEntry
-> ReadPrec [PutTargetsResultEntry]
-> Read PutTargetsResultEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutTargetsResultEntry]
$creadListPrec :: ReadPrec [PutTargetsResultEntry]
readPrec :: ReadPrec PutTargetsResultEntry
$creadPrec :: ReadPrec PutTargetsResultEntry
readList :: ReadS [PutTargetsResultEntry]
$creadList :: ReadS [PutTargetsResultEntry]
readsPrec :: Int -> ReadS PutTargetsResultEntry
$creadsPrec :: Int -> ReadS PutTargetsResultEntry
Prelude.Read, Int -> PutTargetsResultEntry -> ShowS
[PutTargetsResultEntry] -> ShowS
PutTargetsResultEntry -> String
(Int -> PutTargetsResultEntry -> ShowS)
-> (PutTargetsResultEntry -> String)
-> ([PutTargetsResultEntry] -> ShowS)
-> Show PutTargetsResultEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutTargetsResultEntry] -> ShowS
$cshowList :: [PutTargetsResultEntry] -> ShowS
show :: PutTargetsResultEntry -> String
$cshow :: PutTargetsResultEntry -> String
showsPrec :: Int -> PutTargetsResultEntry -> ShowS
$cshowsPrec :: Int -> PutTargetsResultEntry -> ShowS
Prelude.Show, (forall x. PutTargetsResultEntry -> Rep PutTargetsResultEntry x)
-> (forall x. Rep PutTargetsResultEntry x -> PutTargetsResultEntry)
-> Generic PutTargetsResultEntry
forall x. Rep PutTargetsResultEntry x -> PutTargetsResultEntry
forall x. PutTargetsResultEntry -> Rep PutTargetsResultEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutTargetsResultEntry x -> PutTargetsResultEntry
$cfrom :: forall x. PutTargetsResultEntry -> Rep PutTargetsResultEntry x
Prelude.Generic)
newPutTargetsResultEntry ::
PutTargetsResultEntry
newPutTargetsResultEntry :: PutTargetsResultEntry
newPutTargetsResultEntry =
PutTargetsResultEntry' :: Maybe Text -> Maybe Text -> Maybe Text -> PutTargetsResultEntry
PutTargetsResultEntry'
{ $sel:targetId:PutTargetsResultEntry' :: Maybe Text
targetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorCode:PutTargetsResultEntry' :: Maybe Text
errorCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorMessage:PutTargetsResultEntry' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
putTargetsResultEntry_targetId :: Lens.Lens' PutTargetsResultEntry (Prelude.Maybe Prelude.Text)
putTargetsResultEntry_targetId :: (Maybe Text -> f (Maybe Text))
-> PutTargetsResultEntry -> f PutTargetsResultEntry
putTargetsResultEntry_targetId = (PutTargetsResultEntry -> Maybe Text)
-> (PutTargetsResultEntry -> Maybe Text -> PutTargetsResultEntry)
-> Lens
PutTargetsResultEntry
PutTargetsResultEntry
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutTargetsResultEntry' {Maybe Text
targetId :: Maybe Text
$sel:targetId:PutTargetsResultEntry' :: PutTargetsResultEntry -> Maybe Text
targetId} -> Maybe Text
targetId) (\s :: PutTargetsResultEntry
s@PutTargetsResultEntry' {} Maybe Text
a -> PutTargetsResultEntry
s {$sel:targetId:PutTargetsResultEntry' :: Maybe Text
targetId = Maybe Text
a} :: PutTargetsResultEntry)
putTargetsResultEntry_errorCode :: Lens.Lens' PutTargetsResultEntry (Prelude.Maybe Prelude.Text)
putTargetsResultEntry_errorCode :: (Maybe Text -> f (Maybe Text))
-> PutTargetsResultEntry -> f PutTargetsResultEntry
putTargetsResultEntry_errorCode = (PutTargetsResultEntry -> Maybe Text)
-> (PutTargetsResultEntry -> Maybe Text -> PutTargetsResultEntry)
-> Lens
PutTargetsResultEntry
PutTargetsResultEntry
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutTargetsResultEntry' {Maybe Text
errorCode :: Maybe Text
$sel:errorCode:PutTargetsResultEntry' :: PutTargetsResultEntry -> Maybe Text
errorCode} -> Maybe Text
errorCode) (\s :: PutTargetsResultEntry
s@PutTargetsResultEntry' {} Maybe Text
a -> PutTargetsResultEntry
s {$sel:errorCode:PutTargetsResultEntry' :: Maybe Text
errorCode = Maybe Text
a} :: PutTargetsResultEntry)
putTargetsResultEntry_errorMessage :: Lens.Lens' PutTargetsResultEntry (Prelude.Maybe Prelude.Text)
putTargetsResultEntry_errorMessage :: (Maybe Text -> f (Maybe Text))
-> PutTargetsResultEntry -> f PutTargetsResultEntry
putTargetsResultEntry_errorMessage = (PutTargetsResultEntry -> Maybe Text)
-> (PutTargetsResultEntry -> Maybe Text -> PutTargetsResultEntry)
-> Lens
PutTargetsResultEntry
PutTargetsResultEntry
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutTargetsResultEntry' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:PutTargetsResultEntry' :: PutTargetsResultEntry -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: PutTargetsResultEntry
s@PutTargetsResultEntry' {} Maybe Text
a -> PutTargetsResultEntry
s {$sel:errorMessage:PutTargetsResultEntry' :: Maybe Text
errorMessage = Maybe Text
a} :: PutTargetsResultEntry)
instance Core.FromJSON PutTargetsResultEntry where
parseJSON :: Value -> Parser PutTargetsResultEntry
parseJSON =
String
-> (Object -> Parser PutTargetsResultEntry)
-> Value
-> Parser PutTargetsResultEntry
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PutTargetsResultEntry"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> PutTargetsResultEntry
PutTargetsResultEntry'
(Maybe Text -> Maybe Text -> Maybe Text -> PutTargetsResultEntry)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> PutTargetsResultEntry)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TargetId")
Parser (Maybe Text -> Maybe Text -> PutTargetsResultEntry)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> PutTargetsResultEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorCode")
Parser (Maybe Text -> PutTargetsResultEntry)
-> Parser (Maybe Text) -> Parser PutTargetsResultEntry
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorMessage")
)
instance Prelude.Hashable PutTargetsResultEntry
instance Prelude.NFData PutTargetsResultEntry