{-# 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.AccessKeyLastUsed where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AccessKeyLastUsed = AccessKeyLastUsed'
{
AccessKeyLastUsed -> ISO8601
lastUsedDate :: Core.ISO8601,
AccessKeyLastUsed -> Text
serviceName :: Prelude.Text,
AccessKeyLastUsed -> Text
region :: Prelude.Text
}
deriving (AccessKeyLastUsed -> AccessKeyLastUsed -> Bool
(AccessKeyLastUsed -> AccessKeyLastUsed -> Bool)
-> (AccessKeyLastUsed -> AccessKeyLastUsed -> Bool)
-> Eq AccessKeyLastUsed
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccessKeyLastUsed -> AccessKeyLastUsed -> Bool
$c/= :: AccessKeyLastUsed -> AccessKeyLastUsed -> Bool
== :: AccessKeyLastUsed -> AccessKeyLastUsed -> Bool
$c== :: AccessKeyLastUsed -> AccessKeyLastUsed -> Bool
Prelude.Eq, ReadPrec [AccessKeyLastUsed]
ReadPrec AccessKeyLastUsed
Int -> ReadS AccessKeyLastUsed
ReadS [AccessKeyLastUsed]
(Int -> ReadS AccessKeyLastUsed)
-> ReadS [AccessKeyLastUsed]
-> ReadPrec AccessKeyLastUsed
-> ReadPrec [AccessKeyLastUsed]
-> Read AccessKeyLastUsed
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccessKeyLastUsed]
$creadListPrec :: ReadPrec [AccessKeyLastUsed]
readPrec :: ReadPrec AccessKeyLastUsed
$creadPrec :: ReadPrec AccessKeyLastUsed
readList :: ReadS [AccessKeyLastUsed]
$creadList :: ReadS [AccessKeyLastUsed]
readsPrec :: Int -> ReadS AccessKeyLastUsed
$creadsPrec :: Int -> ReadS AccessKeyLastUsed
Prelude.Read, Int -> AccessKeyLastUsed -> ShowS
[AccessKeyLastUsed] -> ShowS
AccessKeyLastUsed -> String
(Int -> AccessKeyLastUsed -> ShowS)
-> (AccessKeyLastUsed -> String)
-> ([AccessKeyLastUsed] -> ShowS)
-> Show AccessKeyLastUsed
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccessKeyLastUsed] -> ShowS
$cshowList :: [AccessKeyLastUsed] -> ShowS
show :: AccessKeyLastUsed -> String
$cshow :: AccessKeyLastUsed -> String
showsPrec :: Int -> AccessKeyLastUsed -> ShowS
$cshowsPrec :: Int -> AccessKeyLastUsed -> ShowS
Prelude.Show, (forall x. AccessKeyLastUsed -> Rep AccessKeyLastUsed x)
-> (forall x. Rep AccessKeyLastUsed x -> AccessKeyLastUsed)
-> Generic AccessKeyLastUsed
forall x. Rep AccessKeyLastUsed x -> AccessKeyLastUsed
forall x. AccessKeyLastUsed -> Rep AccessKeyLastUsed x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccessKeyLastUsed x -> AccessKeyLastUsed
$cfrom :: forall x. AccessKeyLastUsed -> Rep AccessKeyLastUsed x
Prelude.Generic)
newAccessKeyLastUsed ::
Prelude.UTCTime ->
Prelude.Text ->
Prelude.Text ->
AccessKeyLastUsed
newAccessKeyLastUsed :: UTCTime -> Text -> Text -> AccessKeyLastUsed
newAccessKeyLastUsed
UTCTime
pLastUsedDate_
Text
pServiceName_
Text
pRegion_ =
AccessKeyLastUsed' :: ISO8601 -> Text -> Text -> AccessKeyLastUsed
AccessKeyLastUsed'
{ $sel:lastUsedDate:AccessKeyLastUsed' :: ISO8601
lastUsedDate =
Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastUsedDate_,
$sel:serviceName:AccessKeyLastUsed' :: Text
serviceName = Text
pServiceName_,
$sel:region:AccessKeyLastUsed' :: Text
region = Text
pRegion_
}
accessKeyLastUsed_lastUsedDate :: Lens.Lens' AccessKeyLastUsed Prelude.UTCTime
accessKeyLastUsed_lastUsedDate :: (UTCTime -> f UTCTime) -> AccessKeyLastUsed -> f AccessKeyLastUsed
accessKeyLastUsed_lastUsedDate = (AccessKeyLastUsed -> ISO8601)
-> (AccessKeyLastUsed -> ISO8601 -> AccessKeyLastUsed)
-> Lens AccessKeyLastUsed AccessKeyLastUsed ISO8601 ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessKeyLastUsed' {ISO8601
lastUsedDate :: ISO8601
$sel:lastUsedDate:AccessKeyLastUsed' :: AccessKeyLastUsed -> ISO8601
lastUsedDate} -> ISO8601
lastUsedDate) (\s :: AccessKeyLastUsed
s@AccessKeyLastUsed' {} ISO8601
a -> AccessKeyLastUsed
s {$sel:lastUsedDate:AccessKeyLastUsed' :: ISO8601
lastUsedDate = ISO8601
a} :: AccessKeyLastUsed) ((ISO8601 -> f ISO8601)
-> AccessKeyLastUsed -> f AccessKeyLastUsed)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> AccessKeyLastUsed
-> f AccessKeyLastUsed
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
accessKeyLastUsed_serviceName :: Lens.Lens' AccessKeyLastUsed Prelude.Text
accessKeyLastUsed_serviceName :: (Text -> f Text) -> AccessKeyLastUsed -> f AccessKeyLastUsed
accessKeyLastUsed_serviceName = (AccessKeyLastUsed -> Text)
-> (AccessKeyLastUsed -> Text -> AccessKeyLastUsed)
-> Lens AccessKeyLastUsed AccessKeyLastUsed Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessKeyLastUsed' {Text
serviceName :: Text
$sel:serviceName:AccessKeyLastUsed' :: AccessKeyLastUsed -> Text
serviceName} -> Text
serviceName) (\s :: AccessKeyLastUsed
s@AccessKeyLastUsed' {} Text
a -> AccessKeyLastUsed
s {$sel:serviceName:AccessKeyLastUsed' :: Text
serviceName = Text
a} :: AccessKeyLastUsed)
accessKeyLastUsed_region :: Lens.Lens' AccessKeyLastUsed Prelude.Text
accessKeyLastUsed_region :: (Text -> f Text) -> AccessKeyLastUsed -> f AccessKeyLastUsed
accessKeyLastUsed_region = (AccessKeyLastUsed -> Text)
-> (AccessKeyLastUsed -> Text -> AccessKeyLastUsed)
-> Lens AccessKeyLastUsed AccessKeyLastUsed Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessKeyLastUsed' {Text
region :: Text
$sel:region:AccessKeyLastUsed' :: AccessKeyLastUsed -> Text
region} -> Text
region) (\s :: AccessKeyLastUsed
s@AccessKeyLastUsed' {} Text
a -> AccessKeyLastUsed
s {$sel:region:AccessKeyLastUsed' :: Text
region = Text
a} :: AccessKeyLastUsed)
instance Core.FromXML AccessKeyLastUsed where
parseXML :: [Node] -> Either String AccessKeyLastUsed
parseXML [Node]
x =
ISO8601 -> Text -> Text -> AccessKeyLastUsed
AccessKeyLastUsed'
(ISO8601 -> Text -> Text -> AccessKeyLastUsed)
-> Either String ISO8601
-> Either String (Text -> Text -> AccessKeyLastUsed)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String ISO8601
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"LastUsedDate")
Either String (Text -> Text -> AccessKeyLastUsed)
-> Either String Text -> Either String (Text -> AccessKeyLastUsed)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"ServiceName")
Either String (Text -> AccessKeyLastUsed)
-> Either String Text -> Either String AccessKeyLastUsed
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Region")
instance Prelude.Hashable AccessKeyLastUsed
instance Prelude.NFData AccessKeyLastUsed