{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MacieV2.Types.S3Bucket
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Provides information about the S3 bucket that a finding applies to.
--
-- /See:/ 'newS3Bucket' smart constructor.
data S3Bucket = S3Bucket'
  { -- | The Amazon Resource Name (ARN) of the bucket.
    S3Bucket -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time, in UTC and extended ISO 8601 format, when the bucket
    -- was created.
    S3Bucket -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The display name and canonical user ID for the Amazon Web Services
    -- account that owns the bucket.
    S3Bucket -> Maybe S3BucketOwner
owner :: Prelude.Maybe S3BucketOwner,
    -- | The name of the bucket.
    S3Bucket -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The type of server-side encryption that\'s used by default to encrypt
    -- objects in the bucket.
    S3Bucket -> Maybe ServerSideEncryption
defaultServerSideEncryption :: Prelude.Maybe ServerSideEncryption,
    -- | Specifies whether the bucket policy for the bucket requires server-side
    -- encryption of objects when objects are uploaded to the bucket. Possible
    -- values are:
    --
    -- -   FALSE - The bucket policy requires server-side encryption of new
    --     objects. PutObject requests must include the
    --     x-amz-server-side-encryption header and the value for that header
    --     must be AES256 or aws:kms.
    --
    -- -   TRUE - The bucket doesn\'t have a bucket policy or it has a bucket
    --     policy that doesn\'t require server-side encryption of new objects.
    --     If a bucket policy exists, it doesn\'t require PutObject requests to
    --     include the x-amz-server-side-encryption header and it doesn\'t
    --     require the value for that header to be AES256 or aws:kms.
    --
    -- -   UNKNOWN - Amazon Macie can\'t determine whether the bucket policy
    --     requires server-side encryption of objects.
    S3Bucket -> Maybe AllowsUnencryptedObjectUploads
allowsUnencryptedObjectUploads :: Prelude.Maybe AllowsUnencryptedObjectUploads,
    -- | The permissions settings that determine whether the bucket is publicly
    -- accessible.
    S3Bucket -> Maybe BucketPublicAccess
publicAccess :: Prelude.Maybe BucketPublicAccess,
    -- | The tags that are associated with the bucket.
    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)

-- |
-- Create a value of 'S3Bucket' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'arn', 's3Bucket_arn' - The Amazon Resource Name (ARN) of the bucket.
--
-- 'createdAt', 's3Bucket_createdAt' - The date and time, in UTC and extended ISO 8601 format, when the bucket
-- was created.
--
-- 'owner', 's3Bucket_owner' - The display name and canonical user ID for the Amazon Web Services
-- account that owns the bucket.
--
-- 'name', 's3Bucket_name' - The name of the bucket.
--
-- 'defaultServerSideEncryption', 's3Bucket_defaultServerSideEncryption' - The type of server-side encryption that\'s used by default to encrypt
-- objects in the bucket.
--
-- 'allowsUnencryptedObjectUploads', 's3Bucket_allowsUnencryptedObjectUploads' - Specifies whether the bucket policy for the bucket requires server-side
-- encryption of objects when objects are uploaded to the bucket. Possible
-- values are:
--
-- -   FALSE - The bucket policy requires server-side encryption of new
--     objects. PutObject requests must include the
--     x-amz-server-side-encryption header and the value for that header
--     must be AES256 or aws:kms.
--
-- -   TRUE - The bucket doesn\'t have a bucket policy or it has a bucket
--     policy that doesn\'t require server-side encryption of new objects.
--     If a bucket policy exists, it doesn\'t require PutObject requests to
--     include the x-amz-server-side-encryption header and it doesn\'t
--     require the value for that header to be AES256 or aws:kms.
--
-- -   UNKNOWN - Amazon Macie can\'t determine whether the bucket policy
--     requires server-side encryption of objects.
--
-- 'publicAccess', 's3Bucket_publicAccess' - The permissions settings that determine whether the bucket is publicly
-- accessible.
--
-- 'tags', 's3Bucket_tags' - The tags that are associated with the bucket.
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
    }

-- | The Amazon Resource Name (ARN) of the bucket.
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)

-- | The date and time, in UTC and extended ISO 8601 format, when the bucket
-- was created.
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

-- | The display name and canonical user ID for the Amazon Web Services
-- account that owns the bucket.
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)

-- | The name of the bucket.
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)

-- | The type of server-side encryption that\'s used by default to encrypt
-- objects in the bucket.
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)

-- | Specifies whether the bucket policy for the bucket requires server-side
-- encryption of objects when objects are uploaded to the bucket. Possible
-- values are:
--
-- -   FALSE - The bucket policy requires server-side encryption of new
--     objects. PutObject requests must include the
--     x-amz-server-side-encryption header and the value for that header
--     must be AES256 or aws:kms.
--
-- -   TRUE - The bucket doesn\'t have a bucket policy or it has a bucket
--     policy that doesn\'t require server-side encryption of new objects.
--     If a bucket policy exists, it doesn\'t require PutObject requests to
--     include the x-amz-server-side-encryption header and it doesn\'t
--     require the value for that header to be AES256 or aws:kms.
--
-- -   UNKNOWN - Amazon Macie can\'t determine whether the bucket policy
--     requires server-side encryption of objects.
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)

-- | The permissions settings that determine whether the bucket is publicly
-- accessible.
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)

-- | The tags that are associated with the bucket.
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