{-# 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.AclGrantee where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data AclGrantee = AclGrantee'
{
AclGrantee -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
AclGrantee -> Maybe Text
uri :: Prelude.Maybe Prelude.Text
}
deriving (AclGrantee -> AclGrantee -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AclGrantee -> AclGrantee -> Bool
$c/= :: AclGrantee -> AclGrantee -> Bool
== :: AclGrantee -> AclGrantee -> Bool
$c== :: AclGrantee -> AclGrantee -> Bool
Prelude.Eq, ReadPrec [AclGrantee]
ReadPrec AclGrantee
Int -> ReadS AclGrantee
ReadS [AclGrantee]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AclGrantee]
$creadListPrec :: ReadPrec [AclGrantee]
readPrec :: ReadPrec AclGrantee
$creadPrec :: ReadPrec AclGrantee
readList :: ReadS [AclGrantee]
$creadList :: ReadS [AclGrantee]
readsPrec :: Int -> ReadS AclGrantee
$creadsPrec :: Int -> ReadS AclGrantee
Prelude.Read, Int -> AclGrantee -> ShowS
[AclGrantee] -> ShowS
AclGrantee -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AclGrantee] -> ShowS
$cshowList :: [AclGrantee] -> ShowS
show :: AclGrantee -> String
$cshow :: AclGrantee -> String
showsPrec :: Int -> AclGrantee -> ShowS
$cshowsPrec :: Int -> AclGrantee -> ShowS
Prelude.Show, forall x. Rep AclGrantee x -> AclGrantee
forall x. AclGrantee -> Rep AclGrantee x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AclGrantee x -> AclGrantee
$cfrom :: forall x. AclGrantee -> Rep AclGrantee x
Prelude.Generic)
newAclGrantee ::
AclGrantee
newAclGrantee :: AclGrantee
newAclGrantee =
AclGrantee'
{ $sel:id:AclGrantee' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:uri:AclGrantee' :: Maybe Text
uri = forall a. Maybe a
Prelude.Nothing
}
aclGrantee_id :: Lens.Lens' AclGrantee (Prelude.Maybe Prelude.Text)
aclGrantee_id :: Lens' AclGrantee (Maybe Text)
aclGrantee_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AclGrantee' {Maybe Text
id :: Maybe Text
$sel:id:AclGrantee' :: AclGrantee -> Maybe Text
id} -> Maybe Text
id) (\s :: AclGrantee
s@AclGrantee' {} Maybe Text
a -> AclGrantee
s {$sel:id:AclGrantee' :: Maybe Text
id = Maybe Text
a} :: AclGrantee)
aclGrantee_uri :: Lens.Lens' AclGrantee (Prelude.Maybe Prelude.Text)
aclGrantee_uri :: Lens' AclGrantee (Maybe Text)
aclGrantee_uri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AclGrantee' {Maybe Text
uri :: Maybe Text
$sel:uri:AclGrantee' :: AclGrantee -> Maybe Text
uri} -> Maybe Text
uri) (\s :: AclGrantee
s@AclGrantee' {} Maybe Text
a -> AclGrantee
s {$sel:uri:AclGrantee' :: Maybe Text
uri = Maybe Text
a} :: AclGrantee)
instance Data.FromJSON AclGrantee where
parseJSON :: Value -> Parser AclGrantee
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AclGrantee"
( \Object
x ->
Maybe Text -> Maybe Text -> AclGrantee
AclGrantee'
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
"id")
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
"uri")
)
instance Prelude.Hashable AclGrantee where
hashWithSalt :: Int -> AclGrantee -> Int
hashWithSalt Int
_salt AclGrantee' {Maybe Text
uri :: Maybe Text
id :: Maybe Text
$sel:uri:AclGrantee' :: AclGrantee -> Maybe Text
$sel:id:AclGrantee' :: AclGrantee -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
uri
instance Prelude.NFData AclGrantee where
rnf :: AclGrantee -> ()
rnf AclGrantee' {Maybe Text
uri :: Maybe Text
id :: Maybe Text
$sel:uri:AclGrantee' :: AclGrantee -> Maybe Text
$sel:id:AclGrantee' :: AclGrantee -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
uri
instance Data.ToJSON AclGrantee where
toJSON :: AclGrantee -> Value
toJSON AclGrantee' {Maybe Text
uri :: Maybe Text
id :: Maybe Text
$sel:uri:AclGrantee' :: AclGrantee -> Maybe Text
$sel:id:AclGrantee' :: AclGrantee -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
id,
(Key
"uri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
uri
]
)