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