{-# 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.VirtualMFADevice where
import qualified Amazonka.Core as Core
import Amazonka.IAM.Types.Tag
import Amazonka.IAM.Types.User
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data VirtualMFADevice = VirtualMFADevice'
{
VirtualMFADevice -> Maybe (Sensitive Base64)
qRCodePNG :: Prelude.Maybe (Core.Sensitive Core.Base64),
VirtualMFADevice -> Maybe (Sensitive Base64)
base32StringSeed :: Prelude.Maybe (Core.Sensitive Core.Base64),
VirtualMFADevice -> Maybe User
user :: Prelude.Maybe User,
VirtualMFADevice -> Maybe ISO8601
enableDate :: Prelude.Maybe Core.ISO8601,
VirtualMFADevice -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
VirtualMFADevice -> Text
serialNumber :: Prelude.Text
}
deriving (VirtualMFADevice -> VirtualMFADevice -> Bool
(VirtualMFADevice -> VirtualMFADevice -> Bool)
-> (VirtualMFADevice -> VirtualMFADevice -> Bool)
-> Eq VirtualMFADevice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VirtualMFADevice -> VirtualMFADevice -> Bool
$c/= :: VirtualMFADevice -> VirtualMFADevice -> Bool
== :: VirtualMFADevice -> VirtualMFADevice -> Bool
$c== :: VirtualMFADevice -> VirtualMFADevice -> Bool
Prelude.Eq, Int -> VirtualMFADevice -> ShowS
[VirtualMFADevice] -> ShowS
VirtualMFADevice -> String
(Int -> VirtualMFADevice -> ShowS)
-> (VirtualMFADevice -> String)
-> ([VirtualMFADevice] -> ShowS)
-> Show VirtualMFADevice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VirtualMFADevice] -> ShowS
$cshowList :: [VirtualMFADevice] -> ShowS
show :: VirtualMFADevice -> String
$cshow :: VirtualMFADevice -> String
showsPrec :: Int -> VirtualMFADevice -> ShowS
$cshowsPrec :: Int -> VirtualMFADevice -> ShowS
Prelude.Show, (forall x. VirtualMFADevice -> Rep VirtualMFADevice x)
-> (forall x. Rep VirtualMFADevice x -> VirtualMFADevice)
-> Generic VirtualMFADevice
forall x. Rep VirtualMFADevice x -> VirtualMFADevice
forall x. VirtualMFADevice -> Rep VirtualMFADevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VirtualMFADevice x -> VirtualMFADevice
$cfrom :: forall x. VirtualMFADevice -> Rep VirtualMFADevice x
Prelude.Generic)
newVirtualMFADevice ::
Prelude.Text ->
VirtualMFADevice
newVirtualMFADevice :: Text -> VirtualMFADevice
newVirtualMFADevice Text
pSerialNumber_ =
VirtualMFADevice' :: Maybe (Sensitive Base64)
-> Maybe (Sensitive Base64)
-> Maybe User
-> Maybe ISO8601
-> Maybe [Tag]
-> Text
-> VirtualMFADevice
VirtualMFADevice'
{ $sel:qRCodePNG:VirtualMFADevice' :: Maybe (Sensitive Base64)
qRCodePNG = Maybe (Sensitive Base64)
forall a. Maybe a
Prelude.Nothing,
$sel:base32StringSeed:VirtualMFADevice' :: Maybe (Sensitive Base64)
base32StringSeed = Maybe (Sensitive Base64)
forall a. Maybe a
Prelude.Nothing,
$sel:user:VirtualMFADevice' :: Maybe User
user = Maybe User
forall a. Maybe a
Prelude.Nothing,
$sel:enableDate:VirtualMFADevice' :: Maybe ISO8601
enableDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:tags:VirtualMFADevice' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:serialNumber:VirtualMFADevice' :: Text
serialNumber = Text
pSerialNumber_
}
virtualMFADevice_qRCodePNG :: Lens.Lens' VirtualMFADevice (Prelude.Maybe Prelude.ByteString)
virtualMFADevice_qRCodePNG :: (Maybe ByteString -> f (Maybe ByteString))
-> VirtualMFADevice -> f VirtualMFADevice
virtualMFADevice_qRCodePNG = (VirtualMFADevice -> Maybe (Sensitive Base64))
-> (VirtualMFADevice
-> Maybe (Sensitive Base64) -> VirtualMFADevice)
-> Lens
VirtualMFADevice
VirtualMFADevice
(Maybe (Sensitive Base64))
(Maybe (Sensitive Base64))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualMFADevice' {Maybe (Sensitive Base64)
qRCodePNG :: Maybe (Sensitive Base64)
$sel:qRCodePNG:VirtualMFADevice' :: VirtualMFADevice -> Maybe (Sensitive Base64)
qRCodePNG} -> Maybe (Sensitive Base64)
qRCodePNG) (\s :: VirtualMFADevice
s@VirtualMFADevice' {} Maybe (Sensitive Base64)
a -> VirtualMFADevice
s {$sel:qRCodePNG:VirtualMFADevice' :: Maybe (Sensitive Base64)
qRCodePNG = Maybe (Sensitive Base64)
a} :: VirtualMFADevice) ((Maybe (Sensitive Base64) -> f (Maybe (Sensitive Base64)))
-> VirtualMFADevice -> f VirtualMFADevice)
-> ((Maybe ByteString -> f (Maybe ByteString))
-> Maybe (Sensitive Base64) -> f (Maybe (Sensitive Base64)))
-> (Maybe ByteString -> f (Maybe ByteString))
-> VirtualMFADevice
-> f VirtualMFADevice
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Base64) (Sensitive Base64) ByteString ByteString
-> Iso
(Maybe (Sensitive Base64))
(Maybe (Sensitive Base64))
(Maybe ByteString)
(Maybe ByteString)
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 (Exchange ByteString ByteString Base64 (Identity Base64)
-> Exchange
ByteString
ByteString
(Sensitive Base64)
(Identity (Sensitive Base64))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Exchange ByteString ByteString Base64 (Identity Base64)
-> Exchange
ByteString
ByteString
(Sensitive Base64)
(Identity (Sensitive Base64)))
-> (Exchange ByteString ByteString ByteString (Identity ByteString)
-> Exchange ByteString ByteString Base64 (Identity Base64))
-> AnIso
(Sensitive Base64) (Sensitive Base64) ByteString ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange ByteString ByteString ByteString (Identity ByteString)
-> Exchange ByteString ByteString Base64 (Identity Base64)
Iso' Base64 ByteString
Core._Base64)
virtualMFADevice_base32StringSeed :: Lens.Lens' VirtualMFADevice (Prelude.Maybe Prelude.ByteString)
virtualMFADevice_base32StringSeed :: (Maybe ByteString -> f (Maybe ByteString))
-> VirtualMFADevice -> f VirtualMFADevice
virtualMFADevice_base32StringSeed = (VirtualMFADevice -> Maybe (Sensitive Base64))
-> (VirtualMFADevice
-> Maybe (Sensitive Base64) -> VirtualMFADevice)
-> Lens
VirtualMFADevice
VirtualMFADevice
(Maybe (Sensitive Base64))
(Maybe (Sensitive Base64))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualMFADevice' {Maybe (Sensitive Base64)
base32StringSeed :: Maybe (Sensitive Base64)
$sel:base32StringSeed:VirtualMFADevice' :: VirtualMFADevice -> Maybe (Sensitive Base64)
base32StringSeed} -> Maybe (Sensitive Base64)
base32StringSeed) (\s :: VirtualMFADevice
s@VirtualMFADevice' {} Maybe (Sensitive Base64)
a -> VirtualMFADevice
s {$sel:base32StringSeed:VirtualMFADevice' :: Maybe (Sensitive Base64)
base32StringSeed = Maybe (Sensitive Base64)
a} :: VirtualMFADevice) ((Maybe (Sensitive Base64) -> f (Maybe (Sensitive Base64)))
-> VirtualMFADevice -> f VirtualMFADevice)
-> ((Maybe ByteString -> f (Maybe ByteString))
-> Maybe (Sensitive Base64) -> f (Maybe (Sensitive Base64)))
-> (Maybe ByteString -> f (Maybe ByteString))
-> VirtualMFADevice
-> f VirtualMFADevice
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Base64) (Sensitive Base64) ByteString ByteString
-> Iso
(Maybe (Sensitive Base64))
(Maybe (Sensitive Base64))
(Maybe ByteString)
(Maybe ByteString)
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 (Exchange ByteString ByteString Base64 (Identity Base64)
-> Exchange
ByteString
ByteString
(Sensitive Base64)
(Identity (Sensitive Base64))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Exchange ByteString ByteString Base64 (Identity Base64)
-> Exchange
ByteString
ByteString
(Sensitive Base64)
(Identity (Sensitive Base64)))
-> (Exchange ByteString ByteString ByteString (Identity ByteString)
-> Exchange ByteString ByteString Base64 (Identity Base64))
-> AnIso
(Sensitive Base64) (Sensitive Base64) ByteString ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange ByteString ByteString ByteString (Identity ByteString)
-> Exchange ByteString ByteString Base64 (Identity Base64)
Iso' Base64 ByteString
Core._Base64)
virtualMFADevice_user :: Lens.Lens' VirtualMFADevice (Prelude.Maybe User)
virtualMFADevice_user :: (Maybe User -> f (Maybe User))
-> VirtualMFADevice -> f VirtualMFADevice
virtualMFADevice_user = (VirtualMFADevice -> Maybe User)
-> (VirtualMFADevice -> Maybe User -> VirtualMFADevice)
-> Lens VirtualMFADevice VirtualMFADevice (Maybe User) (Maybe User)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualMFADevice' {Maybe User
user :: Maybe User
$sel:user:VirtualMFADevice' :: VirtualMFADevice -> Maybe User
user} -> Maybe User
user) (\s :: VirtualMFADevice
s@VirtualMFADevice' {} Maybe User
a -> VirtualMFADevice
s {$sel:user:VirtualMFADevice' :: Maybe User
user = Maybe User
a} :: VirtualMFADevice)
virtualMFADevice_enableDate :: Lens.Lens' VirtualMFADevice (Prelude.Maybe Prelude.UTCTime)
virtualMFADevice_enableDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> VirtualMFADevice -> f VirtualMFADevice
virtualMFADevice_enableDate = (VirtualMFADevice -> Maybe ISO8601)
-> (VirtualMFADevice -> Maybe ISO8601 -> VirtualMFADevice)
-> Lens
VirtualMFADevice VirtualMFADevice (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualMFADevice' {Maybe ISO8601
enableDate :: Maybe ISO8601
$sel:enableDate:VirtualMFADevice' :: VirtualMFADevice -> Maybe ISO8601
enableDate} -> Maybe ISO8601
enableDate) (\s :: VirtualMFADevice
s@VirtualMFADevice' {} Maybe ISO8601
a -> VirtualMFADevice
s {$sel:enableDate:VirtualMFADevice' :: Maybe ISO8601
enableDate = Maybe ISO8601
a} :: VirtualMFADevice) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> VirtualMFADevice -> f VirtualMFADevice)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> VirtualMFADevice
-> f VirtualMFADevice
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
virtualMFADevice_tags :: Lens.Lens' VirtualMFADevice (Prelude.Maybe [Tag])
virtualMFADevice_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> VirtualMFADevice -> f VirtualMFADevice
virtualMFADevice_tags = (VirtualMFADevice -> Maybe [Tag])
-> (VirtualMFADevice -> Maybe [Tag] -> VirtualMFADevice)
-> Lens
VirtualMFADevice VirtualMFADevice (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualMFADevice' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:VirtualMFADevice' :: VirtualMFADevice -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: VirtualMFADevice
s@VirtualMFADevice' {} Maybe [Tag]
a -> VirtualMFADevice
s {$sel:tags:VirtualMFADevice' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: VirtualMFADevice) ((Maybe [Tag] -> f (Maybe [Tag]))
-> VirtualMFADevice -> f VirtualMFADevice)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> VirtualMFADevice
-> f VirtualMFADevice
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
virtualMFADevice_serialNumber :: Lens.Lens' VirtualMFADevice Prelude.Text
virtualMFADevice_serialNumber :: (Text -> f Text) -> VirtualMFADevice -> f VirtualMFADevice
virtualMFADevice_serialNumber = (VirtualMFADevice -> Text)
-> (VirtualMFADevice -> Text -> VirtualMFADevice)
-> Lens VirtualMFADevice VirtualMFADevice Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualMFADevice' {Text
serialNumber :: Text
$sel:serialNumber:VirtualMFADevice' :: VirtualMFADevice -> Text
serialNumber} -> Text
serialNumber) (\s :: VirtualMFADevice
s@VirtualMFADevice' {} Text
a -> VirtualMFADevice
s {$sel:serialNumber:VirtualMFADevice' :: Text
serialNumber = Text
a} :: VirtualMFADevice)
instance Core.FromXML VirtualMFADevice where
parseXML :: [Node] -> Either String VirtualMFADevice
parseXML [Node]
x =
Maybe (Sensitive Base64)
-> Maybe (Sensitive Base64)
-> Maybe User
-> Maybe ISO8601
-> Maybe [Tag]
-> Text
-> VirtualMFADevice
VirtualMFADevice'
(Maybe (Sensitive Base64)
-> Maybe (Sensitive Base64)
-> Maybe User
-> Maybe ISO8601
-> Maybe [Tag]
-> Text
-> VirtualMFADevice)
-> Either String (Maybe (Sensitive Base64))
-> Either
String
(Maybe (Sensitive Base64)
-> Maybe User
-> Maybe ISO8601
-> Maybe [Tag]
-> Text
-> VirtualMFADevice)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe (Sensitive Base64))
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"QRCodePNG")
Either
String
(Maybe (Sensitive Base64)
-> Maybe User
-> Maybe ISO8601
-> Maybe [Tag]
-> Text
-> VirtualMFADevice)
-> Either String (Maybe (Sensitive Base64))
-> Either
String
(Maybe User
-> Maybe ISO8601 -> Maybe [Tag] -> Text -> VirtualMFADevice)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe (Sensitive Base64))
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Base32StringSeed")
Either
String
(Maybe User
-> Maybe ISO8601 -> Maybe [Tag] -> Text -> VirtualMFADevice)
-> Either String (Maybe User)
-> Either
String (Maybe ISO8601 -> Maybe [Tag] -> Text -> VirtualMFADevice)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe User)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"User")
Either
String (Maybe ISO8601 -> Maybe [Tag] -> Text -> VirtualMFADevice)
-> Either String (Maybe ISO8601)
-> Either String (Maybe [Tag] -> Text -> VirtualMFADevice)
forall (f :: * -> *) a b. Applicative f => 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
"EnableDate")
Either String (Maybe [Tag] -> Text -> VirtualMFADevice)
-> Either String (Maybe [Tag])
-> Either String (Text -> VirtualMFADevice)
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
"Tags" 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 [Tag]))
-> Either String (Maybe [Tag])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Tag])
-> [Node] -> Either String (Maybe [Tag])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Tag]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either String (Text -> VirtualMFADevice)
-> Either String Text -> Either String VirtualMFADevice
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")
instance Prelude.Hashable VirtualMFADevice
instance Prelude.NFData VirtualMFADevice