{-# 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.LexV2Models.Types.TextLogDestination where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types.CloudWatchLogGroupLogDestination
import qualified Amazonka.Prelude as Prelude
data TextLogDestination = TextLogDestination'
{
TextLogDestination -> CloudWatchLogGroupLogDestination
cloudWatch :: CloudWatchLogGroupLogDestination
}
deriving (TextLogDestination -> TextLogDestination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextLogDestination -> TextLogDestination -> Bool
$c/= :: TextLogDestination -> TextLogDestination -> Bool
== :: TextLogDestination -> TextLogDestination -> Bool
$c== :: TextLogDestination -> TextLogDestination -> Bool
Prelude.Eq, ReadPrec [TextLogDestination]
ReadPrec TextLogDestination
Int -> ReadS TextLogDestination
ReadS [TextLogDestination]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TextLogDestination]
$creadListPrec :: ReadPrec [TextLogDestination]
readPrec :: ReadPrec TextLogDestination
$creadPrec :: ReadPrec TextLogDestination
readList :: ReadS [TextLogDestination]
$creadList :: ReadS [TextLogDestination]
readsPrec :: Int -> ReadS TextLogDestination
$creadsPrec :: Int -> ReadS TextLogDestination
Prelude.Read, Int -> TextLogDestination -> ShowS
[TextLogDestination] -> ShowS
TextLogDestination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextLogDestination] -> ShowS
$cshowList :: [TextLogDestination] -> ShowS
show :: TextLogDestination -> String
$cshow :: TextLogDestination -> String
showsPrec :: Int -> TextLogDestination -> ShowS
$cshowsPrec :: Int -> TextLogDestination -> ShowS
Prelude.Show, forall x. Rep TextLogDestination x -> TextLogDestination
forall x. TextLogDestination -> Rep TextLogDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TextLogDestination x -> TextLogDestination
$cfrom :: forall x. TextLogDestination -> Rep TextLogDestination x
Prelude.Generic)
newTextLogDestination ::
CloudWatchLogGroupLogDestination ->
TextLogDestination
newTextLogDestination :: CloudWatchLogGroupLogDestination -> TextLogDestination
newTextLogDestination CloudWatchLogGroupLogDestination
pCloudWatch_ =
TextLogDestination' {$sel:cloudWatch:TextLogDestination' :: CloudWatchLogGroupLogDestination
cloudWatch = CloudWatchLogGroupLogDestination
pCloudWatch_}
textLogDestination_cloudWatch :: Lens.Lens' TextLogDestination CloudWatchLogGroupLogDestination
textLogDestination_cloudWatch :: Lens' TextLogDestination CloudWatchLogGroupLogDestination
textLogDestination_cloudWatch = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TextLogDestination' {CloudWatchLogGroupLogDestination
cloudWatch :: CloudWatchLogGroupLogDestination
$sel:cloudWatch:TextLogDestination' :: TextLogDestination -> CloudWatchLogGroupLogDestination
cloudWatch} -> CloudWatchLogGroupLogDestination
cloudWatch) (\s :: TextLogDestination
s@TextLogDestination' {} CloudWatchLogGroupLogDestination
a -> TextLogDestination
s {$sel:cloudWatch:TextLogDestination' :: CloudWatchLogGroupLogDestination
cloudWatch = CloudWatchLogGroupLogDestination
a} :: TextLogDestination)
instance Data.FromJSON TextLogDestination where
parseJSON :: Value -> Parser TextLogDestination
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TextLogDestination"
( \Object
x ->
CloudWatchLogGroupLogDestination -> TextLogDestination
TextLogDestination'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"cloudWatch")
)
instance Prelude.Hashable TextLogDestination where
hashWithSalt :: Int -> TextLogDestination -> Int
hashWithSalt Int
_salt TextLogDestination' {CloudWatchLogGroupLogDestination
cloudWatch :: CloudWatchLogGroupLogDestination
$sel:cloudWatch:TextLogDestination' :: TextLogDestination -> CloudWatchLogGroupLogDestination
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` CloudWatchLogGroupLogDestination
cloudWatch
instance Prelude.NFData TextLogDestination where
rnf :: TextLogDestination -> ()
rnf TextLogDestination' {CloudWatchLogGroupLogDestination
cloudWatch :: CloudWatchLogGroupLogDestination
$sel:cloudWatch:TextLogDestination' :: TextLogDestination -> CloudWatchLogGroupLogDestination
..} = forall a. NFData a => a -> ()
Prelude.rnf CloudWatchLogGroupLogDestination
cloudWatch
instance Data.ToJSON TextLogDestination where
toJSON :: TextLogDestination -> Value
toJSON TextLogDestination' {CloudWatchLogGroupLogDestination
cloudWatch :: CloudWatchLogGroupLogDestination
$sel:cloudWatch:TextLogDestination' :: TextLogDestination -> CloudWatchLogGroupLogDestination
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"cloudWatch" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= CloudWatchLogGroupLogDestination
cloudWatch)]
)