{-# 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.MFADevice where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MFADevice = MFADevice'
{
MFADevice -> Text
userName :: Prelude.Text,
MFADevice -> Text
serialNumber :: Prelude.Text,
MFADevice -> ISO8601
enableDate :: Core.ISO8601
}
deriving (MFADevice -> MFADevice -> Bool
(MFADevice -> MFADevice -> Bool)
-> (MFADevice -> MFADevice -> Bool) -> Eq MFADevice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MFADevice -> MFADevice -> Bool
$c/= :: MFADevice -> MFADevice -> Bool
== :: MFADevice -> MFADevice -> Bool
$c== :: MFADevice -> MFADevice -> Bool
Prelude.Eq, ReadPrec [MFADevice]
ReadPrec MFADevice
Int -> ReadS MFADevice
ReadS [MFADevice]
(Int -> ReadS MFADevice)
-> ReadS [MFADevice]
-> ReadPrec MFADevice
-> ReadPrec [MFADevice]
-> Read MFADevice
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MFADevice]
$creadListPrec :: ReadPrec [MFADevice]
readPrec :: ReadPrec MFADevice
$creadPrec :: ReadPrec MFADevice
readList :: ReadS [MFADevice]
$creadList :: ReadS [MFADevice]
readsPrec :: Int -> ReadS MFADevice
$creadsPrec :: Int -> ReadS MFADevice
Prelude.Read, Int -> MFADevice -> ShowS
[MFADevice] -> ShowS
MFADevice -> String
(Int -> MFADevice -> ShowS)
-> (MFADevice -> String)
-> ([MFADevice] -> ShowS)
-> Show MFADevice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MFADevice] -> ShowS
$cshowList :: [MFADevice] -> ShowS
show :: MFADevice -> String
$cshow :: MFADevice -> String
showsPrec :: Int -> MFADevice -> ShowS
$cshowsPrec :: Int -> MFADevice -> ShowS
Prelude.Show, (forall x. MFADevice -> Rep MFADevice x)
-> (forall x. Rep MFADevice x -> MFADevice) -> Generic MFADevice
forall x. Rep MFADevice x -> MFADevice
forall x. MFADevice -> Rep MFADevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MFADevice x -> MFADevice
$cfrom :: forall x. MFADevice -> Rep MFADevice x
Prelude.Generic)
newMFADevice ::
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
MFADevice
newMFADevice :: Text -> Text -> UTCTime -> MFADevice
newMFADevice Text
pUserName_ Text
pSerialNumber_ UTCTime
pEnableDate_ =
MFADevice' :: Text -> Text -> ISO8601 -> MFADevice
MFADevice'
{ $sel:userName:MFADevice' :: Text
userName = Text
pUserName_,
$sel:serialNumber:MFADevice' :: Text
serialNumber = Text
pSerialNumber_,
$sel:enableDate:MFADevice' :: ISO8601
enableDate = 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
pEnableDate_
}
mfaDevice_userName :: Lens.Lens' MFADevice Prelude.Text
mfaDevice_userName :: (Text -> f Text) -> MFADevice -> f MFADevice
mfaDevice_userName = (MFADevice -> Text)
-> (MFADevice -> Text -> MFADevice)
-> Lens MFADevice MFADevice Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MFADevice' {Text
userName :: Text
$sel:userName:MFADevice' :: MFADevice -> Text
userName} -> Text
userName) (\s :: MFADevice
s@MFADevice' {} Text
a -> MFADevice
s {$sel:userName:MFADevice' :: Text
userName = Text
a} :: MFADevice)
mfaDevice_serialNumber :: Lens.Lens' MFADevice Prelude.Text
mfaDevice_serialNumber :: (Text -> f Text) -> MFADevice -> f MFADevice
mfaDevice_serialNumber = (MFADevice -> Text)
-> (MFADevice -> Text -> MFADevice)
-> Lens MFADevice MFADevice Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MFADevice' {Text
serialNumber :: Text
$sel:serialNumber:MFADevice' :: MFADevice -> Text
serialNumber} -> Text
serialNumber) (\s :: MFADevice
s@MFADevice' {} Text
a -> MFADevice
s {$sel:serialNumber:MFADevice' :: Text
serialNumber = Text
a} :: MFADevice)
mfaDevice_enableDate :: Lens.Lens' MFADevice Prelude.UTCTime
mfaDevice_enableDate :: (UTCTime -> f UTCTime) -> MFADevice -> f MFADevice
mfaDevice_enableDate = (MFADevice -> ISO8601)
-> (MFADevice -> ISO8601 -> MFADevice)
-> Lens MFADevice MFADevice ISO8601 ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MFADevice' {ISO8601
enableDate :: ISO8601
$sel:enableDate:MFADevice' :: MFADevice -> ISO8601
enableDate} -> ISO8601
enableDate) (\s :: MFADevice
s@MFADevice' {} ISO8601
a -> MFADevice
s {$sel:enableDate:MFADevice' :: ISO8601
enableDate = ISO8601
a} :: MFADevice) ((ISO8601 -> f ISO8601) -> MFADevice -> f MFADevice)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> MFADevice
-> f MFADevice
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
instance Core.FromXML MFADevice where
parseXML :: [Node] -> Either String MFADevice
parseXML [Node]
x =
Text -> Text -> ISO8601 -> MFADevice
MFADevice'
(Text -> Text -> ISO8601 -> MFADevice)
-> Either String Text
-> Either String (Text -> ISO8601 -> MFADevice)
forall (f :: * -> *) a b. Functor 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
"UserName")
Either String (Text -> ISO8601 -> MFADevice)
-> Either String Text -> Either String (ISO8601 -> MFADevice)
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
"SerialNumber")
Either String (ISO8601 -> MFADevice)
-> Either String ISO8601 -> Either String MFADevice
forall (f :: * -> *) a b. Applicative f => 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
"EnableDate")
instance Prelude.Hashable MFADevice
instance Prelude.NFData MFADevice