{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types.Tag
import Amazonka.IAM.Types.User
import qualified Amazonka.Prelude as Prelude
data VirtualMFADevice = VirtualMFADevice'
{
VirtualMFADevice -> Maybe (Sensitive Base64)
base32StringSeed :: Prelude.Maybe (Data.Sensitive Data.Base64),
VirtualMFADevice -> Maybe ISO8601
enableDate :: Prelude.Maybe Data.ISO8601,
VirtualMFADevice -> Maybe (Sensitive Base64)
qRCodePNG :: Prelude.Maybe (Data.Sensitive Data.Base64),
VirtualMFADevice -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
VirtualMFADevice -> Maybe User
user :: Prelude.Maybe User,
VirtualMFADevice -> Text
serialNumber :: Prelude.Text
}
deriving (VirtualMFADevice -> VirtualMFADevice -> Bool
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
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. 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'
{ $sel:base32StringSeed:VirtualMFADevice' :: Maybe (Sensitive Base64)
base32StringSeed =
forall a. Maybe a
Prelude.Nothing,
$sel:enableDate:VirtualMFADevice' :: Maybe ISO8601
enableDate = forall a. Maybe a
Prelude.Nothing,
$sel:qRCodePNG:VirtualMFADevice' :: Maybe (Sensitive Base64)
qRCodePNG = forall a. Maybe a
Prelude.Nothing,
$sel:tags:VirtualMFADevice' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:user:VirtualMFADevice' :: Maybe User
user = forall a. Maybe a
Prelude.Nothing,
$sel:serialNumber:VirtualMFADevice' :: Text
serialNumber = Text
pSerialNumber_
}
virtualMFADevice_base32StringSeed :: Lens.Lens' VirtualMFADevice (Prelude.Maybe Prelude.ByteString)
virtualMFADevice_base32StringSeed :: Lens' VirtualMFADevice (Maybe ByteString)
virtualMFADevice_base32StringSeed = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 (forall a. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Iso' Base64 ByteString
Data._Base64)
virtualMFADevice_enableDate :: Lens.Lens' VirtualMFADevice (Prelude.Maybe Prelude.UTCTime)
virtualMFADevice_enableDate :: Lens' VirtualMFADevice (Maybe UTCTime)
virtualMFADevice_enableDate = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
virtualMFADevice_qRCodePNG :: Lens.Lens' VirtualMFADevice (Prelude.Maybe Prelude.ByteString)
virtualMFADevice_qRCodePNG :: Lens' VirtualMFADevice (Maybe ByteString)
virtualMFADevice_qRCodePNG = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 (forall a. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Iso' Base64 ByteString
Data._Base64)
virtualMFADevice_tags :: Lens.Lens' VirtualMFADevice (Prelude.Maybe [Tag])
virtualMFADevice_tags :: Lens' VirtualMFADevice (Maybe [Tag])
virtualMFADevice_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
virtualMFADevice_user :: Lens.Lens' VirtualMFADevice (Prelude.Maybe User)
virtualMFADevice_user :: Lens' VirtualMFADevice (Maybe User)
virtualMFADevice_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_serialNumber :: Lens.Lens' VirtualMFADevice Prelude.Text
virtualMFADevice_serialNumber :: Lens' VirtualMFADevice Text
virtualMFADevice_serialNumber = 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 Data.FromXML VirtualMFADevice where
parseXML :: [Node] -> Either String VirtualMFADevice
parseXML [Node]
x =
Maybe (Sensitive Base64)
-> Maybe ISO8601
-> Maybe (Sensitive Base64)
-> Maybe [Tag]
-> Maybe User
-> Text
-> VirtualMFADevice
VirtualMFADevice'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Base32StringSeed")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"EnableDate")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"QRCodePNG")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Tags"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"User")
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")
instance Prelude.Hashable VirtualMFADevice where
hashWithSalt :: Int -> VirtualMFADevice -> Int
hashWithSalt Int
_salt VirtualMFADevice' {Maybe [Tag]
Maybe (Sensitive Base64)
Maybe ISO8601
Maybe User
Text
serialNumber :: Text
user :: Maybe User
tags :: Maybe [Tag]
qRCodePNG :: Maybe (Sensitive Base64)
enableDate :: Maybe ISO8601
base32StringSeed :: Maybe (Sensitive Base64)
$sel:serialNumber:VirtualMFADevice' :: VirtualMFADevice -> Text
$sel:user:VirtualMFADevice' :: VirtualMFADevice -> Maybe User
$sel:tags:VirtualMFADevice' :: VirtualMFADevice -> Maybe [Tag]
$sel:qRCodePNG:VirtualMFADevice' :: VirtualMFADevice -> Maybe (Sensitive Base64)
$sel:enableDate:VirtualMFADevice' :: VirtualMFADevice -> Maybe ISO8601
$sel:base32StringSeed:VirtualMFADevice' :: VirtualMFADevice -> Maybe (Sensitive Base64)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Base64)
base32StringSeed
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
enableDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Base64)
qRCodePNG
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe User
user
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serialNumber
instance Prelude.NFData VirtualMFADevice where
rnf :: VirtualMFADevice -> ()
rnf VirtualMFADevice' {Maybe [Tag]
Maybe (Sensitive Base64)
Maybe ISO8601
Maybe User
Text
serialNumber :: Text
user :: Maybe User
tags :: Maybe [Tag]
qRCodePNG :: Maybe (Sensitive Base64)
enableDate :: Maybe ISO8601
base32StringSeed :: Maybe (Sensitive Base64)
$sel:serialNumber:VirtualMFADevice' :: VirtualMFADevice -> Text
$sel:user:VirtualMFADevice' :: VirtualMFADevice -> Maybe User
$sel:tags:VirtualMFADevice' :: VirtualMFADevice -> Maybe [Tag]
$sel:qRCodePNG:VirtualMFADevice' :: VirtualMFADevice -> Maybe (Sensitive Base64)
$sel:enableDate:VirtualMFADevice' :: VirtualMFADevice -> Maybe ISO8601
$sel:base32StringSeed:VirtualMFADevice' :: VirtualMFADevice -> Maybe (Sensitive Base64)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Base64)
base32StringSeed
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
enableDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Base64)
qRCodePNG
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe User
user
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serialNumber