{-# 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.ListMFADevices
-- 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 MFA devices for an IAM user. If the request includes a IAM
-- user name, then this operation lists all the MFA devices associated with
-- the specified user. If you do not specify a user name, IAM determines
-- the user name implicitly based on the Amazon Web Services access key ID
-- signing the request for this operation.
--
-- You can paginate the results using the @MaxItems@ and @Marker@
-- parameters.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListMFADevices
  ( -- * Creating a Request
    ListMFADevices (..),
    newListMFADevices,

    -- * Request Lenses
    listMFADevices_userName,
    listMFADevices_marker,
    listMFADevices_maxItems,

    -- * Destructuring the Response
    ListMFADevicesResponse (..),
    newListMFADevicesResponse,

    -- * Response Lenses
    listMFADevicesResponse_marker,
    listMFADevicesResponse_isTruncated,
    listMFADevicesResponse_httpStatus,
    listMFADevicesResponse_mfaDevices,
  )
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:/ 'newListMFADevices' smart constructor.
data ListMFADevices = ListMFADevices'
  { -- | The name of the user whose MFA devices you want to list.
    --
    -- This parameter allows (through its
    -- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
    -- consisting of upper and lowercase alphanumeric characters with no
    -- spaces. You can also include any of the following characters: _+=,.\@-
    ListMFADevices -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
    -- | 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.
    ListMFADevices -> 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.
    ListMFADevices -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListMFADevices -> ListMFADevices -> Bool
(ListMFADevices -> ListMFADevices -> Bool)
-> (ListMFADevices -> ListMFADevices -> Bool) -> Eq ListMFADevices
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMFADevices -> ListMFADevices -> Bool
$c/= :: ListMFADevices -> ListMFADevices -> Bool
== :: ListMFADevices -> ListMFADevices -> Bool
$c== :: ListMFADevices -> ListMFADevices -> Bool
Prelude.Eq, ReadPrec [ListMFADevices]
ReadPrec ListMFADevices
Int -> ReadS ListMFADevices
ReadS [ListMFADevices]
(Int -> ReadS ListMFADevices)
-> ReadS [ListMFADevices]
-> ReadPrec ListMFADevices
-> ReadPrec [ListMFADevices]
-> Read ListMFADevices
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMFADevices]
$creadListPrec :: ReadPrec [ListMFADevices]
readPrec :: ReadPrec ListMFADevices
$creadPrec :: ReadPrec ListMFADevices
readList :: ReadS [ListMFADevices]
$creadList :: ReadS [ListMFADevices]
readsPrec :: Int -> ReadS ListMFADevices
$creadsPrec :: Int -> ReadS ListMFADevices
Prelude.Read, Int -> ListMFADevices -> ShowS
[ListMFADevices] -> ShowS
ListMFADevices -> String
(Int -> ListMFADevices -> ShowS)
-> (ListMFADevices -> String)
-> ([ListMFADevices] -> ShowS)
-> Show ListMFADevices
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMFADevices] -> ShowS
$cshowList :: [ListMFADevices] -> ShowS
show :: ListMFADevices -> String
$cshow :: ListMFADevices -> String
showsPrec :: Int -> ListMFADevices -> ShowS
$cshowsPrec :: Int -> ListMFADevices -> ShowS
Prelude.Show, (forall x. ListMFADevices -> Rep ListMFADevices x)
-> (forall x. Rep ListMFADevices x -> ListMFADevices)
-> Generic ListMFADevices
forall x. Rep ListMFADevices x -> ListMFADevices
forall x. ListMFADevices -> Rep ListMFADevices x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListMFADevices x -> ListMFADevices
$cfrom :: forall x. ListMFADevices -> Rep ListMFADevices x
Prelude.Generic)

-- |
-- Create a value of 'ListMFADevices' 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:
--
-- 'userName', 'listMFADevices_userName' - The name of the user whose MFA devices you want to list.
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of upper and lowercase alphanumeric characters with no
-- spaces. You can also include any of the following characters: _+=,.\@-
--
-- 'marker', 'listMFADevices_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', 'listMFADevices_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.
newListMFADevices ::
  ListMFADevices
newListMFADevices :: ListMFADevices
newListMFADevices =
  ListMFADevices' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListMFADevices
ListMFADevices'
    { $sel:userName:ListMFADevices' :: Maybe Text
userName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListMFADevices' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListMFADevices' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the user whose MFA devices you want to list.
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of upper and lowercase alphanumeric characters with no
-- spaces. You can also include any of the following characters: _+=,.\@-
listMFADevices_userName :: Lens.Lens' ListMFADevices (Prelude.Maybe Prelude.Text)
listMFADevices_userName :: (Maybe Text -> f (Maybe Text))
-> ListMFADevices -> f ListMFADevices
listMFADevices_userName = (ListMFADevices -> Maybe Text)
-> (ListMFADevices -> Maybe Text -> ListMFADevices)
-> Lens ListMFADevices ListMFADevices (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMFADevices' {Maybe Text
userName :: Maybe Text
$sel:userName:ListMFADevices' :: ListMFADevices -> Maybe Text
userName} -> Maybe Text
userName) (\s :: ListMFADevices
s@ListMFADevices' {} Maybe Text
a -> ListMFADevices
s {$sel:userName:ListMFADevices' :: Maybe Text
userName = Maybe Text
a} :: ListMFADevices)

-- | 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.
listMFADevices_marker :: Lens.Lens' ListMFADevices (Prelude.Maybe Prelude.Text)
listMFADevices_marker :: (Maybe Text -> f (Maybe Text))
-> ListMFADevices -> f ListMFADevices
listMFADevices_marker = (ListMFADevices -> Maybe Text)
-> (ListMFADevices -> Maybe Text -> ListMFADevices)
-> Lens ListMFADevices ListMFADevices (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMFADevices' {Maybe Text
marker :: Maybe Text
$sel:marker:ListMFADevices' :: ListMFADevices -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListMFADevices
s@ListMFADevices' {} Maybe Text
a -> ListMFADevices
s {$sel:marker:ListMFADevices' :: Maybe Text
marker = Maybe Text
a} :: ListMFADevices)

-- | 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.
listMFADevices_maxItems :: Lens.Lens' ListMFADevices (Prelude.Maybe Prelude.Natural)
listMFADevices_maxItems :: (Maybe Natural -> f (Maybe Natural))
-> ListMFADevices -> f ListMFADevices
listMFADevices_maxItems = (ListMFADevices -> Maybe Natural)
-> (ListMFADevices -> Maybe Natural -> ListMFADevices)
-> Lens
     ListMFADevices ListMFADevices (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMFADevices' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListMFADevices' :: ListMFADevices -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListMFADevices
s@ListMFADevices' {} Maybe Natural
a -> ListMFADevices
s {$sel:maxItems:ListMFADevices' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListMFADevices)

instance Core.AWSPager ListMFADevices where
  page :: ListMFADevices
-> AWSResponse ListMFADevices -> Maybe ListMFADevices
page ListMFADevices
rq AWSResponse ListMFADevices
rs
    | Maybe Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListMFADevices
ListMFADevicesResponse
rs
            ListMFADevicesResponse
-> Getting (First Bool) ListMFADevicesResponse Bool -> Maybe Bool
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Bool -> Const (First Bool) (Maybe Bool))
-> ListMFADevicesResponse
-> Const (First Bool) ListMFADevicesResponse
Lens' ListMFADevicesResponse (Maybe Bool)
listMFADevicesResponse_isTruncated
              ((Maybe Bool -> Const (First Bool) (Maybe Bool))
 -> ListMFADevicesResponse
 -> Const (First Bool) ListMFADevicesResponse)
-> ((Bool -> Const (First Bool) Bool)
    -> Maybe Bool -> Const (First Bool) (Maybe Bool))
-> Getting (First Bool) ListMFADevicesResponse 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 ListMFADevices
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListMFADevices
ListMFADevicesResponse
rs
            ListMFADevicesResponse
-> Getting (First Text) ListMFADevicesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListMFADevicesResponse
-> Const (First Text) ListMFADevicesResponse
Lens' ListMFADevicesResponse (Maybe Text)
listMFADevicesResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListMFADevicesResponse
 -> Const (First Text) ListMFADevicesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListMFADevicesResponse 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 ListMFADevices
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListMFADevices -> Maybe ListMFADevices
forall a. a -> Maybe a
Prelude.Just (ListMFADevices -> Maybe ListMFADevices)
-> ListMFADevices -> Maybe ListMFADevices
forall a b. (a -> b) -> a -> b
Prelude.$
        ListMFADevices
rq
          ListMFADevices
-> (ListMFADevices -> ListMFADevices) -> ListMFADevices
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListMFADevices -> Identity ListMFADevices
Lens ListMFADevices ListMFADevices (Maybe Text) (Maybe Text)
listMFADevices_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListMFADevices -> Identity ListMFADevices)
-> Maybe Text -> ListMFADevices -> ListMFADevices
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListMFADevices
ListMFADevicesResponse
rs
          ListMFADevicesResponse
-> Getting (First Text) ListMFADevicesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListMFADevicesResponse
-> Const (First Text) ListMFADevicesResponse
Lens' ListMFADevicesResponse (Maybe Text)
listMFADevicesResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListMFADevicesResponse
 -> Const (First Text) ListMFADevicesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListMFADevicesResponse 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 ListMFADevices where
  type
    AWSResponse ListMFADevices =
      ListMFADevicesResponse
  request :: ListMFADevices -> Request ListMFADevices
request = Service -> ListMFADevices -> Request ListMFADevices
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListMFADevices
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListMFADevices)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListMFADevices))
-> Logger
-> Service
-> Proxy ListMFADevices
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListMFADevices)))
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
"ListMFADevicesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe Bool -> Int -> [MFADevice] -> ListMFADevicesResponse
ListMFADevicesResponse'
            (Maybe Text
 -> Maybe Bool -> Int -> [MFADevice] -> ListMFADevicesResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Bool -> Int -> [MFADevice] -> ListMFADevicesResponse)
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 -> [MFADevice] -> ListMFADevicesResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> [MFADevice] -> ListMFADevicesResponse)
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 -> [MFADevice] -> ListMFADevicesResponse)
-> Either String Int
-> Either String ([MFADevice] -> ListMFADevicesResponse)
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 ([MFADevice] -> ListMFADevicesResponse)
-> Either String [MFADevice]
-> Either String ListMFADevicesResponse
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
"MFADevices" 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 [MFADevice])
-> Either String [MFADevice]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [MFADevice]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
                        )
      )

instance Prelude.Hashable ListMFADevices

instance Prelude.NFData ListMFADevices

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

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

instance Core.ToQuery ListMFADevices where
  toQuery :: ListMFADevices -> QueryString
toQuery ListMFADevices' {Maybe Natural
Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
userName :: Maybe Text
$sel:maxItems:ListMFADevices' :: ListMFADevices -> Maybe Natural
$sel:marker:ListMFADevices' :: ListMFADevices -> Maybe Text
$sel:userName:ListMFADevices' :: ListMFADevices -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ListMFADevices" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        ByteString
"UserName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
userName,
        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 ListMFADevices request.
--
-- /See:/ 'newListMFADevicesResponse' smart constructor.
data ListMFADevicesResponse = ListMFADevicesResponse'
  { -- | When @IsTruncated@ is @true@, this element is present and contains the
    -- value to use for the @Marker@ parameter in a subsequent pagination
    -- request.
    ListMFADevicesResponse -> 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.
    ListMFADevicesResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    ListMFADevicesResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of MFA devices.
    ListMFADevicesResponse -> [MFADevice]
mfaDevices :: [MFADevice]
  }
  deriving (ListMFADevicesResponse -> ListMFADevicesResponse -> Bool
(ListMFADevicesResponse -> ListMFADevicesResponse -> Bool)
-> (ListMFADevicesResponse -> ListMFADevicesResponse -> Bool)
-> Eq ListMFADevicesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMFADevicesResponse -> ListMFADevicesResponse -> Bool
$c/= :: ListMFADevicesResponse -> ListMFADevicesResponse -> Bool
== :: ListMFADevicesResponse -> ListMFADevicesResponse -> Bool
$c== :: ListMFADevicesResponse -> ListMFADevicesResponse -> Bool
Prelude.Eq, ReadPrec [ListMFADevicesResponse]
ReadPrec ListMFADevicesResponse
Int -> ReadS ListMFADevicesResponse
ReadS [ListMFADevicesResponse]
(Int -> ReadS ListMFADevicesResponse)
-> ReadS [ListMFADevicesResponse]
-> ReadPrec ListMFADevicesResponse
-> ReadPrec [ListMFADevicesResponse]
-> Read ListMFADevicesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMFADevicesResponse]
$creadListPrec :: ReadPrec [ListMFADevicesResponse]
readPrec :: ReadPrec ListMFADevicesResponse
$creadPrec :: ReadPrec ListMFADevicesResponse
readList :: ReadS [ListMFADevicesResponse]
$creadList :: ReadS [ListMFADevicesResponse]
readsPrec :: Int -> ReadS ListMFADevicesResponse
$creadsPrec :: Int -> ReadS ListMFADevicesResponse
Prelude.Read, Int -> ListMFADevicesResponse -> ShowS
[ListMFADevicesResponse] -> ShowS
ListMFADevicesResponse -> String
(Int -> ListMFADevicesResponse -> ShowS)
-> (ListMFADevicesResponse -> String)
-> ([ListMFADevicesResponse] -> ShowS)
-> Show ListMFADevicesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMFADevicesResponse] -> ShowS
$cshowList :: [ListMFADevicesResponse] -> ShowS
show :: ListMFADevicesResponse -> String
$cshow :: ListMFADevicesResponse -> String
showsPrec :: Int -> ListMFADevicesResponse -> ShowS
$cshowsPrec :: Int -> ListMFADevicesResponse -> ShowS
Prelude.Show, (forall x. ListMFADevicesResponse -> Rep ListMFADevicesResponse x)
-> (forall x.
    Rep ListMFADevicesResponse x -> ListMFADevicesResponse)
-> Generic ListMFADevicesResponse
forall x. Rep ListMFADevicesResponse x -> ListMFADevicesResponse
forall x. ListMFADevicesResponse -> Rep ListMFADevicesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListMFADevicesResponse x -> ListMFADevicesResponse
$cfrom :: forall x. ListMFADevicesResponse -> Rep ListMFADevicesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListMFADevicesResponse' 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', 'listMFADevicesResponse_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', 'listMFADevicesResponse_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', 'listMFADevicesResponse_httpStatus' - The response's http status code.
--
-- 'mfaDevices', 'listMFADevicesResponse_mfaDevices' - A list of MFA devices.
newListMFADevicesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListMFADevicesResponse
newListMFADevicesResponse :: Int -> ListMFADevicesResponse
newListMFADevicesResponse Int
pHttpStatus_ =
  ListMFADevicesResponse' :: Maybe Text
-> Maybe Bool -> Int -> [MFADevice] -> ListMFADevicesResponse
ListMFADevicesResponse'
    { $sel:marker:ListMFADevicesResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isTruncated:ListMFADevicesResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListMFADevicesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:mfaDevices:ListMFADevicesResponse' :: [MFADevice]
mfaDevices = [MFADevice]
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.
listMFADevicesResponse_marker :: Lens.Lens' ListMFADevicesResponse (Prelude.Maybe Prelude.Text)
listMFADevicesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> ListMFADevicesResponse -> f ListMFADevicesResponse
listMFADevicesResponse_marker = (ListMFADevicesResponse -> Maybe Text)
-> (ListMFADevicesResponse -> Maybe Text -> ListMFADevicesResponse)
-> Lens' ListMFADevicesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMFADevicesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListMFADevicesResponse' :: ListMFADevicesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListMFADevicesResponse
s@ListMFADevicesResponse' {} Maybe Text
a -> ListMFADevicesResponse
s {$sel:marker:ListMFADevicesResponse' :: Maybe Text
marker = Maybe Text
a} :: ListMFADevicesResponse)

-- | 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.
listMFADevicesResponse_isTruncated :: Lens.Lens' ListMFADevicesResponse (Prelude.Maybe Prelude.Bool)
listMFADevicesResponse_isTruncated :: (Maybe Bool -> f (Maybe Bool))
-> ListMFADevicesResponse -> f ListMFADevicesResponse
listMFADevicesResponse_isTruncated = (ListMFADevicesResponse -> Maybe Bool)
-> (ListMFADevicesResponse -> Maybe Bool -> ListMFADevicesResponse)
-> Lens' ListMFADevicesResponse (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMFADevicesResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:ListMFADevicesResponse' :: ListMFADevicesResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: ListMFADevicesResponse
s@ListMFADevicesResponse' {} Maybe Bool
a -> ListMFADevicesResponse
s {$sel:isTruncated:ListMFADevicesResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: ListMFADevicesResponse)

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

-- | A list of MFA devices.
listMFADevicesResponse_mfaDevices :: Lens.Lens' ListMFADevicesResponse [MFADevice]
listMFADevicesResponse_mfaDevices :: ([MFADevice] -> f [MFADevice])
-> ListMFADevicesResponse -> f ListMFADevicesResponse
listMFADevicesResponse_mfaDevices = (ListMFADevicesResponse -> [MFADevice])
-> (ListMFADevicesResponse
    -> [MFADevice] -> ListMFADevicesResponse)
-> Lens
     ListMFADevicesResponse
     ListMFADevicesResponse
     [MFADevice]
     [MFADevice]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMFADevicesResponse' {[MFADevice]
mfaDevices :: [MFADevice]
$sel:mfaDevices:ListMFADevicesResponse' :: ListMFADevicesResponse -> [MFADevice]
mfaDevices} -> [MFADevice]
mfaDevices) (\s :: ListMFADevicesResponse
s@ListMFADevicesResponse' {} [MFADevice]
a -> ListMFADevicesResponse
s {$sel:mfaDevices:ListMFADevicesResponse' :: [MFADevice]
mfaDevices = [MFADevice]
a} :: ListMFADevicesResponse) (([MFADevice] -> f [MFADevice])
 -> ListMFADevicesResponse -> f ListMFADevicesResponse)
-> (([MFADevice] -> f [MFADevice]) -> [MFADevice] -> f [MFADevice])
-> ([MFADevice] -> f [MFADevice])
-> ListMFADevicesResponse
-> f ListMFADevicesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([MFADevice] -> f [MFADevice]) -> [MFADevice] -> f [MFADevice]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListMFADevicesResponse