{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 AllowsUnencryptedObjectUploads
allowsUnencryptedObjectUploads :: Prelude.Maybe AllowsUnencryptedObjectUploads,
S3Bucket -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
S3Bucket -> Maybe ISO8601
createdAt :: Prelude.Maybe Data.ISO8601,
S3Bucket -> Maybe ServerSideEncryption
defaultServerSideEncryption :: Prelude.Maybe ServerSideEncryption,
S3Bucket -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
S3Bucket -> Maybe S3BucketOwner
owner :: Prelude.Maybe S3BucketOwner,
S3Bucket -> Maybe BucketPublicAccess
publicAccess :: Prelude.Maybe BucketPublicAccess,
S3Bucket -> Maybe [KeyValuePair]
tags :: Prelude.Maybe [KeyValuePair]
}
deriving (S3Bucket -> S3Bucket -> Bool
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]
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
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. 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'
{ $sel:allowsUnencryptedObjectUploads:S3Bucket' :: Maybe AllowsUnencryptedObjectUploads
allowsUnencryptedObjectUploads =
forall a. Maybe a
Prelude.Nothing,
$sel:arn:S3Bucket' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:S3Bucket' :: Maybe ISO8601
createdAt = forall a. Maybe a
Prelude.Nothing,
$sel:defaultServerSideEncryption:S3Bucket' :: Maybe ServerSideEncryption
defaultServerSideEncryption = forall a. Maybe a
Prelude.Nothing,
$sel:name:S3Bucket' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:owner:S3Bucket' :: Maybe S3BucketOwner
owner = forall a. Maybe a
Prelude.Nothing,
$sel:publicAccess:S3Bucket' :: Maybe BucketPublicAccess
publicAccess = forall a. Maybe a
Prelude.Nothing,
$sel:tags:S3Bucket' :: Maybe [KeyValuePair]
tags = forall a. Maybe a
Prelude.Nothing
}
s3Bucket_allowsUnencryptedObjectUploads :: Lens.Lens' S3Bucket (Prelude.Maybe AllowsUnencryptedObjectUploads)
s3Bucket_allowsUnencryptedObjectUploads :: Lens' S3Bucket (Maybe AllowsUnencryptedObjectUploads)
s3Bucket_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_arn :: Lens.Lens' S3Bucket (Prelude.Maybe Prelude.Text)
s3Bucket_arn :: Lens' S3Bucket (Maybe Text)
s3Bucket_arn = 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 :: Lens' S3Bucket (Maybe UTCTime)
s3Bucket_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Bucket' {Maybe ISO8601
createdAt :: Maybe ISO8601
$sel:createdAt:S3Bucket' :: S3Bucket -> Maybe ISO8601
createdAt} -> Maybe ISO8601
createdAt) (\s :: S3Bucket
s@S3Bucket' {} Maybe ISO8601
a -> S3Bucket
s {$sel:createdAt:S3Bucket' :: Maybe ISO8601
createdAt = Maybe ISO8601
a} :: S3Bucket) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
s3Bucket_defaultServerSideEncryption :: Lens.Lens' S3Bucket (Prelude.Maybe ServerSideEncryption)
s3Bucket_defaultServerSideEncryption :: Lens' S3Bucket (Maybe ServerSideEncryption)
s3Bucket_defaultServerSideEncryption = 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_name :: Lens.Lens' S3Bucket (Prelude.Maybe Prelude.Text)
s3Bucket_name :: Lens' S3Bucket (Maybe Text)
s3Bucket_name = 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_owner :: Lens.Lens' S3Bucket (Prelude.Maybe S3BucketOwner)
s3Bucket_owner :: Lens' S3Bucket (Maybe S3BucketOwner)
s3Bucket_owner = 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_publicAccess :: Lens.Lens' S3Bucket (Prelude.Maybe BucketPublicAccess)
s3Bucket_publicAccess :: Lens' S3Bucket (Maybe BucketPublicAccess)
s3Bucket_publicAccess = 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 :: Lens' S3Bucket (Maybe [KeyValuePair])
s3Bucket_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON S3Bucket where
parseJSON :: Value -> Parser S3Bucket
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"S3Bucket"
( \Object
x ->
Maybe AllowsUnencryptedObjectUploads
-> Maybe Text
-> Maybe ISO8601
-> Maybe ServerSideEncryption
-> Maybe Text
-> Maybe S3BucketOwner
-> Maybe BucketPublicAccess
-> Maybe [KeyValuePair]
-> S3Bucket
S3Bucket'
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
"allowsUnencryptedObjectUploads")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"createdAt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"defaultServerSideEncryption")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"owner")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"publicAccess")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable S3Bucket where
hashWithSalt :: Int -> S3Bucket -> Int
hashWithSalt Int
_salt S3Bucket' {Maybe [KeyValuePair]
Maybe Text
Maybe ISO8601
Maybe AllowsUnencryptedObjectUploads
Maybe BucketPublicAccess
Maybe S3BucketOwner
Maybe ServerSideEncryption
tags :: Maybe [KeyValuePair]
publicAccess :: Maybe BucketPublicAccess
owner :: Maybe S3BucketOwner
name :: Maybe Text
defaultServerSideEncryption :: Maybe ServerSideEncryption
createdAt :: Maybe ISO8601
arn :: Maybe Text
allowsUnencryptedObjectUploads :: Maybe AllowsUnencryptedObjectUploads
$sel:tags:S3Bucket' :: S3Bucket -> Maybe [KeyValuePair]
$sel:publicAccess:S3Bucket' :: S3Bucket -> Maybe BucketPublicAccess
$sel:owner:S3Bucket' :: S3Bucket -> Maybe S3BucketOwner
$sel:name:S3Bucket' :: S3Bucket -> Maybe Text
$sel:defaultServerSideEncryption:S3Bucket' :: S3Bucket -> Maybe ServerSideEncryption
$sel:createdAt:S3Bucket' :: S3Bucket -> Maybe ISO8601
$sel:arn:S3Bucket' :: S3Bucket -> Maybe Text
$sel:allowsUnencryptedObjectUploads:S3Bucket' :: S3Bucket -> Maybe AllowsUnencryptedObjectUploads
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AllowsUnencryptedObjectUploads
allowsUnencryptedObjectUploads
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
createdAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ServerSideEncryption
defaultServerSideEncryption
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3BucketOwner
owner
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BucketPublicAccess
publicAccess
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [KeyValuePair]
tags
instance Prelude.NFData S3Bucket where
rnf :: S3Bucket -> ()
rnf S3Bucket' {Maybe [KeyValuePair]
Maybe Text
Maybe ISO8601
Maybe AllowsUnencryptedObjectUploads
Maybe BucketPublicAccess
Maybe S3BucketOwner
Maybe ServerSideEncryption
tags :: Maybe [KeyValuePair]
publicAccess :: Maybe BucketPublicAccess
owner :: Maybe S3BucketOwner
name :: Maybe Text
defaultServerSideEncryption :: Maybe ServerSideEncryption
createdAt :: Maybe ISO8601
arn :: Maybe Text
allowsUnencryptedObjectUploads :: Maybe AllowsUnencryptedObjectUploads
$sel:tags:S3Bucket' :: S3Bucket -> Maybe [KeyValuePair]
$sel:publicAccess:S3Bucket' :: S3Bucket -> Maybe BucketPublicAccess
$sel:owner:S3Bucket' :: S3Bucket -> Maybe S3BucketOwner
$sel:name:S3Bucket' :: S3Bucket -> Maybe Text
$sel:defaultServerSideEncryption:S3Bucket' :: S3Bucket -> Maybe ServerSideEncryption
$sel:createdAt:S3Bucket' :: S3Bucket -> Maybe ISO8601
$sel:arn:S3Bucket' :: S3Bucket -> Maybe Text
$sel:allowsUnencryptedObjectUploads:S3Bucket' :: S3Bucket -> Maybe AllowsUnencryptedObjectUploads
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AllowsUnencryptedObjectUploads
allowsUnencryptedObjectUploads
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ServerSideEncryption
defaultServerSideEncryption
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe S3BucketOwner
owner
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe BucketPublicAccess
publicAccess
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [KeyValuePair]
tags