{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types.EntityInfo
import qualified Amazonka.Prelude as Prelude
data EntityDetails = EntityDetails'
{
EntityDetails -> Maybe ISO8601
lastAuthenticated :: Prelude.Maybe Data.ISO8601,
EntityDetails -> EntityInfo
entityInfo :: EntityInfo
}
deriving (EntityDetails -> EntityDetails -> Bool
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]
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
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. 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'
{ $sel:lastAuthenticated:EntityDetails' :: Maybe ISO8601
lastAuthenticated = forall a. Maybe a
Prelude.Nothing,
$sel:entityInfo:EntityDetails' :: EntityInfo
entityInfo = EntityInfo
pEntityInfo_
}
entityDetails_lastAuthenticated :: Lens.Lens' EntityDetails (Prelude.Maybe Prelude.UTCTime)
entityDetails_lastAuthenticated :: Lens' EntityDetails (Maybe UTCTime)
entityDetails_lastAuthenticated = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
entityDetails_entityInfo :: Lens.Lens' EntityDetails EntityInfo
entityDetails_entityInfo :: Lens' EntityDetails EntityInfo
entityDetails_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 Data.FromXML EntityDetails where
parseXML :: [Node] -> Either String EntityDetails
parseXML [Node]
x =
Maybe ISO8601 -> EntityInfo -> EntityDetails
EntityDetails'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"LastAuthenticated")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"EntityInfo")
instance Prelude.Hashable EntityDetails where
hashWithSalt :: Int -> EntityDetails -> Int
hashWithSalt Int
_salt EntityDetails' {Maybe ISO8601
EntityInfo
entityInfo :: EntityInfo
lastAuthenticated :: Maybe ISO8601
$sel:entityInfo:EntityDetails' :: EntityDetails -> EntityInfo
$sel:lastAuthenticated:EntityDetails' :: EntityDetails -> Maybe ISO8601
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
lastAuthenticated
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EntityInfo
entityInfo
instance Prelude.NFData EntityDetails where
rnf :: EntityDetails -> ()
rnf EntityDetails' {Maybe ISO8601
EntityInfo
entityInfo :: EntityInfo
lastAuthenticated :: Maybe ISO8601
$sel:entityInfo:EntityDetails' :: EntityDetails -> EntityInfo
$sel:lastAuthenticated:EntityDetails' :: EntityDetails -> Maybe ISO8601
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
lastAuthenticated
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EntityInfo
entityInfo