{-# 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-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)
--
-- 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
-- all of the information for a virtual MFA device, see
-- ListVirtualMFADevices.
--
-- 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_marker,
    listVirtualMFADevicesResponse_isTruncated,
    listVirtualMFADevicesResponse_httpStatus,
    listVirtualMFADevicesResponse_virtualMFADevices,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IAM.Types
import qualified Amazonka.Lens as Lens
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
(ListVirtualMFADevices -> ListVirtualMFADevices -> Bool)
-> (ListVirtualMFADevices -> ListVirtualMFADevices -> Bool)
-> Eq ListVirtualMFADevices
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]
(Int -> ReadS ListVirtualMFADevices)
-> ReadS [ListVirtualMFADevices]
-> ReadPrec ListVirtualMFADevices
-> ReadPrec [ListVirtualMFADevices]
-> Read 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
(Int -> ListVirtualMFADevices -> ShowS)
-> (ListVirtualMFADevices -> String)
-> ([ListVirtualMFADevices] -> ShowS)
-> Show ListVirtualMFADevices
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. ListVirtualMFADevices -> Rep ListVirtualMFADevices x)
-> (forall x. Rep ListVirtualMFADevices x -> ListVirtualMFADevices)
-> Generic ListVirtualMFADevices
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' :: Maybe AssignmentStatusType
-> Maybe Text -> Maybe Natural -> ListVirtualMFADevices
ListVirtualMFADevices'
    { $sel:assignmentStatus:ListVirtualMFADevices' :: Maybe AssignmentStatusType
assignmentStatus =
        Maybe AssignmentStatusType
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListVirtualMFADevices' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListVirtualMFADevices' :: Maybe Natural
maxItems = Maybe Natural
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 :: (Maybe AssignmentStatusType -> f (Maybe AssignmentStatusType))
-> ListVirtualMFADevices -> f ListVirtualMFADevices
listVirtualMFADevices_assignmentStatus = (ListVirtualMFADevices -> Maybe AssignmentStatusType)
-> (ListVirtualMFADevices
    -> Maybe AssignmentStatusType -> ListVirtualMFADevices)
-> Lens
     ListVirtualMFADevices
     ListVirtualMFADevices
     (Maybe AssignmentStatusType)
     (Maybe AssignmentStatusType)
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 :: (Maybe Text -> f (Maybe Text))
-> ListVirtualMFADevices -> f ListVirtualMFADevices
listVirtualMFADevices_marker = (ListVirtualMFADevices -> Maybe Text)
-> (ListVirtualMFADevices -> Maybe Text -> ListVirtualMFADevices)
-> Lens
     ListVirtualMFADevices
     ListVirtualMFADevices
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Natural -> f (Maybe Natural))
-> ListVirtualMFADevices -> f ListVirtualMFADevices
listVirtualMFADevices_maxItems = (ListVirtualMFADevices -> Maybe Natural)
-> (ListVirtualMFADevices
    -> Maybe Natural -> ListVirtualMFADevices)
-> Lens
     ListVirtualMFADevices
     ListVirtualMFADevices
     (Maybe Natural)
     (Maybe Natural)
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
    | Maybe Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListVirtualMFADevices
ListVirtualMFADevicesResponse
rs
            ListVirtualMFADevicesResponse
-> Getting (First Bool) ListVirtualMFADevicesResponse Bool
-> Maybe Bool
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Bool -> Const (First Bool) (Maybe Bool))
-> ListVirtualMFADevicesResponse
-> Const (First Bool) ListVirtualMFADevicesResponse
Lens' ListVirtualMFADevicesResponse (Maybe Bool)
listVirtualMFADevicesResponse_isTruncated
              ((Maybe Bool -> Const (First Bool) (Maybe Bool))
 -> ListVirtualMFADevicesResponse
 -> Const (First Bool) ListVirtualMFADevicesResponse)
-> ((Bool -> Const (First Bool) Bool)
    -> Maybe Bool -> Const (First Bool) (Maybe Bool))
-> Getting (First Bool) ListVirtualMFADevicesResponse Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Bool -> Const (First Bool) Bool)
-> Maybe Bool -> Const (First Bool) (Maybe Bool)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListVirtualMFADevices
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListVirtualMFADevices
ListVirtualMFADevicesResponse
rs
            ListVirtualMFADevicesResponse
-> Getting (First Text) ListVirtualMFADevicesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListVirtualMFADevicesResponse
-> Const (First Text) ListVirtualMFADevicesResponse
Lens' ListVirtualMFADevicesResponse (Maybe Text)
listVirtualMFADevicesResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListVirtualMFADevicesResponse
 -> Const (First Text) ListVirtualMFADevicesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListVirtualMFADevicesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListVirtualMFADevices
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListVirtualMFADevices -> Maybe ListVirtualMFADevices
forall a. a -> Maybe a
Prelude.Just (ListVirtualMFADevices -> Maybe ListVirtualMFADevices)
-> ListVirtualMFADevices -> Maybe ListVirtualMFADevices
forall a b. (a -> b) -> a -> b
Prelude.$
        ListVirtualMFADevices
rq
          ListVirtualMFADevices
-> (ListVirtualMFADevices -> ListVirtualMFADevices)
-> ListVirtualMFADevices
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListVirtualMFADevices -> Identity ListVirtualMFADevices
Lens
  ListVirtualMFADevices
  ListVirtualMFADevices
  (Maybe Text)
  (Maybe Text)
listVirtualMFADevices_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListVirtualMFADevices -> Identity ListVirtualMFADevices)
-> Maybe Text -> ListVirtualMFADevices -> ListVirtualMFADevices
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListVirtualMFADevices
ListVirtualMFADevicesResponse
rs
          ListVirtualMFADevicesResponse
-> Getting (First Text) ListVirtualMFADevicesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListVirtualMFADevicesResponse
-> Const (First Text) ListVirtualMFADevicesResponse
Lens' ListVirtualMFADevicesResponse (Maybe Text)
listVirtualMFADevicesResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListVirtualMFADevicesResponse
 -> Const (First Text) ListVirtualMFADevicesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListVirtualMFADevicesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

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

instance Prelude.Hashable ListVirtualMFADevices

instance Prelude.NFData ListVirtualMFADevices

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

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

instance Core.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
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ListVirtualMFADevices" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        ByteString
"AssignmentStatus" ByteString -> Maybe AssignmentStatusType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe AssignmentStatusType
assignmentStatus,
        ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"MaxItems" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxItems
      ]

-- | Contains the response to a successful ListVirtualMFADevices request.
--
-- /See:/ 'newListVirtualMFADevicesResponse' smart constructor.
data ListVirtualMFADevicesResponse = 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 -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | 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
(ListVirtualMFADevicesResponse
 -> ListVirtualMFADevicesResponse -> Bool)
-> (ListVirtualMFADevicesResponse
    -> ListVirtualMFADevicesResponse -> Bool)
-> Eq ListVirtualMFADevicesResponse
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
(Int -> ListVirtualMFADevicesResponse -> ShowS)
-> (ListVirtualMFADevicesResponse -> String)
-> ([ListVirtualMFADevicesResponse] -> ShowS)
-> Show ListVirtualMFADevicesResponse
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.
 ListVirtualMFADevicesResponse
 -> Rep ListVirtualMFADevicesResponse x)
-> (forall x.
    Rep ListVirtualMFADevicesResponse x
    -> ListVirtualMFADevicesResponse)
-> Generic ListVirtualMFADevicesResponse
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:
--
-- '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.
--
-- '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.
--
-- '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' :: Maybe Text
-> Maybe Bool
-> Int
-> [VirtualMFADevice]
-> ListVirtualMFADevicesResponse
ListVirtualMFADevicesResponse'
    { $sel:marker:ListVirtualMFADevicesResponse' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isTruncated:ListVirtualMFADevicesResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListVirtualMFADevicesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:virtualMFADevices:ListVirtualMFADevicesResponse' :: [VirtualMFADevice]
virtualMFADevices = [VirtualMFADevice]
forall a. Monoid a => a
Prelude.mempty
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ListVirtualMFADevicesResponse -> f ListVirtualMFADevicesResponse
listVirtualMFADevicesResponse_marker = (ListVirtualMFADevicesResponse -> Maybe Text)
-> (ListVirtualMFADevicesResponse
    -> Maybe Text -> ListVirtualMFADevicesResponse)
-> Lens' ListVirtualMFADevicesResponse (Maybe Text)
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)

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> ListVirtualMFADevicesResponse -> f ListVirtualMFADevicesResponse
listVirtualMFADevicesResponse_isTruncated = (ListVirtualMFADevicesResponse -> Maybe Bool)
-> (ListVirtualMFADevicesResponse
    -> Maybe Bool -> ListVirtualMFADevicesResponse)
-> Lens' ListVirtualMFADevicesResponse (Maybe Bool)
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)

-- | The response's http status code.
listVirtualMFADevicesResponse_httpStatus :: Lens.Lens' ListVirtualMFADevicesResponse Prelude.Int
listVirtualMFADevicesResponse_httpStatus :: (Int -> f Int)
-> ListVirtualMFADevicesResponse -> f ListVirtualMFADevicesResponse
listVirtualMFADevicesResponse_httpStatus = (ListVirtualMFADevicesResponse -> Int)
-> (ListVirtualMFADevicesResponse
    -> Int -> ListVirtualMFADevicesResponse)
-> Lens
     ListVirtualMFADevicesResponse ListVirtualMFADevicesResponse Int Int
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 :: ([VirtualMFADevice] -> f [VirtualMFADevice])
-> ListVirtualMFADevicesResponse -> f ListVirtualMFADevicesResponse
listVirtualMFADevicesResponse_virtualMFADevices = (ListVirtualMFADevicesResponse -> [VirtualMFADevice])
-> (ListVirtualMFADevicesResponse
    -> [VirtualMFADevice] -> ListVirtualMFADevicesResponse)
-> Lens
     ListVirtualMFADevicesResponse
     ListVirtualMFADevicesResponse
     [VirtualMFADevice]
     [VirtualMFADevice]
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) (([VirtualMFADevice] -> f [VirtualMFADevice])
 -> ListVirtualMFADevicesResponse
 -> f ListVirtualMFADevicesResponse)
-> (([VirtualMFADevice] -> f [VirtualMFADevice])
    -> [VirtualMFADevice] -> f [VirtualMFADevice])
-> ([VirtualMFADevice] -> f [VirtualMFADevice])
-> ListVirtualMFADevicesResponse
-> f ListVirtualMFADevicesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([VirtualMFADevice] -> f [VirtualMFADevice])
-> [VirtualMFADevice] -> f [VirtualMFADevice]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListVirtualMFADevicesResponse