{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data RoleLastUsed = RoleLastUsed'
{
RoleLastUsed -> Maybe ISO8601
lastUsedDate :: Prelude.Maybe Data.ISO8601,
RoleLastUsed -> Maybe Text
region :: Prelude.Maybe Prelude.Text
}
deriving (RoleLastUsed -> RoleLastUsed -> Bool
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]
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
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. 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'
{ $sel:lastUsedDate:RoleLastUsed' :: Maybe ISO8601
lastUsedDate = forall a. Maybe a
Prelude.Nothing,
$sel:region:RoleLastUsed' :: Maybe Text
region = forall a. Maybe a
Prelude.Nothing
}
roleLastUsed_lastUsedDate :: Lens.Lens' RoleLastUsed (Prelude.Maybe Prelude.UTCTime)
roleLastUsed_lastUsedDate :: Lens' RoleLastUsed (Maybe UTCTime)
roleLastUsed_lastUsedDate = 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) 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
roleLastUsed_region :: Lens.Lens' RoleLastUsed (Prelude.Maybe Prelude.Text)
roleLastUsed_region :: Lens' RoleLastUsed (Maybe Text)
roleLastUsed_region = 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 Data.FromXML RoleLastUsed where
parseXML :: [Node] -> Either String RoleLastUsed
parseXML [Node]
x =
Maybe ISO8601 -> Maybe Text -> RoleLastUsed
RoleLastUsed'
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
"LastUsedDate")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Region")
instance Prelude.Hashable RoleLastUsed where
hashWithSalt :: Int -> RoleLastUsed -> Int
hashWithSalt Int
_salt RoleLastUsed' {Maybe Text
Maybe ISO8601
region :: Maybe Text
lastUsedDate :: Maybe ISO8601
$sel:region:RoleLastUsed' :: RoleLastUsed -> Maybe Text
$sel:lastUsedDate:RoleLastUsed' :: RoleLastUsed -> Maybe ISO8601
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
lastUsedDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
region
instance Prelude.NFData RoleLastUsed where
rnf :: RoleLastUsed -> ()
rnf RoleLastUsed' {Maybe Text
Maybe ISO8601
region :: Maybe Text
lastUsedDate :: Maybe ISO8601
$sel:region:RoleLastUsed' :: RoleLastUsed -> Maybe Text
$sel:lastUsedDate:RoleLastUsed' :: RoleLastUsed -> Maybe ISO8601
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
lastUsedDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
region