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