{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.ListVirtualMFADevices
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the virtual MFA devices defined in the Amazon Web Services account
-- by assignment status. If you do not specify an assignment status, the
-- operation returns a list of all virtual MFA devices. Assignment status
-- can be @Assigned@, @Unassigned@, or @Any@.
--
-- IAM resource-listing operations return a subset of the available
-- attributes for the resource. For example, this operation does not return
-- tags, even though they are an attribute of the returned object. To view
-- tag information for a virtual MFA device, see ListMFADeviceTags.
--
-- You can paginate the results using the @MaxItems@ and @Marker@
-- parameters.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListVirtualMFADevices
  ( -- * Creating a Request
    ListVirtualMFADevices (..),
    newListVirtualMFADevices,

    -- * Request Lenses
    listVirtualMFADevices_assignmentStatus,
    listVirtualMFADevices_marker,
    listVirtualMFADevices_maxItems,

    -- * Destructuring the Response
    ListVirtualMFADevicesResponse (..),
    newListVirtualMFADevicesResponse,

    -- * Response Lenses
    listVirtualMFADevicesResponse_isTruncated,
    listVirtualMFADevicesResponse_marker,
    listVirtualMFADevicesResponse_httpStatus,
    listVirtualMFADevicesResponse_virtualMFADevices,
  )
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListVirtualMFADevices' smart constructor.
data ListVirtualMFADevices = ListVirtualMFADevices'
  { -- | The status (@Unassigned@ or @Assigned@) of the devices to list. If you
    -- do not specify an @AssignmentStatus@, the operation defaults to @Any@,
    -- which lists both assigned and unassigned virtual MFA devices.,
    ListVirtualMFADevices -> Maybe AssignmentStatusType
assignmentStatus :: Prelude.Maybe AssignmentStatusType,
    -- | Use this parameter only when paginating results and only after you
    -- receive a response indicating that the results are truncated. Set it to
    -- the value of the @Marker@ element in the response that you received to
    -- indicate where the next call should start.
    ListVirtualMFADevices -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Use this only when paginating results to indicate the maximum number of
    -- items you want in the response. If additional items exist beyond the
    -- maximum you specify, the @IsTruncated@ response element is @true@.
    --
    -- If you do not include this parameter, the number of items defaults to
    -- 100. Note that IAM might return fewer results, even when there are more
    -- results available. In that case, the @IsTruncated@ response element
    -- returns @true@, and @Marker@ contains a value to include in the
    -- subsequent call that tells the service where to continue from.
    ListVirtualMFADevices -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListVirtualMFADevices -> ListVirtualMFADevices -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVirtualMFADevices -> ListVirtualMFADevices -> Bool
$c/= :: ListVirtualMFADevices -> ListVirtualMFADevices -> Bool
== :: ListVirtualMFADevices -> ListVirtualMFADevices -> Bool
$c== :: ListVirtualMFADevices -> ListVirtualMFADevices -> Bool
Prelude.Eq, ReadPrec [ListVirtualMFADevices]
ReadPrec ListVirtualMFADevices
Int -> ReadS ListVirtualMFADevices
ReadS [ListVirtualMFADevices]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVirtualMFADevices]
$creadListPrec :: ReadPrec [ListVirtualMFADevices]
readPrec :: ReadPrec ListVirtualMFADevices
$creadPrec :: ReadPrec ListVirtualMFADevices
readList :: ReadS [ListVirtualMFADevices]
$creadList :: ReadS [ListVirtualMFADevices]
readsPrec :: Int -> ReadS ListVirtualMFADevices
$creadsPrec :: Int -> ReadS ListVirtualMFADevices
Prelude.Read, Int -> ListVirtualMFADevices -> ShowS
[ListVirtualMFADevices] -> ShowS
ListVirtualMFADevices -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVirtualMFADevices] -> ShowS
$cshowList :: [ListVirtualMFADevices] -> ShowS
show :: ListVirtualMFADevices -> String
$cshow :: ListVirtualMFADevices -> String
showsPrec :: Int -> ListVirtualMFADevices -> ShowS
$cshowsPrec :: Int -> ListVirtualMFADevices -> ShowS
Prelude.Show, forall x. Rep ListVirtualMFADevices x -> ListVirtualMFADevices
forall x. ListVirtualMFADevices -> Rep ListVirtualMFADevices x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListVirtualMFADevices x -> ListVirtualMFADevices
$cfrom :: forall x. ListVirtualMFADevices -> Rep ListVirtualMFADevices x
Prelude.Generic)

-- |
-- Create a value of 'ListVirtualMFADevices' 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:
--
-- 'assignmentStatus', 'listVirtualMFADevices_assignmentStatus' - The status (@Unassigned@ or @Assigned@) of the devices to list. If you
-- do not specify an @AssignmentStatus@, the operation defaults to @Any@,
-- which lists both assigned and unassigned virtual MFA devices.,
--
-- 'marker', 'listVirtualMFADevices_marker' - Use this parameter only when paginating results and only after you
-- receive a response indicating that the results are truncated. Set it to
-- the value of the @Marker@ element in the response that you received to
-- indicate where the next call should start.
--
-- 'maxItems', 'listVirtualMFADevices_maxItems' - Use this only when paginating results to indicate the maximum number of
-- items you want in the response. If additional items exist beyond the
-- maximum you specify, the @IsTruncated@ response element is @true@.
--
-- If you do not include this parameter, the number of items defaults to
-- 100. Note that IAM might return fewer results, even when there are more
-- results available. In that case, the @IsTruncated@ response element
-- returns @true@, and @Marker@ contains a value to include in the
-- subsequent call that tells the service where to continue from.
newListVirtualMFADevices ::
  ListVirtualMFADevices
newListVirtualMFADevices :: ListVirtualMFADevices
newListVirtualMFADevices =
  ListVirtualMFADevices'
    { $sel:assignmentStatus:ListVirtualMFADevices' :: Maybe AssignmentStatusType
assignmentStatus =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListVirtualMFADevices' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListVirtualMFADevices' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing
    }

-- | The status (@Unassigned@ or @Assigned@) of the devices to list. If you
-- do not specify an @AssignmentStatus@, the operation defaults to @Any@,
-- which lists both assigned and unassigned virtual MFA devices.,
listVirtualMFADevices_assignmentStatus :: Lens.Lens' ListVirtualMFADevices (Prelude.Maybe AssignmentStatusType)
listVirtualMFADevices_assignmentStatus :: Lens' ListVirtualMFADevices (Maybe AssignmentStatusType)
listVirtualMFADevices_assignmentStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualMFADevices' {Maybe AssignmentStatusType
assignmentStatus :: Maybe AssignmentStatusType
$sel:assignmentStatus:ListVirtualMFADevices' :: ListVirtualMFADevices -> Maybe AssignmentStatusType
assignmentStatus} -> Maybe AssignmentStatusType
assignmentStatus) (\s :: ListVirtualMFADevices
s@ListVirtualMFADevices' {} Maybe AssignmentStatusType
a -> ListVirtualMFADevices
s {$sel:assignmentStatus:ListVirtualMFADevices' :: Maybe AssignmentStatusType
assignmentStatus = Maybe AssignmentStatusType
a} :: ListVirtualMFADevices)

-- | Use this parameter only when paginating results and only after you
-- receive a response indicating that the results are truncated. Set it to
-- the value of the @Marker@ element in the response that you received to
-- indicate where the next call should start.
listVirtualMFADevices_marker :: Lens.Lens' ListVirtualMFADevices (Prelude.Maybe Prelude.Text)
listVirtualMFADevices_marker :: Lens' ListVirtualMFADevices (Maybe Text)
listVirtualMFADevices_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualMFADevices' {Maybe Text
marker :: Maybe Text
$sel:marker:ListVirtualMFADevices' :: ListVirtualMFADevices -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListVirtualMFADevices
s@ListVirtualMFADevices' {} Maybe Text
a -> ListVirtualMFADevices
s {$sel:marker:ListVirtualMFADevices' :: Maybe Text
marker = Maybe Text
a} :: ListVirtualMFADevices)

-- | Use this only when paginating results to indicate the maximum number of
-- items you want in the response. If additional items exist beyond the
-- maximum you specify, the @IsTruncated@ response element is @true@.
--
-- If you do not include this parameter, the number of items defaults to
-- 100. Note that IAM might return fewer results, even when there are more
-- results available. In that case, the @IsTruncated@ response element
-- returns @true@, and @Marker@ contains a value to include in the
-- subsequent call that tells the service where to continue from.
listVirtualMFADevices_maxItems :: Lens.Lens' ListVirtualMFADevices (Prelude.Maybe Prelude.Natural)
listVirtualMFADevices_maxItems :: Lens' ListVirtualMFADevices (Maybe Natural)
listVirtualMFADevices_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualMFADevices' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListVirtualMFADevices' :: ListVirtualMFADevices -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListVirtualMFADevices
s@ListVirtualMFADevices' {} Maybe Natural
a -> ListVirtualMFADevices
s {$sel:maxItems:ListVirtualMFADevices' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListVirtualMFADevices)

instance Core.AWSPager ListVirtualMFADevices where
  page :: ListVirtualMFADevices
-> AWSResponse ListVirtualMFADevices -> Maybe ListVirtualMFADevices
page ListVirtualMFADevices
rq AWSResponse ListVirtualMFADevices
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListVirtualMFADevices
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVirtualMFADevicesResponse (Maybe Bool)
listVirtualMFADevicesResponse_isTruncated
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListVirtualMFADevices
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVirtualMFADevicesResponse (Maybe Text)
listVirtualMFADevicesResponse_marker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListVirtualMFADevices
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListVirtualMFADevices (Maybe Text)
listVirtualMFADevices_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListVirtualMFADevices
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVirtualMFADevicesResponse (Maybe Text)
listVirtualMFADevicesResponse_marker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListVirtualMFADevices where
  type
    AWSResponse ListVirtualMFADevices =
      ListVirtualMFADevicesResponse
  request :: (Service -> Service)
-> ListVirtualMFADevices -> Request ListVirtualMFADevices
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListVirtualMFADevices
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListVirtualMFADevices)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListVirtualMFADevicesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Bool
-> Maybe Text
-> Int
-> [VirtualMFADevice]
-> ListVirtualMFADevicesResponse
ListVirtualMFADevicesResponse'
            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
"IsTruncated")
            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
"Marker")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            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
"VirtualMFADevices"
                            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 a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member"
                        )
      )

instance Prelude.Hashable ListVirtualMFADevices where
  hashWithSalt :: Int -> ListVirtualMFADevices -> Int
hashWithSalt Int
_salt ListVirtualMFADevices' {Maybe Natural
Maybe Text
Maybe AssignmentStatusType
maxItems :: Maybe Natural
marker :: Maybe Text
assignmentStatus :: Maybe AssignmentStatusType
$sel:maxItems:ListVirtualMFADevices' :: ListVirtualMFADevices -> Maybe Natural
$sel:marker:ListVirtualMFADevices' :: ListVirtualMFADevices -> Maybe Text
$sel:assignmentStatus:ListVirtualMFADevices' :: ListVirtualMFADevices -> Maybe AssignmentStatusType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AssignmentStatusType
assignmentStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxItems

instance Prelude.NFData ListVirtualMFADevices where
  rnf :: ListVirtualMFADevices -> ()
rnf ListVirtualMFADevices' {Maybe Natural
Maybe Text
Maybe AssignmentStatusType
maxItems :: Maybe Natural
marker :: Maybe Text
assignmentStatus :: Maybe AssignmentStatusType
$sel:maxItems:ListVirtualMFADevices' :: ListVirtualMFADevices -> Maybe Natural
$sel:marker:ListVirtualMFADevices' :: ListVirtualMFADevices -> Maybe Text
$sel:assignmentStatus:ListVirtualMFADevices' :: ListVirtualMFADevices -> Maybe AssignmentStatusType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AssignmentStatusType
assignmentStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxItems

instance Data.ToHeaders ListVirtualMFADevices where
  toHeaders :: ListVirtualMFADevices -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath ListVirtualMFADevices where
  toPath :: ListVirtualMFADevices -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery ListVirtualMFADevices where
  toQuery :: ListVirtualMFADevices -> QueryString
toQuery ListVirtualMFADevices' {Maybe Natural
Maybe Text
Maybe AssignmentStatusType
maxItems :: Maybe Natural
marker :: Maybe Text
assignmentStatus :: Maybe AssignmentStatusType
$sel:maxItems:ListVirtualMFADevices' :: ListVirtualMFADevices -> Maybe Natural
$sel:marker:ListVirtualMFADevices' :: ListVirtualMFADevices -> Maybe Text
$sel:assignmentStatus:ListVirtualMFADevices' :: ListVirtualMFADevices -> Maybe AssignmentStatusType
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ListVirtualMFADevices" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        ByteString
"AssignmentStatus" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe AssignmentStatusType
assignmentStatus,
        ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
        ByteString
"MaxItems" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxItems
      ]

-- | Contains the response to a successful ListVirtualMFADevices request.
--
-- /See:/ 'newListVirtualMFADevicesResponse' smart constructor.
data ListVirtualMFADevicesResponse = ListVirtualMFADevicesResponse'
  { -- | A flag that indicates whether there are more items to return. If your
    -- results were truncated, you can make a subsequent pagination request
    -- using the @Marker@ request parameter to retrieve more items. Note that
    -- IAM might return fewer than the @MaxItems@ number of results even when
    -- there are more results available. We recommend that you check
    -- @IsTruncated@ after every call to ensure that you receive all your
    -- results.
    ListVirtualMFADevicesResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | When @IsTruncated@ is @true@, this element is present and contains the
    -- value to use for the @Marker@ parameter in a subsequent pagination
    -- request.
    ListVirtualMFADevicesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListVirtualMFADevicesResponse -> Int
httpStatus :: Prelude.Int,
    -- | The list of virtual MFA devices in the current account that match the
    -- @AssignmentStatus@ value that was passed in the request.
    ListVirtualMFADevicesResponse -> [VirtualMFADevice]
virtualMFADevices :: [VirtualMFADevice]
  }
  deriving (ListVirtualMFADevicesResponse
-> ListVirtualMFADevicesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVirtualMFADevicesResponse
-> ListVirtualMFADevicesResponse -> Bool
$c/= :: ListVirtualMFADevicesResponse
-> ListVirtualMFADevicesResponse -> Bool
== :: ListVirtualMFADevicesResponse
-> ListVirtualMFADevicesResponse -> Bool
$c== :: ListVirtualMFADevicesResponse
-> ListVirtualMFADevicesResponse -> Bool
Prelude.Eq, Int -> ListVirtualMFADevicesResponse -> ShowS
[ListVirtualMFADevicesResponse] -> ShowS
ListVirtualMFADevicesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVirtualMFADevicesResponse] -> ShowS
$cshowList :: [ListVirtualMFADevicesResponse] -> ShowS
show :: ListVirtualMFADevicesResponse -> String
$cshow :: ListVirtualMFADevicesResponse -> String
showsPrec :: Int -> ListVirtualMFADevicesResponse -> ShowS
$cshowsPrec :: Int -> ListVirtualMFADevicesResponse -> ShowS
Prelude.Show, forall x.
Rep ListVirtualMFADevicesResponse x
-> ListVirtualMFADevicesResponse
forall x.
ListVirtualMFADevicesResponse
-> Rep ListVirtualMFADevicesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListVirtualMFADevicesResponse x
-> ListVirtualMFADevicesResponse
$cfrom :: forall x.
ListVirtualMFADevicesResponse
-> Rep ListVirtualMFADevicesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListVirtualMFADevicesResponse' 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:
--
-- 'isTruncated', 'listVirtualMFADevicesResponse_isTruncated' - A flag that indicates whether there are more items to return. If your
-- results were truncated, you can make a subsequent pagination request
-- using the @Marker@ request parameter to retrieve more items. Note that
-- IAM might return fewer than the @MaxItems@ number of results even when
-- there are more results available. We recommend that you check
-- @IsTruncated@ after every call to ensure that you receive all your
-- results.
--
-- 'marker', 'listVirtualMFADevicesResponse_marker' - When @IsTruncated@ is @true@, this element is present and contains the
-- value to use for the @Marker@ parameter in a subsequent pagination
-- request.
--
-- 'httpStatus', 'listVirtualMFADevicesResponse_httpStatus' - The response's http status code.
--
-- 'virtualMFADevices', 'listVirtualMFADevicesResponse_virtualMFADevices' - The list of virtual MFA devices in the current account that match the
-- @AssignmentStatus@ value that was passed in the request.
newListVirtualMFADevicesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListVirtualMFADevicesResponse
newListVirtualMFADevicesResponse :: Int -> ListVirtualMFADevicesResponse
newListVirtualMFADevicesResponse Int
pHttpStatus_ =
  ListVirtualMFADevicesResponse'
    { $sel:isTruncated:ListVirtualMFADevicesResponse' :: Maybe Bool
isTruncated =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListVirtualMFADevicesResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListVirtualMFADevicesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:virtualMFADevices:ListVirtualMFADevicesResponse' :: [VirtualMFADevice]
virtualMFADevices = forall a. Monoid a => a
Prelude.mempty
    }

-- | A flag that indicates whether there are more items to return. If your
-- results were truncated, you can make a subsequent pagination request
-- using the @Marker@ request parameter to retrieve more items. Note that
-- IAM might return fewer than the @MaxItems@ number of results even when
-- there are more results available. We recommend that you check
-- @IsTruncated@ after every call to ensure that you receive all your
-- results.
listVirtualMFADevicesResponse_isTruncated :: Lens.Lens' ListVirtualMFADevicesResponse (Prelude.Maybe Prelude.Bool)
listVirtualMFADevicesResponse_isTruncated :: Lens' ListVirtualMFADevicesResponse (Maybe Bool)
listVirtualMFADevicesResponse_isTruncated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualMFADevicesResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:ListVirtualMFADevicesResponse' :: ListVirtualMFADevicesResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: ListVirtualMFADevicesResponse
s@ListVirtualMFADevicesResponse' {} Maybe Bool
a -> ListVirtualMFADevicesResponse
s {$sel:isTruncated:ListVirtualMFADevicesResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: ListVirtualMFADevicesResponse)

-- | When @IsTruncated@ is @true@, this element is present and contains the
-- value to use for the @Marker@ parameter in a subsequent pagination
-- request.
listVirtualMFADevicesResponse_marker :: Lens.Lens' ListVirtualMFADevicesResponse (Prelude.Maybe Prelude.Text)
listVirtualMFADevicesResponse_marker :: Lens' ListVirtualMFADevicesResponse (Maybe Text)
listVirtualMFADevicesResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualMFADevicesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListVirtualMFADevicesResponse' :: ListVirtualMFADevicesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListVirtualMFADevicesResponse
s@ListVirtualMFADevicesResponse' {} Maybe Text
a -> ListVirtualMFADevicesResponse
s {$sel:marker:ListVirtualMFADevicesResponse' :: Maybe Text
marker = Maybe Text
a} :: ListVirtualMFADevicesResponse)

-- | The response's http status code.
listVirtualMFADevicesResponse_httpStatus :: Lens.Lens' ListVirtualMFADevicesResponse Prelude.Int
listVirtualMFADevicesResponse_httpStatus :: Lens' ListVirtualMFADevicesResponse Int
listVirtualMFADevicesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualMFADevicesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListVirtualMFADevicesResponse' :: ListVirtualMFADevicesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListVirtualMFADevicesResponse
s@ListVirtualMFADevicesResponse' {} Int
a -> ListVirtualMFADevicesResponse
s {$sel:httpStatus:ListVirtualMFADevicesResponse' :: Int
httpStatus = Int
a} :: ListVirtualMFADevicesResponse)

-- | The list of virtual MFA devices in the current account that match the
-- @AssignmentStatus@ value that was passed in the request.
listVirtualMFADevicesResponse_virtualMFADevices :: Lens.Lens' ListVirtualMFADevicesResponse [VirtualMFADevice]
listVirtualMFADevicesResponse_virtualMFADevices :: Lens' ListVirtualMFADevicesResponse [VirtualMFADevice]
listVirtualMFADevicesResponse_virtualMFADevices = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVirtualMFADevicesResponse' {[VirtualMFADevice]
virtualMFADevices :: [VirtualMFADevice]
$sel:virtualMFADevices:ListVirtualMFADevicesResponse' :: ListVirtualMFADevicesResponse -> [VirtualMFADevice]
virtualMFADevices} -> [VirtualMFADevice]
virtualMFADevices) (\s :: ListVirtualMFADevicesResponse
s@ListVirtualMFADevicesResponse' {} [VirtualMFADevice]
a -> ListVirtualMFADevicesResponse
s {$sel:virtualMFADevices:ListVirtualMFADevicesResponse' :: [VirtualMFADevice]
virtualMFADevices = [VirtualMFADevice]
a} :: ListVirtualMFADevicesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListVirtualMFADevicesResponse where
  rnf :: ListVirtualMFADevicesResponse -> ()
rnf ListVirtualMFADevicesResponse' {Int
[VirtualMFADevice]
Maybe Bool
Maybe Text
virtualMFADevices :: [VirtualMFADevice]
httpStatus :: Int
marker :: Maybe Text
isTruncated :: Maybe Bool
$sel:virtualMFADevices:ListVirtualMFADevicesResponse' :: ListVirtualMFADevicesResponse -> [VirtualMFADevice]
$sel:httpStatus:ListVirtualMFADevicesResponse' :: ListVirtualMFADevicesResponse -> Int
$sel:marker:ListVirtualMFADevicesResponse' :: ListVirtualMFADevicesResponse -> Maybe Text
$sel:isTruncated:ListVirtualMFADevicesResponse' :: ListVirtualMFADevicesResponse -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isTruncated
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [VirtualMFADevice]
virtualMFADevices