{-# 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.StepFunctions.Types.LogDestination where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.StepFunctions.Types.CloudWatchLogsLogGroup
data LogDestination = LogDestination'
{
LogDestination -> Maybe CloudWatchLogsLogGroup
cloudWatchLogsLogGroup :: Prelude.Maybe CloudWatchLogsLogGroup
}
deriving (LogDestination -> LogDestination -> Bool
(LogDestination -> LogDestination -> Bool)
-> (LogDestination -> LogDestination -> Bool) -> Eq LogDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LogDestination -> LogDestination -> Bool
$c/= :: LogDestination -> LogDestination -> Bool
== :: LogDestination -> LogDestination -> Bool
$c== :: LogDestination -> LogDestination -> Bool
Prelude.Eq, ReadPrec [LogDestination]
ReadPrec LogDestination
Int -> ReadS LogDestination
ReadS [LogDestination]
(Int -> ReadS LogDestination)
-> ReadS [LogDestination]
-> ReadPrec LogDestination
-> ReadPrec [LogDestination]
-> Read LogDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LogDestination]
$creadListPrec :: ReadPrec [LogDestination]
readPrec :: ReadPrec LogDestination
$creadPrec :: ReadPrec LogDestination
readList :: ReadS [LogDestination]
$creadList :: ReadS [LogDestination]
readsPrec :: Int -> ReadS LogDestination
$creadsPrec :: Int -> ReadS LogDestination
Prelude.Read, Int -> LogDestination -> ShowS
[LogDestination] -> ShowS
LogDestination -> String
(Int -> LogDestination -> ShowS)
-> (LogDestination -> String)
-> ([LogDestination] -> ShowS)
-> Show LogDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LogDestination] -> ShowS
$cshowList :: [LogDestination] -> ShowS
show :: LogDestination -> String
$cshow :: LogDestination -> String
showsPrec :: Int -> LogDestination -> ShowS
$cshowsPrec :: Int -> LogDestination -> ShowS
Prelude.Show, (forall x. LogDestination -> Rep LogDestination x)
-> (forall x. Rep LogDestination x -> LogDestination)
-> Generic LogDestination
forall x. Rep LogDestination x -> LogDestination
forall x. LogDestination -> Rep LogDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LogDestination x -> LogDestination
$cfrom :: forall x. LogDestination -> Rep LogDestination x
Prelude.Generic)
newLogDestination ::
LogDestination
newLogDestination :: LogDestination
newLogDestination =
LogDestination' :: Maybe CloudWatchLogsLogGroup -> LogDestination
LogDestination'
{ $sel:cloudWatchLogsLogGroup:LogDestination' :: Maybe CloudWatchLogsLogGroup
cloudWatchLogsLogGroup =
Maybe CloudWatchLogsLogGroup
forall a. Maybe a
Prelude.Nothing
}
logDestination_cloudWatchLogsLogGroup :: Lens.Lens' LogDestination (Prelude.Maybe CloudWatchLogsLogGroup)
logDestination_cloudWatchLogsLogGroup :: (Maybe CloudWatchLogsLogGroup -> f (Maybe CloudWatchLogsLogGroup))
-> LogDestination -> f LogDestination
logDestination_cloudWatchLogsLogGroup = (LogDestination -> Maybe CloudWatchLogsLogGroup)
-> (LogDestination
-> Maybe CloudWatchLogsLogGroup -> LogDestination)
-> Lens
LogDestination
LogDestination
(Maybe CloudWatchLogsLogGroup)
(Maybe CloudWatchLogsLogGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogDestination' {Maybe CloudWatchLogsLogGroup
cloudWatchLogsLogGroup :: Maybe CloudWatchLogsLogGroup
$sel:cloudWatchLogsLogGroup:LogDestination' :: LogDestination -> Maybe CloudWatchLogsLogGroup
cloudWatchLogsLogGroup} -> Maybe CloudWatchLogsLogGroup
cloudWatchLogsLogGroup) (\s :: LogDestination
s@LogDestination' {} Maybe CloudWatchLogsLogGroup
a -> LogDestination
s {$sel:cloudWatchLogsLogGroup:LogDestination' :: Maybe CloudWatchLogsLogGroup
cloudWatchLogsLogGroup = Maybe CloudWatchLogsLogGroup
a} :: LogDestination)
instance Core.FromJSON LogDestination where
parseJSON :: Value -> Parser LogDestination
parseJSON =
String
-> (Object -> Parser LogDestination)
-> Value
-> Parser LogDestination
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LogDestination"
( \Object
x ->
Maybe CloudWatchLogsLogGroup -> LogDestination
LogDestination'
(Maybe CloudWatchLogsLogGroup -> LogDestination)
-> Parser (Maybe CloudWatchLogsLogGroup) -> Parser LogDestination
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CloudWatchLogsLogGroup)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cloudWatchLogsLogGroup")
)
instance Prelude.Hashable LogDestination
instance Prelude.NFData LogDestination
instance Core.ToJSON LogDestination where
toJSON :: LogDestination -> Value
toJSON LogDestination' {Maybe CloudWatchLogsLogGroup
cloudWatchLogsLogGroup :: Maybe CloudWatchLogsLogGroup
$sel:cloudWatchLogsLogGroup:LogDestination' :: LogDestination -> Maybe CloudWatchLogsLogGroup
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"cloudWatchLogsLogGroup" Text -> CloudWatchLogsLogGroup -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(CloudWatchLogsLogGroup -> Pair)
-> Maybe CloudWatchLogsLogGroup -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CloudWatchLogsLogGroup
cloudWatchLogsLogGroup
]
)