{-# 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.ServiceLastAccessed where
import qualified Amazonka.Core as Core
import Amazonka.IAM.Types.TrackedActionLastAccessed
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ServiceLastAccessed = ServiceLastAccessed'
{
ServiceLastAccessed -> Maybe ISO8601
lastAuthenticated :: Prelude.Maybe Core.ISO8601,
ServiceLastAccessed -> Maybe [TrackedActionLastAccessed]
trackedActionsLastAccessed :: Prelude.Maybe [TrackedActionLastAccessed],
ServiceLastAccessed -> Maybe Text
lastAuthenticatedEntity :: Prelude.Maybe Prelude.Text,
ServiceLastAccessed -> Maybe Text
lastAuthenticatedRegion :: Prelude.Maybe Prelude.Text,
ServiceLastAccessed -> Maybe Int
totalAuthenticatedEntities :: Prelude.Maybe Prelude.Int,
ServiceLastAccessed -> Text
serviceName :: Prelude.Text,
ServiceLastAccessed -> Text
serviceNamespace :: Prelude.Text
}
deriving (ServiceLastAccessed -> ServiceLastAccessed -> Bool
(ServiceLastAccessed -> ServiceLastAccessed -> Bool)
-> (ServiceLastAccessed -> ServiceLastAccessed -> Bool)
-> Eq ServiceLastAccessed
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceLastAccessed -> ServiceLastAccessed -> Bool
$c/= :: ServiceLastAccessed -> ServiceLastAccessed -> Bool
== :: ServiceLastAccessed -> ServiceLastAccessed -> Bool
$c== :: ServiceLastAccessed -> ServiceLastAccessed -> Bool
Prelude.Eq, ReadPrec [ServiceLastAccessed]
ReadPrec ServiceLastAccessed
Int -> ReadS ServiceLastAccessed
ReadS [ServiceLastAccessed]
(Int -> ReadS ServiceLastAccessed)
-> ReadS [ServiceLastAccessed]
-> ReadPrec ServiceLastAccessed
-> ReadPrec [ServiceLastAccessed]
-> Read ServiceLastAccessed
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceLastAccessed]
$creadListPrec :: ReadPrec [ServiceLastAccessed]
readPrec :: ReadPrec ServiceLastAccessed
$creadPrec :: ReadPrec ServiceLastAccessed
readList :: ReadS [ServiceLastAccessed]
$creadList :: ReadS [ServiceLastAccessed]
readsPrec :: Int -> ReadS ServiceLastAccessed
$creadsPrec :: Int -> ReadS ServiceLastAccessed
Prelude.Read, Int -> ServiceLastAccessed -> ShowS
[ServiceLastAccessed] -> ShowS
ServiceLastAccessed -> String
(Int -> ServiceLastAccessed -> ShowS)
-> (ServiceLastAccessed -> String)
-> ([ServiceLastAccessed] -> ShowS)
-> Show ServiceLastAccessed
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceLastAccessed] -> ShowS
$cshowList :: [ServiceLastAccessed] -> ShowS
show :: ServiceLastAccessed -> String
$cshow :: ServiceLastAccessed -> String
showsPrec :: Int -> ServiceLastAccessed -> ShowS
$cshowsPrec :: Int -> ServiceLastAccessed -> ShowS
Prelude.Show, (forall x. ServiceLastAccessed -> Rep ServiceLastAccessed x)
-> (forall x. Rep ServiceLastAccessed x -> ServiceLastAccessed)
-> Generic ServiceLastAccessed
forall x. Rep ServiceLastAccessed x -> ServiceLastAccessed
forall x. ServiceLastAccessed -> Rep ServiceLastAccessed x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceLastAccessed x -> ServiceLastAccessed
$cfrom :: forall x. ServiceLastAccessed -> Rep ServiceLastAccessed x
Prelude.Generic)
newServiceLastAccessed ::
Prelude.Text ->
Prelude.Text ->
ServiceLastAccessed
newServiceLastAccessed :: Text -> Text -> ServiceLastAccessed
newServiceLastAccessed
Text
pServiceName_
Text
pServiceNamespace_ =
ServiceLastAccessed' :: Maybe ISO8601
-> Maybe [TrackedActionLastAccessed]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Text
-> Text
-> ServiceLastAccessed
ServiceLastAccessed'
{ $sel:lastAuthenticated:ServiceLastAccessed' :: Maybe ISO8601
lastAuthenticated =
Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:trackedActionsLastAccessed:ServiceLastAccessed' :: Maybe [TrackedActionLastAccessed]
trackedActionsLastAccessed = Maybe [TrackedActionLastAccessed]
forall a. Maybe a
Prelude.Nothing,
$sel:lastAuthenticatedEntity:ServiceLastAccessed' :: Maybe Text
lastAuthenticatedEntity = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastAuthenticatedRegion:ServiceLastAccessed' :: Maybe Text
lastAuthenticatedRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:totalAuthenticatedEntities:ServiceLastAccessed' :: Maybe Int
totalAuthenticatedEntities = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:serviceName:ServiceLastAccessed' :: Text
serviceName = Text
pServiceName_,
$sel:serviceNamespace:ServiceLastAccessed' :: Text
serviceNamespace = Text
pServiceNamespace_
}
serviceLastAccessed_lastAuthenticated :: Lens.Lens' ServiceLastAccessed (Prelude.Maybe Prelude.UTCTime)
serviceLastAccessed_lastAuthenticated :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ServiceLastAccessed -> f ServiceLastAccessed
serviceLastAccessed_lastAuthenticated = (ServiceLastAccessed -> Maybe ISO8601)
-> (ServiceLastAccessed -> Maybe ISO8601 -> ServiceLastAccessed)
-> Lens
ServiceLastAccessed
ServiceLastAccessed
(Maybe ISO8601)
(Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceLastAccessed' {Maybe ISO8601
lastAuthenticated :: Maybe ISO8601
$sel:lastAuthenticated:ServiceLastAccessed' :: ServiceLastAccessed -> Maybe ISO8601
lastAuthenticated} -> Maybe ISO8601
lastAuthenticated) (\s :: ServiceLastAccessed
s@ServiceLastAccessed' {} Maybe ISO8601
a -> ServiceLastAccessed
s {$sel:lastAuthenticated:ServiceLastAccessed' :: Maybe ISO8601
lastAuthenticated = Maybe ISO8601
a} :: ServiceLastAccessed) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> ServiceLastAccessed -> f ServiceLastAccessed)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ServiceLastAccessed
-> f ServiceLastAccessed
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
serviceLastAccessed_trackedActionsLastAccessed :: Lens.Lens' ServiceLastAccessed (Prelude.Maybe [TrackedActionLastAccessed])
serviceLastAccessed_trackedActionsLastAccessed :: (Maybe [TrackedActionLastAccessed]
-> f (Maybe [TrackedActionLastAccessed]))
-> ServiceLastAccessed -> f ServiceLastAccessed
serviceLastAccessed_trackedActionsLastAccessed = (ServiceLastAccessed -> Maybe [TrackedActionLastAccessed])
-> (ServiceLastAccessed
-> Maybe [TrackedActionLastAccessed] -> ServiceLastAccessed)
-> Lens
ServiceLastAccessed
ServiceLastAccessed
(Maybe [TrackedActionLastAccessed])
(Maybe [TrackedActionLastAccessed])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceLastAccessed' {Maybe [TrackedActionLastAccessed]
trackedActionsLastAccessed :: Maybe [TrackedActionLastAccessed]
$sel:trackedActionsLastAccessed:ServiceLastAccessed' :: ServiceLastAccessed -> Maybe [TrackedActionLastAccessed]
trackedActionsLastAccessed} -> Maybe [TrackedActionLastAccessed]
trackedActionsLastAccessed) (\s :: ServiceLastAccessed
s@ServiceLastAccessed' {} Maybe [TrackedActionLastAccessed]
a -> ServiceLastAccessed
s {$sel:trackedActionsLastAccessed:ServiceLastAccessed' :: Maybe [TrackedActionLastAccessed]
trackedActionsLastAccessed = Maybe [TrackedActionLastAccessed]
a} :: ServiceLastAccessed) ((Maybe [TrackedActionLastAccessed]
-> f (Maybe [TrackedActionLastAccessed]))
-> ServiceLastAccessed -> f ServiceLastAccessed)
-> ((Maybe [TrackedActionLastAccessed]
-> f (Maybe [TrackedActionLastAccessed]))
-> Maybe [TrackedActionLastAccessed]
-> f (Maybe [TrackedActionLastAccessed]))
-> (Maybe [TrackedActionLastAccessed]
-> f (Maybe [TrackedActionLastAccessed]))
-> ServiceLastAccessed
-> f ServiceLastAccessed
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[TrackedActionLastAccessed]
[TrackedActionLastAccessed]
[TrackedActionLastAccessed]
[TrackedActionLastAccessed]
-> Iso
(Maybe [TrackedActionLastAccessed])
(Maybe [TrackedActionLastAccessed])
(Maybe [TrackedActionLastAccessed])
(Maybe [TrackedActionLastAccessed])
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
[TrackedActionLastAccessed]
[TrackedActionLastAccessed]
[TrackedActionLastAccessed]
[TrackedActionLastAccessed]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
serviceLastAccessed_lastAuthenticatedEntity :: Lens.Lens' ServiceLastAccessed (Prelude.Maybe Prelude.Text)
serviceLastAccessed_lastAuthenticatedEntity :: (Maybe Text -> f (Maybe Text))
-> ServiceLastAccessed -> f ServiceLastAccessed
serviceLastAccessed_lastAuthenticatedEntity = (ServiceLastAccessed -> Maybe Text)
-> (ServiceLastAccessed -> Maybe Text -> ServiceLastAccessed)
-> Lens
ServiceLastAccessed ServiceLastAccessed (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceLastAccessed' {Maybe Text
lastAuthenticatedEntity :: Maybe Text
$sel:lastAuthenticatedEntity:ServiceLastAccessed' :: ServiceLastAccessed -> Maybe Text
lastAuthenticatedEntity} -> Maybe Text
lastAuthenticatedEntity) (\s :: ServiceLastAccessed
s@ServiceLastAccessed' {} Maybe Text
a -> ServiceLastAccessed
s {$sel:lastAuthenticatedEntity:ServiceLastAccessed' :: Maybe Text
lastAuthenticatedEntity = Maybe Text
a} :: ServiceLastAccessed)
serviceLastAccessed_lastAuthenticatedRegion :: Lens.Lens' ServiceLastAccessed (Prelude.Maybe Prelude.Text)
serviceLastAccessed_lastAuthenticatedRegion :: (Maybe Text -> f (Maybe Text))
-> ServiceLastAccessed -> f ServiceLastAccessed
serviceLastAccessed_lastAuthenticatedRegion = (ServiceLastAccessed -> Maybe Text)
-> (ServiceLastAccessed -> Maybe Text -> ServiceLastAccessed)
-> Lens
ServiceLastAccessed ServiceLastAccessed (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceLastAccessed' {Maybe Text
lastAuthenticatedRegion :: Maybe Text
$sel:lastAuthenticatedRegion:ServiceLastAccessed' :: ServiceLastAccessed -> Maybe Text
lastAuthenticatedRegion} -> Maybe Text
lastAuthenticatedRegion) (\s :: ServiceLastAccessed
s@ServiceLastAccessed' {} Maybe Text
a -> ServiceLastAccessed
s {$sel:lastAuthenticatedRegion:ServiceLastAccessed' :: Maybe Text
lastAuthenticatedRegion = Maybe Text
a} :: ServiceLastAccessed)
serviceLastAccessed_totalAuthenticatedEntities :: Lens.Lens' ServiceLastAccessed (Prelude.Maybe Prelude.Int)
serviceLastAccessed_totalAuthenticatedEntities :: (Maybe Int -> f (Maybe Int))
-> ServiceLastAccessed -> f ServiceLastAccessed
serviceLastAccessed_totalAuthenticatedEntities = (ServiceLastAccessed -> Maybe Int)
-> (ServiceLastAccessed -> Maybe Int -> ServiceLastAccessed)
-> Lens
ServiceLastAccessed ServiceLastAccessed (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceLastAccessed' {Maybe Int
totalAuthenticatedEntities :: Maybe Int
$sel:totalAuthenticatedEntities:ServiceLastAccessed' :: ServiceLastAccessed -> Maybe Int
totalAuthenticatedEntities} -> Maybe Int
totalAuthenticatedEntities) (\s :: ServiceLastAccessed
s@ServiceLastAccessed' {} Maybe Int
a -> ServiceLastAccessed
s {$sel:totalAuthenticatedEntities:ServiceLastAccessed' :: Maybe Int
totalAuthenticatedEntities = Maybe Int
a} :: ServiceLastAccessed)
serviceLastAccessed_serviceName :: Lens.Lens' ServiceLastAccessed Prelude.Text
serviceLastAccessed_serviceName :: (Text -> f Text) -> ServiceLastAccessed -> f ServiceLastAccessed
serviceLastAccessed_serviceName = (ServiceLastAccessed -> Text)
-> (ServiceLastAccessed -> Text -> ServiceLastAccessed)
-> Lens ServiceLastAccessed ServiceLastAccessed Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceLastAccessed' {Text
serviceName :: Text
$sel:serviceName:ServiceLastAccessed' :: ServiceLastAccessed -> Text
serviceName} -> Text
serviceName) (\s :: ServiceLastAccessed
s@ServiceLastAccessed' {} Text
a -> ServiceLastAccessed
s {$sel:serviceName:ServiceLastAccessed' :: Text
serviceName = Text
a} :: ServiceLastAccessed)
serviceLastAccessed_serviceNamespace :: Lens.Lens' ServiceLastAccessed Prelude.Text
serviceLastAccessed_serviceNamespace :: (Text -> f Text) -> ServiceLastAccessed -> f ServiceLastAccessed
serviceLastAccessed_serviceNamespace = (ServiceLastAccessed -> Text)
-> (ServiceLastAccessed -> Text -> ServiceLastAccessed)
-> Lens ServiceLastAccessed ServiceLastAccessed Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceLastAccessed' {Text
serviceNamespace :: Text
$sel:serviceNamespace:ServiceLastAccessed' :: ServiceLastAccessed -> Text
serviceNamespace} -> Text
serviceNamespace) (\s :: ServiceLastAccessed
s@ServiceLastAccessed' {} Text
a -> ServiceLastAccessed
s {$sel:serviceNamespace:ServiceLastAccessed' :: Text
serviceNamespace = Text
a} :: ServiceLastAccessed)
instance Core.FromXML ServiceLastAccessed where
parseXML :: [Node] -> Either String ServiceLastAccessed
parseXML [Node]
x =
Maybe ISO8601
-> Maybe [TrackedActionLastAccessed]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Text
-> Text
-> ServiceLastAccessed
ServiceLastAccessed'
(Maybe ISO8601
-> Maybe [TrackedActionLastAccessed]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Text
-> Text
-> ServiceLastAccessed)
-> Either String (Maybe ISO8601)
-> Either
String
(Maybe [TrackedActionLastAccessed]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Text
-> Text
-> ServiceLastAccessed)
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
(Maybe [TrackedActionLastAccessed]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Text
-> Text
-> ServiceLastAccessed)
-> Either String (Maybe [TrackedActionLastAccessed])
-> Either
String
(Maybe Text
-> Maybe Text -> Maybe Int -> Text -> Text -> ServiceLastAccessed)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TrackedActionsLastAccessed"
Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [TrackedActionLastAccessed]))
-> Either String (Maybe [TrackedActionLastAccessed])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [TrackedActionLastAccessed])
-> [Node] -> Either String (Maybe [TrackedActionLastAccessed])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [TrackedActionLastAccessed]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either
String
(Maybe Text
-> Maybe Text -> Maybe Int -> Text -> Text -> ServiceLastAccessed)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text -> Maybe Int -> Text -> Text -> ServiceLastAccessed)
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
"LastAuthenticatedEntity")
Either
String
(Maybe Text -> Maybe Int -> Text -> Text -> ServiceLastAccessed)
-> Either String (Maybe Text)
-> Either String (Maybe Int -> Text -> Text -> ServiceLastAccessed)
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
"LastAuthenticatedRegion")
Either String (Maybe Int -> Text -> Text -> ServiceLastAccessed)
-> Either String (Maybe Int)
-> Either String (Text -> Text -> ServiceLastAccessed)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TotalAuthenticatedEntities")
Either String (Text -> Text -> ServiceLastAccessed)
-> Either String Text
-> Either String (Text -> ServiceLastAccessed)
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 -> ServiceLastAccessed)
-> Either String Text -> Either String ServiceLastAccessed
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
"ServiceNamespace")
instance Prelude.Hashable ServiceLastAccessed
instance Prelude.NFData ServiceLastAccessed