{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IAM.Types.VirtualMFADevice
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Contains information about a virtual MFA device.
--
-- /See:/ 'newVirtualMFADevice' smart constructor.
data VirtualMFADevice = VirtualMFADevice'
  { -- | A QR code PNG image that encodes
    -- @otpauth:\/\/totp\/$virtualMFADeviceName\@$AccountName?secret=$Base32String@
    -- where @$virtualMFADeviceName@ is one of the create call arguments.
    -- @AccountName@ is the user name if set (otherwise, the account ID
    -- otherwise), and @Base32String@ is the seed in base32 format. The
    -- @Base32String@ value is base64-encoded.
    VirtualMFADevice -> Maybe (Sensitive Base64)
qRCodePNG :: Prelude.Maybe (Core.Sensitive Core.Base64),
    -- | The base32 seed defined as specified in
    -- <https://tools.ietf.org/html/rfc3548.txt RFC3548>. The
    -- @Base32StringSeed@ is base64-encoded.
    VirtualMFADevice -> Maybe (Sensitive Base64)
base32StringSeed :: Prelude.Maybe (Core.Sensitive Core.Base64),
    -- | The IAM user associated with this virtual MFA device.
    VirtualMFADevice -> Maybe User
user :: Prelude.Maybe User,
    -- | The date and time on which the virtual MFA device was enabled.
    VirtualMFADevice -> Maybe ISO8601
enableDate :: Prelude.Maybe Core.ISO8601,
    -- | A list of tags that are attached to the virtual MFA device. For more
    -- information about tagging, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html Tagging IAM resources>
    -- in the /IAM User Guide/.
    VirtualMFADevice -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The serial number associated with @VirtualMFADevice@.
    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)

-- |
-- Create a value of 'VirtualMFADevice' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'qRCodePNG', 'virtualMFADevice_qRCodePNG' - A QR code PNG image that encodes
-- @otpauth:\/\/totp\/$virtualMFADeviceName\@$AccountName?secret=$Base32String@
-- where @$virtualMFADeviceName@ is one of the create call arguments.
-- @AccountName@ is the user name if set (otherwise, the account ID
-- otherwise), and @Base32String@ is the seed in base32 format. The
-- @Base32String@ value is base64-encoded.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
--
-- 'base32StringSeed', 'virtualMFADevice_base32StringSeed' - The base32 seed defined as specified in
-- <https://tools.ietf.org/html/rfc3548.txt RFC3548>. The
-- @Base32StringSeed@ is base64-encoded.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
--
-- 'user', 'virtualMFADevice_user' - The IAM user associated with this virtual MFA device.
--
-- 'enableDate', 'virtualMFADevice_enableDate' - The date and time on which the virtual MFA device was enabled.
--
-- 'tags', 'virtualMFADevice_tags' - A list of tags that are attached to the virtual MFA device. For more
-- information about tagging, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html Tagging IAM resources>
-- in the /IAM User Guide/.
--
-- 'serialNumber', 'virtualMFADevice_serialNumber' - The serial number associated with @VirtualMFADevice@.
newVirtualMFADevice ::
  -- | 'serialNumber'
  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_
    }

-- | A QR code PNG image that encodes
-- @otpauth:\/\/totp\/$virtualMFADeviceName\@$AccountName?secret=$Base32String@
-- where @$virtualMFADeviceName@ is one of the create call arguments.
-- @AccountName@ is the user name if set (otherwise, the account ID
-- otherwise), and @Base32String@ is the seed in base32 format. The
-- @Base32String@ value is base64-encoded.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
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)

-- | The base32 seed defined as specified in
-- <https://tools.ietf.org/html/rfc3548.txt RFC3548>. The
-- @Base32StringSeed@ is base64-encoded.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
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)

-- | The IAM user associated with this virtual MFA device.
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)

-- | The date and time on which the virtual MFA device was enabled.
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

-- | A list of tags that are attached to the virtual MFA device. For more
-- information about tagging, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html Tagging IAM resources>
-- in the /IAM User Guide/.
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

-- | The serial number associated with @VirtualMFADevice@.
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