{-# 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.IAM.Types.EntityDetails where
import qualified Amazonka.Core as Core
import Amazonka.IAM.Types.EntityInfo
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EntityDetails = EntityDetails'
{
EntityDetails -> Maybe ISO8601
lastAuthenticated :: Prelude.Maybe Core.ISO8601,
EntityDetails -> EntityInfo
entityInfo :: EntityInfo
}
deriving (EntityDetails -> EntityDetails -> Bool
(EntityDetails -> EntityDetails -> Bool)
-> (EntityDetails -> EntityDetails -> Bool) -> Eq EntityDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EntityDetails -> EntityDetails -> Bool
$c/= :: EntityDetails -> EntityDetails -> Bool
== :: EntityDetails -> EntityDetails -> Bool
$c== :: EntityDetails -> EntityDetails -> Bool
Prelude.Eq, ReadPrec [EntityDetails]
ReadPrec EntityDetails
Int -> ReadS EntityDetails
ReadS [EntityDetails]
(Int -> ReadS EntityDetails)
-> ReadS [EntityDetails]
-> ReadPrec EntityDetails
-> ReadPrec [EntityDetails]
-> Read EntityDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EntityDetails]
$creadListPrec :: ReadPrec [EntityDetails]
readPrec :: ReadPrec EntityDetails
$creadPrec :: ReadPrec EntityDetails
readList :: ReadS [EntityDetails]
$creadList :: ReadS [EntityDetails]
readsPrec :: Int -> ReadS EntityDetails
$creadsPrec :: Int -> ReadS EntityDetails
Prelude.Read, Int -> EntityDetails -> ShowS
[EntityDetails] -> ShowS
EntityDetails -> String
(Int -> EntityDetails -> ShowS)
-> (EntityDetails -> String)
-> ([EntityDetails] -> ShowS)
-> Show EntityDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EntityDetails] -> ShowS
$cshowList :: [EntityDetails] -> ShowS
show :: EntityDetails -> String
$cshow :: EntityDetails -> String
showsPrec :: Int -> EntityDetails -> ShowS
$cshowsPrec :: Int -> EntityDetails -> ShowS
Prelude.Show, (forall x. EntityDetails -> Rep EntityDetails x)
-> (forall x. Rep EntityDetails x -> EntityDetails)
-> Generic EntityDetails
forall x. Rep EntityDetails x -> EntityDetails
forall x. EntityDetails -> Rep EntityDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EntityDetails x -> EntityDetails
$cfrom :: forall x. EntityDetails -> Rep EntityDetails x
Prelude.Generic)
newEntityDetails ::
EntityInfo ->
EntityDetails
newEntityDetails :: EntityInfo -> EntityDetails
newEntityDetails EntityInfo
pEntityInfo_ =
EntityDetails' :: Maybe ISO8601 -> EntityInfo -> EntityDetails
EntityDetails'
{ $sel:lastAuthenticated:EntityDetails' :: Maybe ISO8601
lastAuthenticated = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:entityInfo:EntityDetails' :: EntityInfo
entityInfo = EntityInfo
pEntityInfo_
}
entityDetails_lastAuthenticated :: Lens.Lens' EntityDetails (Prelude.Maybe Prelude.UTCTime)
entityDetails_lastAuthenticated :: (Maybe UTCTime -> f (Maybe UTCTime))
-> EntityDetails -> f EntityDetails
entityDetails_lastAuthenticated = (EntityDetails -> Maybe ISO8601)
-> (EntityDetails -> Maybe ISO8601 -> EntityDetails)
-> Lens EntityDetails EntityDetails (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityDetails' {Maybe ISO8601
lastAuthenticated :: Maybe ISO8601
$sel:lastAuthenticated:EntityDetails' :: EntityDetails -> Maybe ISO8601
lastAuthenticated} -> Maybe ISO8601
lastAuthenticated) (\s :: EntityDetails
s@EntityDetails' {} Maybe ISO8601
a -> EntityDetails
s {$sel:lastAuthenticated:EntityDetails' :: Maybe ISO8601
lastAuthenticated = Maybe ISO8601
a} :: EntityDetails) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> EntityDetails -> f EntityDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> EntityDetails
-> f EntityDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
(Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
entityDetails_entityInfo :: Lens.Lens' EntityDetails EntityInfo
entityDetails_entityInfo :: (EntityInfo -> f EntityInfo) -> EntityDetails -> f EntityDetails
entityDetails_entityInfo = (EntityDetails -> EntityInfo)
-> (EntityDetails -> EntityInfo -> EntityDetails)
-> Lens EntityDetails EntityDetails EntityInfo EntityInfo
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityDetails' {EntityInfo
entityInfo :: EntityInfo
$sel:entityInfo:EntityDetails' :: EntityDetails -> EntityInfo
entityInfo} -> EntityInfo
entityInfo) (\s :: EntityDetails
s@EntityDetails' {} EntityInfo
a -> EntityDetails
s {$sel:entityInfo:EntityDetails' :: EntityInfo
entityInfo = EntityInfo
a} :: EntityDetails)
instance Core.FromXML EntityDetails where
parseXML :: [Node] -> Either String EntityDetails
parseXML [Node]
x =
Maybe ISO8601 -> EntityInfo -> EntityDetails
EntityDetails'
(Maybe ISO8601 -> EntityInfo -> EntityDetails)
-> Either String (Maybe ISO8601)
-> Either String (EntityInfo -> EntityDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LastAuthenticated")
Either String (EntityInfo -> EntityDetails)
-> Either String EntityInfo -> Either String EntityDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String EntityInfo
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"EntityInfo")
instance Prelude.Hashable EntityDetails
instance Prelude.NFData EntityDetails