{-# 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.Kafka.Types.CloudWatchLogs 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 CloudWatchLogs = CloudWatchLogs'
{ CloudWatchLogs -> Maybe Text
logGroup :: Prelude.Maybe Prelude.Text,
CloudWatchLogs -> Bool
enabled :: Prelude.Bool
}
deriving (CloudWatchLogs -> CloudWatchLogs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudWatchLogs -> CloudWatchLogs -> Bool
$c/= :: CloudWatchLogs -> CloudWatchLogs -> Bool
== :: CloudWatchLogs -> CloudWatchLogs -> Bool
$c== :: CloudWatchLogs -> CloudWatchLogs -> Bool
Prelude.Eq, ReadPrec [CloudWatchLogs]
ReadPrec CloudWatchLogs
Int -> ReadS CloudWatchLogs
ReadS [CloudWatchLogs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudWatchLogs]
$creadListPrec :: ReadPrec [CloudWatchLogs]
readPrec :: ReadPrec CloudWatchLogs
$creadPrec :: ReadPrec CloudWatchLogs
readList :: ReadS [CloudWatchLogs]
$creadList :: ReadS [CloudWatchLogs]
readsPrec :: Int -> ReadS CloudWatchLogs
$creadsPrec :: Int -> ReadS CloudWatchLogs
Prelude.Read, Int -> CloudWatchLogs -> ShowS
[CloudWatchLogs] -> ShowS
CloudWatchLogs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudWatchLogs] -> ShowS
$cshowList :: [CloudWatchLogs] -> ShowS
show :: CloudWatchLogs -> String
$cshow :: CloudWatchLogs -> String
showsPrec :: Int -> CloudWatchLogs -> ShowS
$cshowsPrec :: Int -> CloudWatchLogs -> ShowS
Prelude.Show, forall x. Rep CloudWatchLogs x -> CloudWatchLogs
forall x. CloudWatchLogs -> Rep CloudWatchLogs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CloudWatchLogs x -> CloudWatchLogs
$cfrom :: forall x. CloudWatchLogs -> Rep CloudWatchLogs x
Prelude.Generic)
newCloudWatchLogs ::
Prelude.Bool ->
CloudWatchLogs
newCloudWatchLogs :: Bool -> CloudWatchLogs
newCloudWatchLogs Bool
pEnabled_ =
CloudWatchLogs'
{ $sel:logGroup:CloudWatchLogs' :: Maybe Text
logGroup = forall a. Maybe a
Prelude.Nothing,
$sel:enabled:CloudWatchLogs' :: Bool
enabled = Bool
pEnabled_
}
cloudWatchLogs_logGroup :: Lens.Lens' CloudWatchLogs (Prelude.Maybe Prelude.Text)
cloudWatchLogs_logGroup :: Lens' CloudWatchLogs (Maybe Text)
cloudWatchLogs_logGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogs' {Maybe Text
logGroup :: Maybe Text
$sel:logGroup:CloudWatchLogs' :: CloudWatchLogs -> Maybe Text
logGroup} -> Maybe Text
logGroup) (\s :: CloudWatchLogs
s@CloudWatchLogs' {} Maybe Text
a -> CloudWatchLogs
s {$sel:logGroup:CloudWatchLogs' :: Maybe Text
logGroup = Maybe Text
a} :: CloudWatchLogs)
cloudWatchLogs_enabled :: Lens.Lens' CloudWatchLogs Prelude.Bool
cloudWatchLogs_enabled :: Lens' CloudWatchLogs Bool
cloudWatchLogs_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogs' {Bool
enabled :: Bool
$sel:enabled:CloudWatchLogs' :: CloudWatchLogs -> Bool
enabled} -> Bool
enabled) (\s :: CloudWatchLogs
s@CloudWatchLogs' {} Bool
a -> CloudWatchLogs
s {$sel:enabled:CloudWatchLogs' :: Bool
enabled = Bool
a} :: CloudWatchLogs)
instance Data.FromJSON CloudWatchLogs where
parseJSON :: Value -> Parser CloudWatchLogs
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CloudWatchLogs"
( \Object
x ->
Maybe Text -> Bool -> CloudWatchLogs
CloudWatchLogs'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"logGroup")
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
"enabled")
)
instance Prelude.Hashable CloudWatchLogs where
hashWithSalt :: Int -> CloudWatchLogs -> Int
hashWithSalt Int
_salt CloudWatchLogs' {Bool
Maybe Text
enabled :: Bool
logGroup :: Maybe Text
$sel:enabled:CloudWatchLogs' :: CloudWatchLogs -> Bool
$sel:logGroup:CloudWatchLogs' :: CloudWatchLogs -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
logGroup
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enabled
instance Prelude.NFData CloudWatchLogs where
rnf :: CloudWatchLogs -> ()
rnf CloudWatchLogs' {Bool
Maybe Text
enabled :: Bool
logGroup :: Maybe Text
$sel:enabled:CloudWatchLogs' :: CloudWatchLogs -> Bool
$sel:logGroup:CloudWatchLogs' :: CloudWatchLogs -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
logGroup
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
enabled
instance Data.ToJSON CloudWatchLogs where
toJSON :: CloudWatchLogs -> Value
toJSON CloudWatchLogs' {Bool
Maybe Text
enabled :: Bool
logGroup :: Maybe Text
$sel:enabled:CloudWatchLogs' :: CloudWatchLogs -> Bool
$sel:logGroup:CloudWatchLogs' :: CloudWatchLogs -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"logGroup" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
logGroup,
forall a. a -> Maybe a
Prelude.Just (Key
"enabled" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
enabled)
]
)