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