{-# 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.FederatedUser where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types.SessionContext
import qualified Amazonka.Prelude as Prelude
data FederatedUser = FederatedUser'
{
FederatedUser -> Maybe Text
principalId :: Prelude.Maybe Prelude.Text,
FederatedUser -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
FederatedUser -> Maybe SessionContext
sessionContext :: Prelude.Maybe SessionContext,
FederatedUser -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
FederatedUser -> Maybe Text
accessKeyId :: Prelude.Maybe Prelude.Text
}
deriving (FederatedUser -> FederatedUser -> Bool
(FederatedUser -> FederatedUser -> Bool)
-> (FederatedUser -> FederatedUser -> Bool) -> Eq FederatedUser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FederatedUser -> FederatedUser -> Bool
$c/= :: FederatedUser -> FederatedUser -> Bool
== :: FederatedUser -> FederatedUser -> Bool
$c== :: FederatedUser -> FederatedUser -> Bool
Prelude.Eq, ReadPrec [FederatedUser]
ReadPrec FederatedUser
Int -> ReadS FederatedUser
ReadS [FederatedUser]
(Int -> ReadS FederatedUser)
-> ReadS [FederatedUser]
-> ReadPrec FederatedUser
-> ReadPrec [FederatedUser]
-> Read FederatedUser
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FederatedUser]
$creadListPrec :: ReadPrec [FederatedUser]
readPrec :: ReadPrec FederatedUser
$creadPrec :: ReadPrec FederatedUser
readList :: ReadS [FederatedUser]
$creadList :: ReadS [FederatedUser]
readsPrec :: Int -> ReadS FederatedUser
$creadsPrec :: Int -> ReadS FederatedUser
Prelude.Read, Int -> FederatedUser -> ShowS
[FederatedUser] -> ShowS
FederatedUser -> String
(Int -> FederatedUser -> ShowS)
-> (FederatedUser -> String)
-> ([FederatedUser] -> ShowS)
-> Show FederatedUser
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FederatedUser] -> ShowS
$cshowList :: [FederatedUser] -> ShowS
show :: FederatedUser -> String
$cshow :: FederatedUser -> String
showsPrec :: Int -> FederatedUser -> ShowS
$cshowsPrec :: Int -> FederatedUser -> ShowS
Prelude.Show, (forall x. FederatedUser -> Rep FederatedUser x)
-> (forall x. Rep FederatedUser x -> FederatedUser)
-> Generic FederatedUser
forall x. Rep FederatedUser x -> FederatedUser
forall x. FederatedUser -> Rep FederatedUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FederatedUser x -> FederatedUser
$cfrom :: forall x. FederatedUser -> Rep FederatedUser x
Prelude.Generic)
newFederatedUser ::
FederatedUser
newFederatedUser :: FederatedUser
newFederatedUser =
FederatedUser' :: Maybe Text
-> Maybe Text
-> Maybe SessionContext
-> Maybe Text
-> Maybe Text
-> FederatedUser
FederatedUser'
{ $sel:principalId:FederatedUser' :: Maybe Text
principalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:FederatedUser' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sessionContext:FederatedUser' :: Maybe SessionContext
sessionContext = Maybe SessionContext
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:FederatedUser' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accessKeyId:FederatedUser' :: Maybe Text
accessKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
federatedUser_principalId :: Lens.Lens' FederatedUser (Prelude.Maybe Prelude.Text)
federatedUser_principalId :: (Maybe Text -> f (Maybe Text)) -> FederatedUser -> f FederatedUser
federatedUser_principalId = (FederatedUser -> Maybe Text)
-> (FederatedUser -> Maybe Text -> FederatedUser)
-> Lens FederatedUser FederatedUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FederatedUser' {Maybe Text
principalId :: Maybe Text
$sel:principalId:FederatedUser' :: FederatedUser -> Maybe Text
principalId} -> Maybe Text
principalId) (\s :: FederatedUser
s@FederatedUser' {} Maybe Text
a -> FederatedUser
s {$sel:principalId:FederatedUser' :: Maybe Text
principalId = Maybe Text
a} :: FederatedUser)
federatedUser_arn :: Lens.Lens' FederatedUser (Prelude.Maybe Prelude.Text)
federatedUser_arn :: (Maybe Text -> f (Maybe Text)) -> FederatedUser -> f FederatedUser
federatedUser_arn = (FederatedUser -> Maybe Text)
-> (FederatedUser -> Maybe Text -> FederatedUser)
-> Lens FederatedUser FederatedUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FederatedUser' {Maybe Text
arn :: Maybe Text
$sel:arn:FederatedUser' :: FederatedUser -> Maybe Text
arn} -> Maybe Text
arn) (\s :: FederatedUser
s@FederatedUser' {} Maybe Text
a -> FederatedUser
s {$sel:arn:FederatedUser' :: Maybe Text
arn = Maybe Text
a} :: FederatedUser)
federatedUser_sessionContext :: Lens.Lens' FederatedUser (Prelude.Maybe SessionContext)
federatedUser_sessionContext :: (Maybe SessionContext -> f (Maybe SessionContext))
-> FederatedUser -> f FederatedUser
federatedUser_sessionContext = (FederatedUser -> Maybe SessionContext)
-> (FederatedUser -> Maybe SessionContext -> FederatedUser)
-> Lens
FederatedUser
FederatedUser
(Maybe SessionContext)
(Maybe SessionContext)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FederatedUser' {Maybe SessionContext
sessionContext :: Maybe SessionContext
$sel:sessionContext:FederatedUser' :: FederatedUser -> Maybe SessionContext
sessionContext} -> Maybe SessionContext
sessionContext) (\s :: FederatedUser
s@FederatedUser' {} Maybe SessionContext
a -> FederatedUser
s {$sel:sessionContext:FederatedUser' :: Maybe SessionContext
sessionContext = Maybe SessionContext
a} :: FederatedUser)
federatedUser_accountId :: Lens.Lens' FederatedUser (Prelude.Maybe Prelude.Text)
federatedUser_accountId :: (Maybe Text -> f (Maybe Text)) -> FederatedUser -> f FederatedUser
federatedUser_accountId = (FederatedUser -> Maybe Text)
-> (FederatedUser -> Maybe Text -> FederatedUser)
-> Lens FederatedUser FederatedUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FederatedUser' {Maybe Text
accountId :: Maybe Text
$sel:accountId:FederatedUser' :: FederatedUser -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: FederatedUser
s@FederatedUser' {} Maybe Text
a -> FederatedUser
s {$sel:accountId:FederatedUser' :: Maybe Text
accountId = Maybe Text
a} :: FederatedUser)
federatedUser_accessKeyId :: Lens.Lens' FederatedUser (Prelude.Maybe Prelude.Text)
federatedUser_accessKeyId :: (Maybe Text -> f (Maybe Text)) -> FederatedUser -> f FederatedUser
federatedUser_accessKeyId = (FederatedUser -> Maybe Text)
-> (FederatedUser -> Maybe Text -> FederatedUser)
-> Lens FederatedUser FederatedUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FederatedUser' {Maybe Text
accessKeyId :: Maybe Text
$sel:accessKeyId:FederatedUser' :: FederatedUser -> Maybe Text
accessKeyId} -> Maybe Text
accessKeyId) (\s :: FederatedUser
s@FederatedUser' {} Maybe Text
a -> FederatedUser
s {$sel:accessKeyId:FederatedUser' :: Maybe Text
accessKeyId = Maybe Text
a} :: FederatedUser)
instance Core.FromJSON FederatedUser where
parseJSON :: Value -> Parser FederatedUser
parseJSON =
String
-> (Object -> Parser FederatedUser)
-> Value
-> Parser FederatedUser
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FederatedUser"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe SessionContext
-> Maybe Text
-> Maybe Text
-> FederatedUser
FederatedUser'
(Maybe Text
-> Maybe Text
-> Maybe SessionContext
-> Maybe Text
-> Maybe Text
-> FederatedUser)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe SessionContext
-> Maybe Text
-> Maybe Text
-> FederatedUser)
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 SessionContext
-> Maybe Text
-> Maybe Text
-> FederatedUser)
-> Parser (Maybe Text)
-> Parser
(Maybe SessionContext -> Maybe Text -> Maybe Text -> FederatedUser)
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 SessionContext -> Maybe Text -> Maybe Text -> FederatedUser)
-> Parser (Maybe SessionContext)
-> Parser (Maybe Text -> Maybe Text -> FederatedUser)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SessionContext)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sessionContext")
Parser (Maybe Text -> Maybe Text -> FederatedUser)
-> Parser (Maybe Text) -> Parser (Maybe Text -> FederatedUser)
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")
Parser (Maybe Text -> FederatedUser)
-> Parser (Maybe Text) -> Parser FederatedUser
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
"accessKeyId")
)
instance Prelude.Hashable FederatedUser
instance Prelude.NFData FederatedUser