{-# 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.S3Bucket where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types.AllowsUnencryptedObjectUploads
import Amazonka.MacieV2.Types.BucketPublicAccess
import Amazonka.MacieV2.Types.KeyValuePair
import Amazonka.MacieV2.Types.S3BucketOwner
import Amazonka.MacieV2.Types.ServerSideEncryption
import qualified Amazonka.Prelude as Prelude
data S3Bucket = S3Bucket'
{
S3Bucket -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
S3Bucket -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
S3Bucket -> Maybe S3BucketOwner
owner :: Prelude.Maybe S3BucketOwner,
S3Bucket -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
S3Bucket -> Maybe ServerSideEncryption
defaultServerSideEncryption :: Prelude.Maybe ServerSideEncryption,
S3Bucket -> Maybe AllowsUnencryptedObjectUploads
allowsUnencryptedObjectUploads :: Prelude.Maybe AllowsUnencryptedObjectUploads,
S3Bucket -> Maybe BucketPublicAccess
publicAccess :: Prelude.Maybe BucketPublicAccess,
S3Bucket -> Maybe [KeyValuePair]
tags :: Prelude.Maybe [KeyValuePair]
}
deriving (S3Bucket -> S3Bucket -> Bool
(S3Bucket -> S3Bucket -> Bool)
-> (S3Bucket -> S3Bucket -> Bool) -> Eq S3Bucket
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3Bucket -> S3Bucket -> Bool
$c/= :: S3Bucket -> S3Bucket -> Bool
== :: S3Bucket -> S3Bucket -> Bool
$c== :: S3Bucket -> S3Bucket -> Bool
Prelude.Eq, ReadPrec [S3Bucket]
ReadPrec S3Bucket
Int -> ReadS S3Bucket
ReadS [S3Bucket]
(Int -> ReadS S3Bucket)
-> ReadS [S3Bucket]
-> ReadPrec S3Bucket
-> ReadPrec [S3Bucket]
-> Read S3Bucket
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3Bucket]
$creadListPrec :: ReadPrec [S3Bucket]
readPrec :: ReadPrec S3Bucket
$creadPrec :: ReadPrec S3Bucket
readList :: ReadS [S3Bucket]
$creadList :: ReadS [S3Bucket]
readsPrec :: Int -> ReadS S3Bucket
$creadsPrec :: Int -> ReadS S3Bucket
Prelude.Read, Int -> S3Bucket -> ShowS
[S3Bucket] -> ShowS
S3Bucket -> String
(Int -> S3Bucket -> ShowS)
-> (S3Bucket -> String) -> ([S3Bucket] -> ShowS) -> Show S3Bucket
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3Bucket] -> ShowS
$cshowList :: [S3Bucket] -> ShowS
show :: S3Bucket -> String
$cshow :: S3Bucket -> String
showsPrec :: Int -> S3Bucket -> ShowS
$cshowsPrec :: Int -> S3Bucket -> ShowS
Prelude.Show, (forall x. S3Bucket -> Rep S3Bucket x)
-> (forall x. Rep S3Bucket x -> S3Bucket) -> Generic S3Bucket
forall x. Rep S3Bucket x -> S3Bucket
forall x. S3Bucket -> Rep S3Bucket x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3Bucket x -> S3Bucket
$cfrom :: forall x. S3Bucket -> Rep S3Bucket x
Prelude.Generic)
newS3Bucket ::
S3Bucket
newS3Bucket :: S3Bucket
newS3Bucket =
S3Bucket' :: Maybe Text
-> Maybe POSIX
-> Maybe S3BucketOwner
-> Maybe Text
-> Maybe ServerSideEncryption
-> Maybe AllowsUnencryptedObjectUploads
-> Maybe BucketPublicAccess
-> Maybe [KeyValuePair]
-> S3Bucket
S3Bucket'
{ $sel:arn:S3Bucket' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:S3Bucket' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:owner:S3Bucket' :: Maybe S3BucketOwner
owner = Maybe S3BucketOwner
forall a. Maybe a
Prelude.Nothing,
$sel:name:S3Bucket' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:defaultServerSideEncryption:S3Bucket' :: Maybe ServerSideEncryption
defaultServerSideEncryption = Maybe ServerSideEncryption
forall a. Maybe a
Prelude.Nothing,
$sel:allowsUnencryptedObjectUploads:S3Bucket' :: Maybe AllowsUnencryptedObjectUploads
allowsUnencryptedObjectUploads = Maybe AllowsUnencryptedObjectUploads
forall a. Maybe a
Prelude.Nothing,
$sel:publicAccess:S3Bucket' :: Maybe BucketPublicAccess
publicAccess = Maybe BucketPublicAccess
forall a. Maybe a
Prelude.Nothing,
$sel:tags:S3Bucket' :: Maybe [KeyValuePair]
tags = Maybe [KeyValuePair]
forall a. Maybe a
Prelude.Nothing
}
s3Bucket_arn :: Lens.Lens' S3Bucket (Prelude.Maybe Prelude.Text)
s3Bucket_arn :: (Maybe Text -> f (Maybe Text)) -> S3Bucket -> f S3Bucket
s3Bucket_arn = (S3Bucket -> Maybe Text)
-> (S3Bucket -> Maybe Text -> S3Bucket)
-> Lens S3Bucket S3Bucket (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Bucket' {Maybe Text
arn :: Maybe Text
$sel:arn:S3Bucket' :: S3Bucket -> Maybe Text
arn} -> Maybe Text
arn) (\s :: S3Bucket
s@S3Bucket' {} Maybe Text
a -> S3Bucket
s {$sel:arn:S3Bucket' :: Maybe Text
arn = Maybe Text
a} :: S3Bucket)
s3Bucket_createdAt :: Lens.Lens' S3Bucket (Prelude.Maybe Prelude.UTCTime)
s3Bucket_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> S3Bucket -> f S3Bucket
s3Bucket_createdAt = (S3Bucket -> Maybe POSIX)
-> (S3Bucket -> Maybe POSIX -> S3Bucket)
-> Lens S3Bucket S3Bucket (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Bucket' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:S3Bucket' :: S3Bucket -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: S3Bucket
s@S3Bucket' {} Maybe POSIX
a -> S3Bucket
s {$sel:createdAt:S3Bucket' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: S3Bucket) ((Maybe POSIX -> f (Maybe POSIX)) -> S3Bucket -> f S3Bucket)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> S3Bucket
-> f S3Bucket
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
s3Bucket_owner :: Lens.Lens' S3Bucket (Prelude.Maybe S3BucketOwner)
s3Bucket_owner :: (Maybe S3BucketOwner -> f (Maybe S3BucketOwner))
-> S3Bucket -> f S3Bucket
s3Bucket_owner = (S3Bucket -> Maybe S3BucketOwner)
-> (S3Bucket -> Maybe S3BucketOwner -> S3Bucket)
-> Lens
S3Bucket S3Bucket (Maybe S3BucketOwner) (Maybe S3BucketOwner)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Bucket' {Maybe S3BucketOwner
owner :: Maybe S3BucketOwner
$sel:owner:S3Bucket' :: S3Bucket -> Maybe S3BucketOwner
owner} -> Maybe S3BucketOwner
owner) (\s :: S3Bucket
s@S3Bucket' {} Maybe S3BucketOwner
a -> S3Bucket
s {$sel:owner:S3Bucket' :: Maybe S3BucketOwner
owner = Maybe S3BucketOwner
a} :: S3Bucket)
s3Bucket_name :: Lens.Lens' S3Bucket (Prelude.Maybe Prelude.Text)
s3Bucket_name :: (Maybe Text -> f (Maybe Text)) -> S3Bucket -> f S3Bucket
s3Bucket_name = (S3Bucket -> Maybe Text)
-> (S3Bucket -> Maybe Text -> S3Bucket)
-> Lens S3Bucket S3Bucket (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Bucket' {Maybe Text
name :: Maybe Text
$sel:name:S3Bucket' :: S3Bucket -> Maybe Text
name} -> Maybe Text
name) (\s :: S3Bucket
s@S3Bucket' {} Maybe Text
a -> S3Bucket
s {$sel:name:S3Bucket' :: Maybe Text
name = Maybe Text
a} :: S3Bucket)
s3Bucket_defaultServerSideEncryption :: Lens.Lens' S3Bucket (Prelude.Maybe ServerSideEncryption)
s3Bucket_defaultServerSideEncryption :: (Maybe ServerSideEncryption -> f (Maybe ServerSideEncryption))
-> S3Bucket -> f S3Bucket
s3Bucket_defaultServerSideEncryption = (S3Bucket -> Maybe ServerSideEncryption)
-> (S3Bucket -> Maybe ServerSideEncryption -> S3Bucket)
-> Lens
S3Bucket
S3Bucket
(Maybe ServerSideEncryption)
(Maybe ServerSideEncryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Bucket' {Maybe ServerSideEncryption
defaultServerSideEncryption :: Maybe ServerSideEncryption
$sel:defaultServerSideEncryption:S3Bucket' :: S3Bucket -> Maybe ServerSideEncryption
defaultServerSideEncryption} -> Maybe ServerSideEncryption
defaultServerSideEncryption) (\s :: S3Bucket
s@S3Bucket' {} Maybe ServerSideEncryption
a -> S3Bucket
s {$sel:defaultServerSideEncryption:S3Bucket' :: Maybe ServerSideEncryption
defaultServerSideEncryption = Maybe ServerSideEncryption
a} :: S3Bucket)
s3Bucket_allowsUnencryptedObjectUploads :: Lens.Lens' S3Bucket (Prelude.Maybe AllowsUnencryptedObjectUploads)
s3Bucket_allowsUnencryptedObjectUploads :: (Maybe AllowsUnencryptedObjectUploads
-> f (Maybe AllowsUnencryptedObjectUploads))
-> S3Bucket -> f S3Bucket
s3Bucket_allowsUnencryptedObjectUploads = (S3Bucket -> Maybe AllowsUnencryptedObjectUploads)
-> (S3Bucket -> Maybe AllowsUnencryptedObjectUploads -> S3Bucket)
-> Lens
S3Bucket
S3Bucket
(Maybe AllowsUnencryptedObjectUploads)
(Maybe AllowsUnencryptedObjectUploads)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Bucket' {Maybe AllowsUnencryptedObjectUploads
allowsUnencryptedObjectUploads :: Maybe AllowsUnencryptedObjectUploads
$sel:allowsUnencryptedObjectUploads:S3Bucket' :: S3Bucket -> Maybe AllowsUnencryptedObjectUploads
allowsUnencryptedObjectUploads} -> Maybe AllowsUnencryptedObjectUploads
allowsUnencryptedObjectUploads) (\s :: S3Bucket
s@S3Bucket' {} Maybe AllowsUnencryptedObjectUploads
a -> S3Bucket
s {$sel:allowsUnencryptedObjectUploads:S3Bucket' :: Maybe AllowsUnencryptedObjectUploads
allowsUnencryptedObjectUploads = Maybe AllowsUnencryptedObjectUploads
a} :: S3Bucket)
s3Bucket_publicAccess :: Lens.Lens' S3Bucket (Prelude.Maybe BucketPublicAccess)
s3Bucket_publicAccess :: (Maybe BucketPublicAccess -> f (Maybe BucketPublicAccess))
-> S3Bucket -> f S3Bucket
s3Bucket_publicAccess = (S3Bucket -> Maybe BucketPublicAccess)
-> (S3Bucket -> Maybe BucketPublicAccess -> S3Bucket)
-> Lens
S3Bucket
S3Bucket
(Maybe BucketPublicAccess)
(Maybe BucketPublicAccess)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Bucket' {Maybe BucketPublicAccess
publicAccess :: Maybe BucketPublicAccess
$sel:publicAccess:S3Bucket' :: S3Bucket -> Maybe BucketPublicAccess
publicAccess} -> Maybe BucketPublicAccess
publicAccess) (\s :: S3Bucket
s@S3Bucket' {} Maybe BucketPublicAccess
a -> S3Bucket
s {$sel:publicAccess:S3Bucket' :: Maybe BucketPublicAccess
publicAccess = Maybe BucketPublicAccess
a} :: S3Bucket)
s3Bucket_tags :: Lens.Lens' S3Bucket (Prelude.Maybe [KeyValuePair])
s3Bucket_tags :: (Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> S3Bucket -> f S3Bucket
s3Bucket_tags = (S3Bucket -> Maybe [KeyValuePair])
-> (S3Bucket -> Maybe [KeyValuePair] -> S3Bucket)
-> Lens
S3Bucket S3Bucket (Maybe [KeyValuePair]) (Maybe [KeyValuePair])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Bucket' {Maybe [KeyValuePair]
tags :: Maybe [KeyValuePair]
$sel:tags:S3Bucket' :: S3Bucket -> Maybe [KeyValuePair]
tags} -> Maybe [KeyValuePair]
tags) (\s :: S3Bucket
s@S3Bucket' {} Maybe [KeyValuePair]
a -> S3Bucket
s {$sel:tags:S3Bucket' :: Maybe [KeyValuePair]
tags = Maybe [KeyValuePair]
a} :: S3Bucket) ((Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> S3Bucket -> f S3Bucket)
-> ((Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> (Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> S3Bucket
-> f S3Bucket
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [KeyValuePair] [KeyValuePair] [KeyValuePair] [KeyValuePair]
-> Iso
(Maybe [KeyValuePair])
(Maybe [KeyValuePair])
(Maybe [KeyValuePair])
(Maybe [KeyValuePair])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [KeyValuePair] [KeyValuePair] [KeyValuePair] [KeyValuePair]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON S3Bucket where
parseJSON :: Value -> Parser S3Bucket
parseJSON =
String -> (Object -> Parser S3Bucket) -> Value -> Parser S3Bucket
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"S3Bucket"
( \Object
x ->
Maybe Text
-> Maybe POSIX
-> Maybe S3BucketOwner
-> Maybe Text
-> Maybe ServerSideEncryption
-> Maybe AllowsUnencryptedObjectUploads
-> Maybe BucketPublicAccess
-> Maybe [KeyValuePair]
-> S3Bucket
S3Bucket'
(Maybe Text
-> Maybe POSIX
-> Maybe S3BucketOwner
-> Maybe Text
-> Maybe ServerSideEncryption
-> Maybe AllowsUnencryptedObjectUploads
-> Maybe BucketPublicAccess
-> Maybe [KeyValuePair]
-> S3Bucket)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe S3BucketOwner
-> Maybe Text
-> Maybe ServerSideEncryption
-> Maybe AllowsUnencryptedObjectUploads
-> Maybe BucketPublicAccess
-> Maybe [KeyValuePair]
-> S3Bucket)
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
"arn")
Parser
(Maybe POSIX
-> Maybe S3BucketOwner
-> Maybe Text
-> Maybe ServerSideEncryption
-> Maybe AllowsUnencryptedObjectUploads
-> Maybe BucketPublicAccess
-> Maybe [KeyValuePair]
-> S3Bucket)
-> Parser (Maybe POSIX)
-> Parser
(Maybe S3BucketOwner
-> Maybe Text
-> Maybe ServerSideEncryption
-> Maybe AllowsUnencryptedObjectUploads
-> Maybe BucketPublicAccess
-> Maybe [KeyValuePair]
-> S3Bucket)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
Parser
(Maybe S3BucketOwner
-> Maybe Text
-> Maybe ServerSideEncryption
-> Maybe AllowsUnencryptedObjectUploads
-> Maybe BucketPublicAccess
-> Maybe [KeyValuePair]
-> S3Bucket)
-> Parser (Maybe S3BucketOwner)
-> Parser
(Maybe Text
-> Maybe ServerSideEncryption
-> Maybe AllowsUnencryptedObjectUploads
-> Maybe BucketPublicAccess
-> Maybe [KeyValuePair]
-> S3Bucket)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe S3BucketOwner)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"owner")
Parser
(Maybe Text
-> Maybe ServerSideEncryption
-> Maybe AllowsUnencryptedObjectUploads
-> Maybe BucketPublicAccess
-> Maybe [KeyValuePair]
-> S3Bucket)
-> Parser (Maybe Text)
-> Parser
(Maybe ServerSideEncryption
-> Maybe AllowsUnencryptedObjectUploads
-> Maybe BucketPublicAccess
-> Maybe [KeyValuePair]
-> S3Bucket)
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
"name")
Parser
(Maybe ServerSideEncryption
-> Maybe AllowsUnencryptedObjectUploads
-> Maybe BucketPublicAccess
-> Maybe [KeyValuePair]
-> S3Bucket)
-> Parser (Maybe ServerSideEncryption)
-> Parser
(Maybe AllowsUnencryptedObjectUploads
-> Maybe BucketPublicAccess -> Maybe [KeyValuePair] -> S3Bucket)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ServerSideEncryption)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"defaultServerSideEncryption")
Parser
(Maybe AllowsUnencryptedObjectUploads
-> Maybe BucketPublicAccess -> Maybe [KeyValuePair] -> S3Bucket)
-> Parser (Maybe AllowsUnencryptedObjectUploads)
-> Parser
(Maybe BucketPublicAccess -> Maybe [KeyValuePair] -> S3Bucket)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AllowsUnencryptedObjectUploads)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"allowsUnencryptedObjectUploads")
Parser
(Maybe BucketPublicAccess -> Maybe [KeyValuePair] -> S3Bucket)
-> Parser (Maybe BucketPublicAccess)
-> Parser (Maybe [KeyValuePair] -> S3Bucket)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BucketPublicAccess)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"publicAccess")
Parser (Maybe [KeyValuePair] -> S3Bucket)
-> Parser (Maybe [KeyValuePair]) -> Parser S3Bucket
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [KeyValuePair]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe [KeyValuePair]))
-> Maybe [KeyValuePair] -> Parser (Maybe [KeyValuePair])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [KeyValuePair]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable S3Bucket
instance Prelude.NFData S3Bucket