{-# 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.RoleLastUsed where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RoleLastUsed = RoleLastUsed'
{
RoleLastUsed -> Maybe ISO8601
lastUsedDate :: Prelude.Maybe Core.ISO8601,
RoleLastUsed -> Maybe Text
region :: Prelude.Maybe Prelude.Text
}
deriving (RoleLastUsed -> RoleLastUsed -> Bool
(RoleLastUsed -> RoleLastUsed -> Bool)
-> (RoleLastUsed -> RoleLastUsed -> Bool) -> Eq RoleLastUsed
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RoleLastUsed -> RoleLastUsed -> Bool
$c/= :: RoleLastUsed -> RoleLastUsed -> Bool
== :: RoleLastUsed -> RoleLastUsed -> Bool
$c== :: RoleLastUsed -> RoleLastUsed -> Bool
Prelude.Eq, ReadPrec [RoleLastUsed]
ReadPrec RoleLastUsed
Int -> ReadS RoleLastUsed
ReadS [RoleLastUsed]
(Int -> ReadS RoleLastUsed)
-> ReadS [RoleLastUsed]
-> ReadPrec RoleLastUsed
-> ReadPrec [RoleLastUsed]
-> Read RoleLastUsed
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RoleLastUsed]
$creadListPrec :: ReadPrec [RoleLastUsed]
readPrec :: ReadPrec RoleLastUsed
$creadPrec :: ReadPrec RoleLastUsed
readList :: ReadS [RoleLastUsed]
$creadList :: ReadS [RoleLastUsed]
readsPrec :: Int -> ReadS RoleLastUsed
$creadsPrec :: Int -> ReadS RoleLastUsed
Prelude.Read, Int -> RoleLastUsed -> ShowS
[RoleLastUsed] -> ShowS
RoleLastUsed -> String
(Int -> RoleLastUsed -> ShowS)
-> (RoleLastUsed -> String)
-> ([RoleLastUsed] -> ShowS)
-> Show RoleLastUsed
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RoleLastUsed] -> ShowS
$cshowList :: [RoleLastUsed] -> ShowS
show :: RoleLastUsed -> String
$cshow :: RoleLastUsed -> String
showsPrec :: Int -> RoleLastUsed -> ShowS
$cshowsPrec :: Int -> RoleLastUsed -> ShowS
Prelude.Show, (forall x. RoleLastUsed -> Rep RoleLastUsed x)
-> (forall x. Rep RoleLastUsed x -> RoleLastUsed)
-> Generic RoleLastUsed
forall x. Rep RoleLastUsed x -> RoleLastUsed
forall x. RoleLastUsed -> Rep RoleLastUsed x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RoleLastUsed x -> RoleLastUsed
$cfrom :: forall x. RoleLastUsed -> Rep RoleLastUsed x
Prelude.Generic)
newRoleLastUsed ::
RoleLastUsed
newRoleLastUsed :: RoleLastUsed
newRoleLastUsed =
RoleLastUsed' :: Maybe ISO8601 -> Maybe Text -> RoleLastUsed
RoleLastUsed'
{ $sel:lastUsedDate:RoleLastUsed' :: Maybe ISO8601
lastUsedDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:region:RoleLastUsed' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
roleLastUsed_lastUsedDate :: Lens.Lens' RoleLastUsed (Prelude.Maybe Prelude.UTCTime)
roleLastUsed_lastUsedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> RoleLastUsed -> f RoleLastUsed
roleLastUsed_lastUsedDate = (RoleLastUsed -> Maybe ISO8601)
-> (RoleLastUsed -> Maybe ISO8601 -> RoleLastUsed)
-> Lens RoleLastUsed RoleLastUsed (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleLastUsed' {Maybe ISO8601
lastUsedDate :: Maybe ISO8601
$sel:lastUsedDate:RoleLastUsed' :: RoleLastUsed -> Maybe ISO8601
lastUsedDate} -> Maybe ISO8601
lastUsedDate) (\s :: RoleLastUsed
s@RoleLastUsed' {} Maybe ISO8601
a -> RoleLastUsed
s {$sel:lastUsedDate:RoleLastUsed' :: Maybe ISO8601
lastUsedDate = Maybe ISO8601
a} :: RoleLastUsed) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> RoleLastUsed -> f RoleLastUsed)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> RoleLastUsed
-> f RoleLastUsed
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
roleLastUsed_region :: Lens.Lens' RoleLastUsed (Prelude.Maybe Prelude.Text)
roleLastUsed_region :: (Maybe Text -> f (Maybe Text)) -> RoleLastUsed -> f RoleLastUsed
roleLastUsed_region = (RoleLastUsed -> Maybe Text)
-> (RoleLastUsed -> Maybe Text -> RoleLastUsed)
-> Lens RoleLastUsed RoleLastUsed (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleLastUsed' {Maybe Text
region :: Maybe Text
$sel:region:RoleLastUsed' :: RoleLastUsed -> Maybe Text
region} -> Maybe Text
region) (\s :: RoleLastUsed
s@RoleLastUsed' {} Maybe Text
a -> RoleLastUsed
s {$sel:region:RoleLastUsed' :: Maybe Text
region = Maybe Text
a} :: RoleLastUsed)
instance Core.FromXML RoleLastUsed where
parseXML :: [Node] -> Either String RoleLastUsed
parseXML [Node]
x =
Maybe ISO8601 -> Maybe Text -> RoleLastUsed
RoleLastUsed'
(Maybe ISO8601 -> Maybe Text -> RoleLastUsed)
-> Either String (Maybe ISO8601)
-> Either String (Maybe Text -> RoleLastUsed)
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
"LastUsedDate")
Either String (Maybe Text -> RoleLastUsed)
-> Either String (Maybe Text) -> Either String RoleLastUsed
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Region")
instance Prelude.Hashable RoleLastUsed
instance Prelude.NFData RoleLastUsed