{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data MFADevice = MFADevice'
{
MFADevice -> Text
userName :: Prelude.Text,
MFADevice -> Text
serialNumber :: Prelude.Text,
MFADevice -> ISO8601
enableDate :: Data.ISO8601
}
deriving (MFADevice -> MFADevice -> Bool
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]
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
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. 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'
{ $sel:userName:MFADevice' :: Text
userName = Text
pUserName_,
$sel:serialNumber:MFADevice' :: Text
serialNumber = Text
pSerialNumber_,
$sel:enableDate:MFADevice' :: ISO8601
enableDate = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEnableDate_
}
mfaDevice_userName :: Lens.Lens' MFADevice Prelude.Text
mfaDevice_userName :: Lens' MFADevice Text
mfaDevice_userName = 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 :: Lens' MFADevice Text
mfaDevice_serialNumber = 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 :: Lens' MFADevice UTCTime
mfaDevice_enableDate = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromXML MFADevice where
parseXML :: [Node] -> Either String MFADevice
parseXML [Node]
x =
Text -> Text -> ISO8601 -> MFADevice
MFADevice'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"UserName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"SerialNumber")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"EnableDate")
instance Prelude.Hashable MFADevice where
hashWithSalt :: Int -> MFADevice -> Int
hashWithSalt Int
_salt MFADevice' {Text
ISO8601
enableDate :: ISO8601
serialNumber :: Text
userName :: Text
$sel:enableDate:MFADevice' :: MFADevice -> ISO8601
$sel:serialNumber:MFADevice' :: MFADevice -> Text
$sel:userName:MFADevice' :: MFADevice -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
userName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serialNumber
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
enableDate
instance Prelude.NFData MFADevice where
rnf :: MFADevice -> ()
rnf MFADevice' {Text
ISO8601
enableDate :: ISO8601
serialNumber :: Text
userName :: Text
$sel:enableDate:MFADevice' :: MFADevice -> ISO8601
$sel:serialNumber:MFADevice' :: MFADevice -> Text
$sel:userName:MFADevice' :: MFADevice -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
userName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serialNumber
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
enableDate