{-# 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.IamUser where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data IamUser = IamUser'
{
IamUser -> Maybe Text
principalId :: Prelude.Maybe Prelude.Text,
IamUser -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
IamUser -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
IamUser -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text
}
deriving (IamUser -> IamUser -> Bool
(IamUser -> IamUser -> Bool)
-> (IamUser -> IamUser -> Bool) -> Eq IamUser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IamUser -> IamUser -> Bool
$c/= :: IamUser -> IamUser -> Bool
== :: IamUser -> IamUser -> Bool
$c== :: IamUser -> IamUser -> Bool
Prelude.Eq, ReadPrec [IamUser]
ReadPrec IamUser
Int -> ReadS IamUser
ReadS [IamUser]
(Int -> ReadS IamUser)
-> ReadS [IamUser]
-> ReadPrec IamUser
-> ReadPrec [IamUser]
-> Read IamUser
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IamUser]
$creadListPrec :: ReadPrec [IamUser]
readPrec :: ReadPrec IamUser
$creadPrec :: ReadPrec IamUser
readList :: ReadS [IamUser]
$creadList :: ReadS [IamUser]
readsPrec :: Int -> ReadS IamUser
$creadsPrec :: Int -> ReadS IamUser
Prelude.Read, Int -> IamUser -> ShowS
[IamUser] -> ShowS
IamUser -> String
(Int -> IamUser -> ShowS)
-> (IamUser -> String) -> ([IamUser] -> ShowS) -> Show IamUser
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IamUser] -> ShowS
$cshowList :: [IamUser] -> ShowS
show :: IamUser -> String
$cshow :: IamUser -> String
showsPrec :: Int -> IamUser -> ShowS
$cshowsPrec :: Int -> IamUser -> ShowS
Prelude.Show, (forall x. IamUser -> Rep IamUser x)
-> (forall x. Rep IamUser x -> IamUser) -> Generic IamUser
forall x. Rep IamUser x -> IamUser
forall x. IamUser -> Rep IamUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IamUser x -> IamUser
$cfrom :: forall x. IamUser -> Rep IamUser x
Prelude.Generic)
newIamUser ::
IamUser
newIamUser :: IamUser
newIamUser =
IamUser' :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> IamUser
IamUser'
{ $sel:principalId:IamUser' :: Maybe Text
principalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:IamUser' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userName:IamUser' :: Maybe Text
userName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:IamUser' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
iamUser_principalId :: Lens.Lens' IamUser (Prelude.Maybe Prelude.Text)
iamUser_principalId :: (Maybe Text -> f (Maybe Text)) -> IamUser -> f IamUser
iamUser_principalId = (IamUser -> Maybe Text)
-> (IamUser -> Maybe Text -> IamUser)
-> Lens IamUser IamUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IamUser' {Maybe Text
principalId :: Maybe Text
$sel:principalId:IamUser' :: IamUser -> Maybe Text
principalId} -> Maybe Text
principalId) (\s :: IamUser
s@IamUser' {} Maybe Text
a -> IamUser
s {$sel:principalId:IamUser' :: Maybe Text
principalId = Maybe Text
a} :: IamUser)
iamUser_arn :: Lens.Lens' IamUser (Prelude.Maybe Prelude.Text)
iamUser_arn :: (Maybe Text -> f (Maybe Text)) -> IamUser -> f IamUser
iamUser_arn = (IamUser -> Maybe Text)
-> (IamUser -> Maybe Text -> IamUser)
-> Lens IamUser IamUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IamUser' {Maybe Text
arn :: Maybe Text
$sel:arn:IamUser' :: IamUser -> Maybe Text
arn} -> Maybe Text
arn) (\s :: IamUser
s@IamUser' {} Maybe Text
a -> IamUser
s {$sel:arn:IamUser' :: Maybe Text
arn = Maybe Text
a} :: IamUser)
iamUser_userName :: Lens.Lens' IamUser (Prelude.Maybe Prelude.Text)
iamUser_userName :: (Maybe Text -> f (Maybe Text)) -> IamUser -> f IamUser
iamUser_userName = (IamUser -> Maybe Text)
-> (IamUser -> Maybe Text -> IamUser)
-> Lens IamUser IamUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IamUser' {Maybe Text
userName :: Maybe Text
$sel:userName:IamUser' :: IamUser -> Maybe Text
userName} -> Maybe Text
userName) (\s :: IamUser
s@IamUser' {} Maybe Text
a -> IamUser
s {$sel:userName:IamUser' :: Maybe Text
userName = Maybe Text
a} :: IamUser)
iamUser_accountId :: Lens.Lens' IamUser (Prelude.Maybe Prelude.Text)
iamUser_accountId :: (Maybe Text -> f (Maybe Text)) -> IamUser -> f IamUser
iamUser_accountId = (IamUser -> Maybe Text)
-> (IamUser -> Maybe Text -> IamUser)
-> Lens IamUser IamUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IamUser' {Maybe Text
accountId :: Maybe Text
$sel:accountId:IamUser' :: IamUser -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: IamUser
s@IamUser' {} Maybe Text
a -> IamUser
s {$sel:accountId:IamUser' :: Maybe Text
accountId = Maybe Text
a} :: IamUser)
instance Core.FromJSON IamUser where
parseJSON :: Value -> Parser IamUser
parseJSON =
String -> (Object -> Parser IamUser) -> Value -> Parser IamUser
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"IamUser"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> IamUser
IamUser'
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> IamUser)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> IamUser)
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
"principalId")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> IamUser)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> IamUser)
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
"arn")
Parser (Maybe Text -> Maybe Text -> IamUser)
-> Parser (Maybe Text) -> Parser (Maybe Text -> IamUser)
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
"userName")
Parser (Maybe Text -> IamUser)
-> Parser (Maybe Text) -> Parser IamUser
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
"accountId")
)
instance Prelude.Hashable IamUser
instance Prelude.NFData IamUser