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