{-# 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.UserIdentity where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types.AssumedRole
import Amazonka.MacieV2.Types.AwsAccount
import Amazonka.MacieV2.Types.AwsService
import Amazonka.MacieV2.Types.FederatedUser
import Amazonka.MacieV2.Types.IamUser
import Amazonka.MacieV2.Types.UserIdentityRoot
import Amazonka.MacieV2.Types.UserIdentityType
import qualified Amazonka.Prelude as Prelude
data UserIdentity = UserIdentity'
{
UserIdentity -> Maybe IamUser
iamUser :: Prelude.Maybe IamUser,
UserIdentity -> Maybe UserIdentityRoot
root :: Prelude.Maybe UserIdentityRoot,
UserIdentity -> Maybe AwsAccount
awsAccount :: Prelude.Maybe AwsAccount,
UserIdentity -> Maybe AssumedRole
assumedRole :: Prelude.Maybe AssumedRole,
UserIdentity -> Maybe FederatedUser
federatedUser :: Prelude.Maybe FederatedUser,
UserIdentity -> Maybe AwsService
awsService :: Prelude.Maybe AwsService,
UserIdentity -> Maybe UserIdentityType
type' :: Prelude.Maybe UserIdentityType
}
deriving (UserIdentity -> UserIdentity -> Bool
(UserIdentity -> UserIdentity -> Bool)
-> (UserIdentity -> UserIdentity -> Bool) -> Eq UserIdentity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserIdentity -> UserIdentity -> Bool
$c/= :: UserIdentity -> UserIdentity -> Bool
== :: UserIdentity -> UserIdentity -> Bool
$c== :: UserIdentity -> UserIdentity -> Bool
Prelude.Eq, ReadPrec [UserIdentity]
ReadPrec UserIdentity
Int -> ReadS UserIdentity
ReadS [UserIdentity]
(Int -> ReadS UserIdentity)
-> ReadS [UserIdentity]
-> ReadPrec UserIdentity
-> ReadPrec [UserIdentity]
-> Read UserIdentity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserIdentity]
$creadListPrec :: ReadPrec [UserIdentity]
readPrec :: ReadPrec UserIdentity
$creadPrec :: ReadPrec UserIdentity
readList :: ReadS [UserIdentity]
$creadList :: ReadS [UserIdentity]
readsPrec :: Int -> ReadS UserIdentity
$creadsPrec :: Int -> ReadS UserIdentity
Prelude.Read, Int -> UserIdentity -> ShowS
[UserIdentity] -> ShowS
UserIdentity -> String
(Int -> UserIdentity -> ShowS)
-> (UserIdentity -> String)
-> ([UserIdentity] -> ShowS)
-> Show UserIdentity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserIdentity] -> ShowS
$cshowList :: [UserIdentity] -> ShowS
show :: UserIdentity -> String
$cshow :: UserIdentity -> String
showsPrec :: Int -> UserIdentity -> ShowS
$cshowsPrec :: Int -> UserIdentity -> ShowS
Prelude.Show, (forall x. UserIdentity -> Rep UserIdentity x)
-> (forall x. Rep UserIdentity x -> UserIdentity)
-> Generic UserIdentity
forall x. Rep UserIdentity x -> UserIdentity
forall x. UserIdentity -> Rep UserIdentity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserIdentity x -> UserIdentity
$cfrom :: forall x. UserIdentity -> Rep UserIdentity x
Prelude.Generic)
newUserIdentity ::
UserIdentity
newUserIdentity :: UserIdentity
newUserIdentity =
UserIdentity' :: Maybe IamUser
-> Maybe UserIdentityRoot
-> Maybe AwsAccount
-> Maybe AssumedRole
-> Maybe FederatedUser
-> Maybe AwsService
-> Maybe UserIdentityType
-> UserIdentity
UserIdentity'
{ $sel:iamUser:UserIdentity' :: Maybe IamUser
iamUser = Maybe IamUser
forall a. Maybe a
Prelude.Nothing,
$sel:root:UserIdentity' :: Maybe UserIdentityRoot
root = Maybe UserIdentityRoot
forall a. Maybe a
Prelude.Nothing,
$sel:awsAccount:UserIdentity' :: Maybe AwsAccount
awsAccount = Maybe AwsAccount
forall a. Maybe a
Prelude.Nothing,
$sel:assumedRole:UserIdentity' :: Maybe AssumedRole
assumedRole = Maybe AssumedRole
forall a. Maybe a
Prelude.Nothing,
$sel:federatedUser:UserIdentity' :: Maybe FederatedUser
federatedUser = Maybe FederatedUser
forall a. Maybe a
Prelude.Nothing,
$sel:awsService:UserIdentity' :: Maybe AwsService
awsService = Maybe AwsService
forall a. Maybe a
Prelude.Nothing,
$sel:type':UserIdentity' :: Maybe UserIdentityType
type' = Maybe UserIdentityType
forall a. Maybe a
Prelude.Nothing
}
userIdentity_iamUser :: Lens.Lens' UserIdentity (Prelude.Maybe IamUser)
userIdentity_iamUser :: (Maybe IamUser -> f (Maybe IamUser))
-> UserIdentity -> f UserIdentity
userIdentity_iamUser = (UserIdentity -> Maybe IamUser)
-> (UserIdentity -> Maybe IamUser -> UserIdentity)
-> Lens UserIdentity UserIdentity (Maybe IamUser) (Maybe IamUser)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentity' {Maybe IamUser
iamUser :: Maybe IamUser
$sel:iamUser:UserIdentity' :: UserIdentity -> Maybe IamUser
iamUser} -> Maybe IamUser
iamUser) (\s :: UserIdentity
s@UserIdentity' {} Maybe IamUser
a -> UserIdentity
s {$sel:iamUser:UserIdentity' :: Maybe IamUser
iamUser = Maybe IamUser
a} :: UserIdentity)
userIdentity_root :: Lens.Lens' UserIdentity (Prelude.Maybe UserIdentityRoot)
userIdentity_root :: (Maybe UserIdentityRoot -> f (Maybe UserIdentityRoot))
-> UserIdentity -> f UserIdentity
userIdentity_root = (UserIdentity -> Maybe UserIdentityRoot)
-> (UserIdentity -> Maybe UserIdentityRoot -> UserIdentity)
-> Lens
UserIdentity
UserIdentity
(Maybe UserIdentityRoot)
(Maybe UserIdentityRoot)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentity' {Maybe UserIdentityRoot
root :: Maybe UserIdentityRoot
$sel:root:UserIdentity' :: UserIdentity -> Maybe UserIdentityRoot
root} -> Maybe UserIdentityRoot
root) (\s :: UserIdentity
s@UserIdentity' {} Maybe UserIdentityRoot
a -> UserIdentity
s {$sel:root:UserIdentity' :: Maybe UserIdentityRoot
root = Maybe UserIdentityRoot
a} :: UserIdentity)
userIdentity_awsAccount :: Lens.Lens' UserIdentity (Prelude.Maybe AwsAccount)
userIdentity_awsAccount :: (Maybe AwsAccount -> f (Maybe AwsAccount))
-> UserIdentity -> f UserIdentity
userIdentity_awsAccount = (UserIdentity -> Maybe AwsAccount)
-> (UserIdentity -> Maybe AwsAccount -> UserIdentity)
-> Lens
UserIdentity UserIdentity (Maybe AwsAccount) (Maybe AwsAccount)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentity' {Maybe AwsAccount
awsAccount :: Maybe AwsAccount
$sel:awsAccount:UserIdentity' :: UserIdentity -> Maybe AwsAccount
awsAccount} -> Maybe AwsAccount
awsAccount) (\s :: UserIdentity
s@UserIdentity' {} Maybe AwsAccount
a -> UserIdentity
s {$sel:awsAccount:UserIdentity' :: Maybe AwsAccount
awsAccount = Maybe AwsAccount
a} :: UserIdentity)
userIdentity_assumedRole :: Lens.Lens' UserIdentity (Prelude.Maybe AssumedRole)
userIdentity_assumedRole :: (Maybe AssumedRole -> f (Maybe AssumedRole))
-> UserIdentity -> f UserIdentity
userIdentity_assumedRole = (UserIdentity -> Maybe AssumedRole)
-> (UserIdentity -> Maybe AssumedRole -> UserIdentity)
-> Lens
UserIdentity UserIdentity (Maybe AssumedRole) (Maybe AssumedRole)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentity' {Maybe AssumedRole
assumedRole :: Maybe AssumedRole
$sel:assumedRole:UserIdentity' :: UserIdentity -> Maybe AssumedRole
assumedRole} -> Maybe AssumedRole
assumedRole) (\s :: UserIdentity
s@UserIdentity' {} Maybe AssumedRole
a -> UserIdentity
s {$sel:assumedRole:UserIdentity' :: Maybe AssumedRole
assumedRole = Maybe AssumedRole
a} :: UserIdentity)
userIdentity_federatedUser :: Lens.Lens' UserIdentity (Prelude.Maybe FederatedUser)
userIdentity_federatedUser :: (Maybe FederatedUser -> f (Maybe FederatedUser))
-> UserIdentity -> f UserIdentity
userIdentity_federatedUser = (UserIdentity -> Maybe FederatedUser)
-> (UserIdentity -> Maybe FederatedUser -> UserIdentity)
-> Lens
UserIdentity
UserIdentity
(Maybe FederatedUser)
(Maybe FederatedUser)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentity' {Maybe FederatedUser
federatedUser :: Maybe FederatedUser
$sel:federatedUser:UserIdentity' :: UserIdentity -> Maybe FederatedUser
federatedUser} -> Maybe FederatedUser
federatedUser) (\s :: UserIdentity
s@UserIdentity' {} Maybe FederatedUser
a -> UserIdentity
s {$sel:federatedUser:UserIdentity' :: Maybe FederatedUser
federatedUser = Maybe FederatedUser
a} :: UserIdentity)
userIdentity_awsService :: Lens.Lens' UserIdentity (Prelude.Maybe AwsService)
userIdentity_awsService :: (Maybe AwsService -> f (Maybe AwsService))
-> UserIdentity -> f UserIdentity
userIdentity_awsService = (UserIdentity -> Maybe AwsService)
-> (UserIdentity -> Maybe AwsService -> UserIdentity)
-> Lens
UserIdentity UserIdentity (Maybe AwsService) (Maybe AwsService)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentity' {Maybe AwsService
awsService :: Maybe AwsService
$sel:awsService:UserIdentity' :: UserIdentity -> Maybe AwsService
awsService} -> Maybe AwsService
awsService) (\s :: UserIdentity
s@UserIdentity' {} Maybe AwsService
a -> UserIdentity
s {$sel:awsService:UserIdentity' :: Maybe AwsService
awsService = Maybe AwsService
a} :: UserIdentity)
userIdentity_type :: Lens.Lens' UserIdentity (Prelude.Maybe UserIdentityType)
userIdentity_type :: (Maybe UserIdentityType -> f (Maybe UserIdentityType))
-> UserIdentity -> f UserIdentity
userIdentity_type = (UserIdentity -> Maybe UserIdentityType)
-> (UserIdentity -> Maybe UserIdentityType -> UserIdentity)
-> Lens
UserIdentity
UserIdentity
(Maybe UserIdentityType)
(Maybe UserIdentityType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentity' {Maybe UserIdentityType
type' :: Maybe UserIdentityType
$sel:type':UserIdentity' :: UserIdentity -> Maybe UserIdentityType
type'} -> Maybe UserIdentityType
type') (\s :: UserIdentity
s@UserIdentity' {} Maybe UserIdentityType
a -> UserIdentity
s {$sel:type':UserIdentity' :: Maybe UserIdentityType
type' = Maybe UserIdentityType
a} :: UserIdentity)
instance Core.FromJSON UserIdentity where
parseJSON :: Value -> Parser UserIdentity
parseJSON =
String
-> (Object -> Parser UserIdentity) -> Value -> Parser UserIdentity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UserIdentity"
( \Object
x ->
Maybe IamUser
-> Maybe UserIdentityRoot
-> Maybe AwsAccount
-> Maybe AssumedRole
-> Maybe FederatedUser
-> Maybe AwsService
-> Maybe UserIdentityType
-> UserIdentity
UserIdentity'
(Maybe IamUser
-> Maybe UserIdentityRoot
-> Maybe AwsAccount
-> Maybe AssumedRole
-> Maybe FederatedUser
-> Maybe AwsService
-> Maybe UserIdentityType
-> UserIdentity)
-> Parser (Maybe IamUser)
-> Parser
(Maybe UserIdentityRoot
-> Maybe AwsAccount
-> Maybe AssumedRole
-> Maybe FederatedUser
-> Maybe AwsService
-> Maybe UserIdentityType
-> UserIdentity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe IamUser)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"iamUser")
Parser
(Maybe UserIdentityRoot
-> Maybe AwsAccount
-> Maybe AssumedRole
-> Maybe FederatedUser
-> Maybe AwsService
-> Maybe UserIdentityType
-> UserIdentity)
-> Parser (Maybe UserIdentityRoot)
-> Parser
(Maybe AwsAccount
-> Maybe AssumedRole
-> Maybe FederatedUser
-> Maybe AwsService
-> Maybe UserIdentityType
-> UserIdentity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UserIdentityRoot)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"root")
Parser
(Maybe AwsAccount
-> Maybe AssumedRole
-> Maybe FederatedUser
-> Maybe AwsService
-> Maybe UserIdentityType
-> UserIdentity)
-> Parser (Maybe AwsAccount)
-> Parser
(Maybe AssumedRole
-> Maybe FederatedUser
-> Maybe AwsService
-> Maybe UserIdentityType
-> UserIdentity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AwsAccount)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"awsAccount")
Parser
(Maybe AssumedRole
-> Maybe FederatedUser
-> Maybe AwsService
-> Maybe UserIdentityType
-> UserIdentity)
-> Parser (Maybe AssumedRole)
-> Parser
(Maybe FederatedUser
-> Maybe AwsService -> Maybe UserIdentityType -> UserIdentity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AssumedRole)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"assumedRole")
Parser
(Maybe FederatedUser
-> Maybe AwsService -> Maybe UserIdentityType -> UserIdentity)
-> Parser (Maybe FederatedUser)
-> Parser
(Maybe AwsService -> Maybe UserIdentityType -> UserIdentity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FederatedUser)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"federatedUser")
Parser (Maybe AwsService -> Maybe UserIdentityType -> UserIdentity)
-> Parser (Maybe AwsService)
-> Parser (Maybe UserIdentityType -> UserIdentity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AwsService)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"awsService")
Parser (Maybe UserIdentityType -> UserIdentity)
-> Parser (Maybe UserIdentityType) -> Parser UserIdentity
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UserIdentityType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
)
instance Prelude.Hashable UserIdentity
instance Prelude.NFData UserIdentity