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