{-# 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.GuardDuty.Types.S3BucketDetail where
import qualified Amazonka.Core as Core
import Amazonka.GuardDuty.Types.DefaultServerSideEncryption
import Amazonka.GuardDuty.Types.Owner
import Amazonka.GuardDuty.Types.PublicAccess
import Amazonka.GuardDuty.Types.Tag
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data S3BucketDetail = S3BucketDetail'
{
S3BucketDetail -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
S3BucketDetail -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
S3BucketDetail -> Maybe Owner
owner :: Prelude.Maybe Owner,
S3BucketDetail -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
S3BucketDetail -> Maybe DefaultServerSideEncryption
defaultServerSideEncryption :: Prelude.Maybe DefaultServerSideEncryption,
S3BucketDetail -> Maybe PublicAccess
publicAccess :: Prelude.Maybe PublicAccess,
S3BucketDetail -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
S3BucketDetail -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
}
deriving (S3BucketDetail -> S3BucketDetail -> Bool
(S3BucketDetail -> S3BucketDetail -> Bool)
-> (S3BucketDetail -> S3BucketDetail -> Bool) -> Eq S3BucketDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3BucketDetail -> S3BucketDetail -> Bool
$c/= :: S3BucketDetail -> S3BucketDetail -> Bool
== :: S3BucketDetail -> S3BucketDetail -> Bool
$c== :: S3BucketDetail -> S3BucketDetail -> Bool
Prelude.Eq, ReadPrec [S3BucketDetail]
ReadPrec S3BucketDetail
Int -> ReadS S3BucketDetail
ReadS [S3BucketDetail]
(Int -> ReadS S3BucketDetail)
-> ReadS [S3BucketDetail]
-> ReadPrec S3BucketDetail
-> ReadPrec [S3BucketDetail]
-> Read S3BucketDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3BucketDetail]
$creadListPrec :: ReadPrec [S3BucketDetail]
readPrec :: ReadPrec S3BucketDetail
$creadPrec :: ReadPrec S3BucketDetail
readList :: ReadS [S3BucketDetail]
$creadList :: ReadS [S3BucketDetail]
readsPrec :: Int -> ReadS S3BucketDetail
$creadsPrec :: Int -> ReadS S3BucketDetail
Prelude.Read, Int -> S3BucketDetail -> ShowS
[S3BucketDetail] -> ShowS
S3BucketDetail -> String
(Int -> S3BucketDetail -> ShowS)
-> (S3BucketDetail -> String)
-> ([S3BucketDetail] -> ShowS)
-> Show S3BucketDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3BucketDetail] -> ShowS
$cshowList :: [S3BucketDetail] -> ShowS
show :: S3BucketDetail -> String
$cshow :: S3BucketDetail -> String
showsPrec :: Int -> S3BucketDetail -> ShowS
$cshowsPrec :: Int -> S3BucketDetail -> ShowS
Prelude.Show, (forall x. S3BucketDetail -> Rep S3BucketDetail x)
-> (forall x. Rep S3BucketDetail x -> S3BucketDetail)
-> Generic S3BucketDetail
forall x. Rep S3BucketDetail x -> S3BucketDetail
forall x. S3BucketDetail -> Rep S3BucketDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3BucketDetail x -> S3BucketDetail
$cfrom :: forall x. S3BucketDetail -> Rep S3BucketDetail x
Prelude.Generic)
newS3BucketDetail ::
S3BucketDetail
newS3BucketDetail :: S3BucketDetail
newS3BucketDetail =
S3BucketDetail' :: Maybe Text
-> Maybe POSIX
-> Maybe Owner
-> Maybe Text
-> Maybe DefaultServerSideEncryption
-> Maybe PublicAccess
-> Maybe Text
-> Maybe [Tag]
-> S3BucketDetail
S3BucketDetail'
{ $sel:arn:S3BucketDetail' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:S3BucketDetail' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:owner:S3BucketDetail' :: Maybe Owner
owner = Maybe Owner
forall a. Maybe a
Prelude.Nothing,
$sel:name:S3BucketDetail' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:defaultServerSideEncryption:S3BucketDetail' :: Maybe DefaultServerSideEncryption
defaultServerSideEncryption = Maybe DefaultServerSideEncryption
forall a. Maybe a
Prelude.Nothing,
$sel:publicAccess:S3BucketDetail' :: Maybe PublicAccess
publicAccess = Maybe PublicAccess
forall a. Maybe a
Prelude.Nothing,
$sel:type':S3BucketDetail' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:S3BucketDetail' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
}
s3BucketDetail_arn :: Lens.Lens' S3BucketDetail (Prelude.Maybe Prelude.Text)
s3BucketDetail_arn :: (Maybe Text -> f (Maybe Text))
-> S3BucketDetail -> f S3BucketDetail
s3BucketDetail_arn = (S3BucketDetail -> Maybe Text)
-> (S3BucketDetail -> Maybe Text -> S3BucketDetail)
-> Lens S3BucketDetail S3BucketDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3BucketDetail' {Maybe Text
arn :: Maybe Text
$sel:arn:S3BucketDetail' :: S3BucketDetail -> Maybe Text
arn} -> Maybe Text
arn) (\s :: S3BucketDetail
s@S3BucketDetail' {} Maybe Text
a -> S3BucketDetail
s {$sel:arn:S3BucketDetail' :: Maybe Text
arn = Maybe Text
a} :: S3BucketDetail)
s3BucketDetail_createdAt :: Lens.Lens' S3BucketDetail (Prelude.Maybe Prelude.UTCTime)
s3BucketDetail_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> S3BucketDetail -> f S3BucketDetail
s3BucketDetail_createdAt = (S3BucketDetail -> Maybe POSIX)
-> (S3BucketDetail -> Maybe POSIX -> S3BucketDetail)
-> Lens S3BucketDetail S3BucketDetail (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3BucketDetail' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:S3BucketDetail' :: S3BucketDetail -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: S3BucketDetail
s@S3BucketDetail' {} Maybe POSIX
a -> S3BucketDetail
s {$sel:createdAt:S3BucketDetail' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: S3BucketDetail) ((Maybe POSIX -> f (Maybe POSIX))
-> S3BucketDetail -> f S3BucketDetail)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> S3BucketDetail
-> f S3BucketDetail
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
s3BucketDetail_owner :: Lens.Lens' S3BucketDetail (Prelude.Maybe Owner)
s3BucketDetail_owner :: (Maybe Owner -> f (Maybe Owner))
-> S3BucketDetail -> f S3BucketDetail
s3BucketDetail_owner = (S3BucketDetail -> Maybe Owner)
-> (S3BucketDetail -> Maybe Owner -> S3BucketDetail)
-> Lens S3BucketDetail S3BucketDetail (Maybe Owner) (Maybe Owner)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3BucketDetail' {Maybe Owner
owner :: Maybe Owner
$sel:owner:S3BucketDetail' :: S3BucketDetail -> Maybe Owner
owner} -> Maybe Owner
owner) (\s :: S3BucketDetail
s@S3BucketDetail' {} Maybe Owner
a -> S3BucketDetail
s {$sel:owner:S3BucketDetail' :: Maybe Owner
owner = Maybe Owner
a} :: S3BucketDetail)
s3BucketDetail_name :: Lens.Lens' S3BucketDetail (Prelude.Maybe Prelude.Text)
s3BucketDetail_name :: (Maybe Text -> f (Maybe Text))
-> S3BucketDetail -> f S3BucketDetail
s3BucketDetail_name = (S3BucketDetail -> Maybe Text)
-> (S3BucketDetail -> Maybe Text -> S3BucketDetail)
-> Lens S3BucketDetail S3BucketDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3BucketDetail' {Maybe Text
name :: Maybe Text
$sel:name:S3BucketDetail' :: S3BucketDetail -> Maybe Text
name} -> Maybe Text
name) (\s :: S3BucketDetail
s@S3BucketDetail' {} Maybe Text
a -> S3BucketDetail
s {$sel:name:S3BucketDetail' :: Maybe Text
name = Maybe Text
a} :: S3BucketDetail)
s3BucketDetail_defaultServerSideEncryption :: Lens.Lens' S3BucketDetail (Prelude.Maybe DefaultServerSideEncryption)
s3BucketDetail_defaultServerSideEncryption :: (Maybe DefaultServerSideEncryption
-> f (Maybe DefaultServerSideEncryption))
-> S3BucketDetail -> f S3BucketDetail
s3BucketDetail_defaultServerSideEncryption = (S3BucketDetail -> Maybe DefaultServerSideEncryption)
-> (S3BucketDetail
-> Maybe DefaultServerSideEncryption -> S3BucketDetail)
-> Lens
S3BucketDetail
S3BucketDetail
(Maybe DefaultServerSideEncryption)
(Maybe DefaultServerSideEncryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3BucketDetail' {Maybe DefaultServerSideEncryption
defaultServerSideEncryption :: Maybe DefaultServerSideEncryption
$sel:defaultServerSideEncryption:S3BucketDetail' :: S3BucketDetail -> Maybe DefaultServerSideEncryption
defaultServerSideEncryption} -> Maybe DefaultServerSideEncryption
defaultServerSideEncryption) (\s :: S3BucketDetail
s@S3BucketDetail' {} Maybe DefaultServerSideEncryption
a -> S3BucketDetail
s {$sel:defaultServerSideEncryption:S3BucketDetail' :: Maybe DefaultServerSideEncryption
defaultServerSideEncryption = Maybe DefaultServerSideEncryption
a} :: S3BucketDetail)
s3BucketDetail_publicAccess :: Lens.Lens' S3BucketDetail (Prelude.Maybe PublicAccess)
s3BucketDetail_publicAccess :: (Maybe PublicAccess -> f (Maybe PublicAccess))
-> S3BucketDetail -> f S3BucketDetail
s3BucketDetail_publicAccess = (S3BucketDetail -> Maybe PublicAccess)
-> (S3BucketDetail -> Maybe PublicAccess -> S3BucketDetail)
-> Lens
S3BucketDetail
S3BucketDetail
(Maybe PublicAccess)
(Maybe PublicAccess)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3BucketDetail' {Maybe PublicAccess
publicAccess :: Maybe PublicAccess
$sel:publicAccess:S3BucketDetail' :: S3BucketDetail -> Maybe PublicAccess
publicAccess} -> Maybe PublicAccess
publicAccess) (\s :: S3BucketDetail
s@S3BucketDetail' {} Maybe PublicAccess
a -> S3BucketDetail
s {$sel:publicAccess:S3BucketDetail' :: Maybe PublicAccess
publicAccess = Maybe PublicAccess
a} :: S3BucketDetail)
s3BucketDetail_type :: Lens.Lens' S3BucketDetail (Prelude.Maybe Prelude.Text)
s3BucketDetail_type :: (Maybe Text -> f (Maybe Text))
-> S3BucketDetail -> f S3BucketDetail
s3BucketDetail_type = (S3BucketDetail -> Maybe Text)
-> (S3BucketDetail -> Maybe Text -> S3BucketDetail)
-> Lens S3BucketDetail S3BucketDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3BucketDetail' {Maybe Text
type' :: Maybe Text
$sel:type':S3BucketDetail' :: S3BucketDetail -> Maybe Text
type'} -> Maybe Text
type') (\s :: S3BucketDetail
s@S3BucketDetail' {} Maybe Text
a -> S3BucketDetail
s {$sel:type':S3BucketDetail' :: Maybe Text
type' = Maybe Text
a} :: S3BucketDetail)
s3BucketDetail_tags :: Lens.Lens' S3BucketDetail (Prelude.Maybe [Tag])
s3BucketDetail_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> S3BucketDetail -> f S3BucketDetail
s3BucketDetail_tags = (S3BucketDetail -> Maybe [Tag])
-> (S3BucketDetail -> Maybe [Tag] -> S3BucketDetail)
-> Lens S3BucketDetail S3BucketDetail (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3BucketDetail' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:S3BucketDetail' :: S3BucketDetail -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: S3BucketDetail
s@S3BucketDetail' {} Maybe [Tag]
a -> S3BucketDetail
s {$sel:tags:S3BucketDetail' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: S3BucketDetail) ((Maybe [Tag] -> f (Maybe [Tag]))
-> S3BucketDetail -> f S3BucketDetail)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> S3BucketDetail
-> f S3BucketDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON S3BucketDetail where
parseJSON :: Value -> Parser S3BucketDetail
parseJSON =
String
-> (Object -> Parser S3BucketDetail)
-> Value
-> Parser S3BucketDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"S3BucketDetail"
( \Object
x ->
Maybe Text
-> Maybe POSIX
-> Maybe Owner
-> Maybe Text
-> Maybe DefaultServerSideEncryption
-> Maybe PublicAccess
-> Maybe Text
-> Maybe [Tag]
-> S3BucketDetail
S3BucketDetail'
(Maybe Text
-> Maybe POSIX
-> Maybe Owner
-> Maybe Text
-> Maybe DefaultServerSideEncryption
-> Maybe PublicAccess
-> Maybe Text
-> Maybe [Tag]
-> S3BucketDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Owner
-> Maybe Text
-> Maybe DefaultServerSideEncryption
-> Maybe PublicAccess
-> Maybe Text
-> Maybe [Tag]
-> S3BucketDetail)
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 Owner
-> Maybe Text
-> Maybe DefaultServerSideEncryption
-> Maybe PublicAccess
-> Maybe Text
-> Maybe [Tag]
-> S3BucketDetail)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Owner
-> Maybe Text
-> Maybe DefaultServerSideEncryption
-> Maybe PublicAccess
-> Maybe Text
-> Maybe [Tag]
-> S3BucketDetail)
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 Owner
-> Maybe Text
-> Maybe DefaultServerSideEncryption
-> Maybe PublicAccess
-> Maybe Text
-> Maybe [Tag]
-> S3BucketDetail)
-> Parser (Maybe Owner)
-> Parser
(Maybe Text
-> Maybe DefaultServerSideEncryption
-> Maybe PublicAccess
-> Maybe Text
-> Maybe [Tag]
-> S3BucketDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Owner)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"owner")
Parser
(Maybe Text
-> Maybe DefaultServerSideEncryption
-> Maybe PublicAccess
-> Maybe Text
-> Maybe [Tag]
-> S3BucketDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe DefaultServerSideEncryption
-> Maybe PublicAccess
-> Maybe Text
-> Maybe [Tag]
-> S3BucketDetail)
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 DefaultServerSideEncryption
-> Maybe PublicAccess
-> Maybe Text
-> Maybe [Tag]
-> S3BucketDetail)
-> Parser (Maybe DefaultServerSideEncryption)
-> Parser
(Maybe PublicAccess -> Maybe Text -> Maybe [Tag] -> S3BucketDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DefaultServerSideEncryption)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"defaultServerSideEncryption")
Parser
(Maybe PublicAccess -> Maybe Text -> Maybe [Tag] -> S3BucketDetail)
-> Parser (Maybe PublicAccess)
-> Parser (Maybe Text -> Maybe [Tag] -> S3BucketDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PublicAccess)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"publicAccess")
Parser (Maybe Text -> Maybe [Tag] -> S3BucketDetail)
-> Parser (Maybe Text) -> Parser (Maybe [Tag] -> S3BucketDetail)
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
"type")
Parser (Maybe [Tag] -> S3BucketDetail)
-> Parser (Maybe [Tag]) -> Parser S3BucketDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable S3BucketDetail
instance Prelude.NFData S3BucketDetail