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