{-# 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.ListUserTags
-- 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 tags that are attached to the specified IAM user. The returned
-- list of tags is sorted by tag key. For more information about tagging,
-- see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html Tagging IAM resources>
-- in the /IAM User Guide/.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListUserTags
  ( -- * Creating a Request
    ListUserTags (..),
    newListUserTags,

    -- * Request Lenses
    listUserTags_marker,
    listUserTags_maxItems,
    listUserTags_userName,

    -- * Destructuring the Response
    ListUserTagsResponse (..),
    newListUserTagsResponse,

    -- * Response Lenses
    listUserTagsResponse_marker,
    listUserTagsResponse_isTruncated,
    listUserTagsResponse_httpStatus,
    listUserTagsResponse_tags,
  )
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:/ 'newListUserTags' smart constructor.
data ListUserTags = ListUserTags'
  { -- | 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.
    ListUserTags -> 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.
    ListUserTags -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | The name of the IAM user whose tags you want to see.
    --
    -- 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: _+=,.\@-
    ListUserTags -> Text
userName :: Prelude.Text
  }
  deriving (ListUserTags -> ListUserTags -> Bool
(ListUserTags -> ListUserTags -> Bool)
-> (ListUserTags -> ListUserTags -> Bool) -> Eq ListUserTags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUserTags -> ListUserTags -> Bool
$c/= :: ListUserTags -> ListUserTags -> Bool
== :: ListUserTags -> ListUserTags -> Bool
$c== :: ListUserTags -> ListUserTags -> Bool
Prelude.Eq, ReadPrec [ListUserTags]
ReadPrec ListUserTags
Int -> ReadS ListUserTags
ReadS [ListUserTags]
(Int -> ReadS ListUserTags)
-> ReadS [ListUserTags]
-> ReadPrec ListUserTags
-> ReadPrec [ListUserTags]
-> Read ListUserTags
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUserTags]
$creadListPrec :: ReadPrec [ListUserTags]
readPrec :: ReadPrec ListUserTags
$creadPrec :: ReadPrec ListUserTags
readList :: ReadS [ListUserTags]
$creadList :: ReadS [ListUserTags]
readsPrec :: Int -> ReadS ListUserTags
$creadsPrec :: Int -> ReadS ListUserTags
Prelude.Read, Int -> ListUserTags -> ShowS
[ListUserTags] -> ShowS
ListUserTags -> String
(Int -> ListUserTags -> ShowS)
-> (ListUserTags -> String)
-> ([ListUserTags] -> ShowS)
-> Show ListUserTags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUserTags] -> ShowS
$cshowList :: [ListUserTags] -> ShowS
show :: ListUserTags -> String
$cshow :: ListUserTags -> String
showsPrec :: Int -> ListUserTags -> ShowS
$cshowsPrec :: Int -> ListUserTags -> ShowS
Prelude.Show, (forall x. ListUserTags -> Rep ListUserTags x)
-> (forall x. Rep ListUserTags x -> ListUserTags)
-> Generic ListUserTags
forall x. Rep ListUserTags x -> ListUserTags
forall x. ListUserTags -> Rep ListUserTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUserTags x -> ListUserTags
$cfrom :: forall x. ListUserTags -> Rep ListUserTags x
Prelude.Generic)

-- |
-- Create a value of 'ListUserTags' 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', 'listUserTags_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', 'listUserTags_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.
--
-- 'userName', 'listUserTags_userName' - The name of the IAM user whose tags you want to see.
--
-- 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: _+=,.\@-
newListUserTags ::
  -- | 'userName'
  Prelude.Text ->
  ListUserTags
newListUserTags :: Text -> ListUserTags
newListUserTags Text
pUserName_ =
  ListUserTags' :: Maybe Text -> Maybe Natural -> Text -> ListUserTags
ListUserTags'
    { $sel:marker:ListUserTags' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListUserTags' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:userName:ListUserTags' :: Text
userName = Text
pUserName_
    }

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

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

-- | The name of the IAM user whose tags you want to see.
--
-- 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: _+=,.\@-
listUserTags_userName :: Lens.Lens' ListUserTags Prelude.Text
listUserTags_userName :: (Text -> f Text) -> ListUserTags -> f ListUserTags
listUserTags_userName = (ListUserTags -> Text)
-> (ListUserTags -> Text -> ListUserTags)
-> Lens ListUserTags ListUserTags Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserTags' {Text
userName :: Text
$sel:userName:ListUserTags' :: ListUserTags -> Text
userName} -> Text
userName) (\s :: ListUserTags
s@ListUserTags' {} Text
a -> ListUserTags
s {$sel:userName:ListUserTags' :: Text
userName = Text
a} :: ListUserTags)

instance Core.AWSPager ListUserTags where
  page :: ListUserTags -> AWSResponse ListUserTags -> Maybe ListUserTags
page ListUserTags
rq AWSResponse ListUserTags
rs
    | Maybe Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListUserTags
ListUserTagsResponse
rs
            ListUserTagsResponse
-> Getting (First Bool) ListUserTagsResponse Bool -> Maybe Bool
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Bool -> Const (First Bool) (Maybe Bool))
-> ListUserTagsResponse -> Const (First Bool) ListUserTagsResponse
Lens' ListUserTagsResponse (Maybe Bool)
listUserTagsResponse_isTruncated
              ((Maybe Bool -> Const (First Bool) (Maybe Bool))
 -> ListUserTagsResponse -> Const (First Bool) ListUserTagsResponse)
-> ((Bool -> Const (First Bool) Bool)
    -> Maybe Bool -> Const (First Bool) (Maybe Bool))
-> Getting (First Bool) ListUserTagsResponse 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 ListUserTags
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListUserTags
ListUserTagsResponse
rs
            ListUserTagsResponse
-> Getting (First Text) ListUserTagsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListUserTagsResponse -> Const (First Text) ListUserTagsResponse
Lens' ListUserTagsResponse (Maybe Text)
listUserTagsResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListUserTagsResponse -> Const (First Text) ListUserTagsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListUserTagsResponse 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 ListUserTags
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListUserTags -> Maybe ListUserTags
forall a. a -> Maybe a
Prelude.Just (ListUserTags -> Maybe ListUserTags)
-> ListUserTags -> Maybe ListUserTags
forall a b. (a -> b) -> a -> b
Prelude.$
        ListUserTags
rq
          ListUserTags -> (ListUserTags -> ListUserTags) -> ListUserTags
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListUserTags -> Identity ListUserTags
Lens ListUserTags ListUserTags (Maybe Text) (Maybe Text)
listUserTags_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListUserTags -> Identity ListUserTags)
-> Maybe Text -> ListUserTags -> ListUserTags
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListUserTags
ListUserTagsResponse
rs
          ListUserTagsResponse
-> Getting (First Text) ListUserTagsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListUserTagsResponse -> Const (First Text) ListUserTagsResponse
Lens' ListUserTagsResponse (Maybe Text)
listUserTagsResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListUserTagsResponse -> Const (First Text) ListUserTagsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListUserTagsResponse 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 ListUserTags where
  type AWSResponse ListUserTags = ListUserTagsResponse
  request :: ListUserTags -> Request ListUserTags
request = Service -> ListUserTags -> Request ListUserTags
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListUserTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUserTags)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListUserTags))
-> Logger
-> Service
-> Proxy ListUserTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUserTags)))
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
"ListUserTagsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text -> Maybe Bool -> Int -> [Tag] -> ListUserTagsResponse
ListUserTagsResponse'
            (Maybe Text -> Maybe Bool -> Int -> [Tag] -> ListUserTagsResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Bool -> Int -> [Tag] -> ListUserTagsResponse)
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 -> [Tag] -> ListUserTagsResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> [Tag] -> ListUserTagsResponse)
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 -> [Tag] -> ListUserTagsResponse)
-> Either String Int
-> Either String ([Tag] -> ListUserTagsResponse)
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 ([Tag] -> ListUserTagsResponse)
-> Either String [Tag] -> Either String ListUserTagsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Tags" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String [Tag]) -> Either String [Tag]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [Tag]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
                        )
      )

instance Prelude.Hashable ListUserTags

instance Prelude.NFData ListUserTags

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

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

instance Core.ToQuery ListUserTags where
  toQuery :: ListUserTags -> QueryString
toQuery ListUserTags' {Maybe Natural
Maybe Text
Text
userName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:userName:ListUserTags' :: ListUserTags -> Text
$sel:maxItems:ListUserTags' :: ListUserTags -> Maybe Natural
$sel:marker:ListUserTags' :: ListUserTags -> 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
"ListUserTags" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        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,
        ByteString
"UserName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
userName
      ]

-- | /See:/ 'newListUserTagsResponse' smart constructor.
data ListUserTagsResponse = ListUserTagsResponse'
  { -- | When @IsTruncated@ is @true@, this element is present and contains the
    -- value to use for the @Marker@ parameter in a subsequent pagination
    -- request.
    ListUserTagsResponse -> 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.
    ListUserTagsResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    ListUserTagsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The list of tags that are currently attached to the user. Each tag
    -- consists of a key name and an associated value. If no tags are attached
    -- to the specified resource, the response contains an empty list.
    ListUserTagsResponse -> [Tag]
tags :: [Tag]
  }
  deriving (ListUserTagsResponse -> ListUserTagsResponse -> Bool
(ListUserTagsResponse -> ListUserTagsResponse -> Bool)
-> (ListUserTagsResponse -> ListUserTagsResponse -> Bool)
-> Eq ListUserTagsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUserTagsResponse -> ListUserTagsResponse -> Bool
$c/= :: ListUserTagsResponse -> ListUserTagsResponse -> Bool
== :: ListUserTagsResponse -> ListUserTagsResponse -> Bool
$c== :: ListUserTagsResponse -> ListUserTagsResponse -> Bool
Prelude.Eq, ReadPrec [ListUserTagsResponse]
ReadPrec ListUserTagsResponse
Int -> ReadS ListUserTagsResponse
ReadS [ListUserTagsResponse]
(Int -> ReadS ListUserTagsResponse)
-> ReadS [ListUserTagsResponse]
-> ReadPrec ListUserTagsResponse
-> ReadPrec [ListUserTagsResponse]
-> Read ListUserTagsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUserTagsResponse]
$creadListPrec :: ReadPrec [ListUserTagsResponse]
readPrec :: ReadPrec ListUserTagsResponse
$creadPrec :: ReadPrec ListUserTagsResponse
readList :: ReadS [ListUserTagsResponse]
$creadList :: ReadS [ListUserTagsResponse]
readsPrec :: Int -> ReadS ListUserTagsResponse
$creadsPrec :: Int -> ReadS ListUserTagsResponse
Prelude.Read, Int -> ListUserTagsResponse -> ShowS
[ListUserTagsResponse] -> ShowS
ListUserTagsResponse -> String
(Int -> ListUserTagsResponse -> ShowS)
-> (ListUserTagsResponse -> String)
-> ([ListUserTagsResponse] -> ShowS)
-> Show ListUserTagsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUserTagsResponse] -> ShowS
$cshowList :: [ListUserTagsResponse] -> ShowS
show :: ListUserTagsResponse -> String
$cshow :: ListUserTagsResponse -> String
showsPrec :: Int -> ListUserTagsResponse -> ShowS
$cshowsPrec :: Int -> ListUserTagsResponse -> ShowS
Prelude.Show, (forall x. ListUserTagsResponse -> Rep ListUserTagsResponse x)
-> (forall x. Rep ListUserTagsResponse x -> ListUserTagsResponse)
-> Generic ListUserTagsResponse
forall x. Rep ListUserTagsResponse x -> ListUserTagsResponse
forall x. ListUserTagsResponse -> Rep ListUserTagsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUserTagsResponse x -> ListUserTagsResponse
$cfrom :: forall x. ListUserTagsResponse -> Rep ListUserTagsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListUserTagsResponse' 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', 'listUserTagsResponse_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', 'listUserTagsResponse_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', 'listUserTagsResponse_httpStatus' - The response's http status code.
--
-- 'tags', 'listUserTagsResponse_tags' - The list of tags that are currently attached to the user. Each tag
-- consists of a key name and an associated value. If no tags are attached
-- to the specified resource, the response contains an empty list.
newListUserTagsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListUserTagsResponse
newListUserTagsResponse :: Int -> ListUserTagsResponse
newListUserTagsResponse Int
pHttpStatus_ =
  ListUserTagsResponse' :: Maybe Text -> Maybe Bool -> Int -> [Tag] -> ListUserTagsResponse
ListUserTagsResponse'
    { $sel:marker:ListUserTagsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isTruncated:ListUserTagsResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListUserTagsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:tags:ListUserTagsResponse' :: [Tag]
tags = [Tag]
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.
listUserTagsResponse_marker :: Lens.Lens' ListUserTagsResponse (Prelude.Maybe Prelude.Text)
listUserTagsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> ListUserTagsResponse -> f ListUserTagsResponse
listUserTagsResponse_marker = (ListUserTagsResponse -> Maybe Text)
-> (ListUserTagsResponse -> Maybe Text -> ListUserTagsResponse)
-> Lens' ListUserTagsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserTagsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListUserTagsResponse' :: ListUserTagsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListUserTagsResponse
s@ListUserTagsResponse' {} Maybe Text
a -> ListUserTagsResponse
s {$sel:marker:ListUserTagsResponse' :: Maybe Text
marker = Maybe Text
a} :: ListUserTagsResponse)

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

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

-- | The list of tags that are currently attached to the user. Each tag
-- consists of a key name and an associated value. If no tags are attached
-- to the specified resource, the response contains an empty list.
listUserTagsResponse_tags :: Lens.Lens' ListUserTagsResponse [Tag]
listUserTagsResponse_tags :: ([Tag] -> f [Tag])
-> ListUserTagsResponse -> f ListUserTagsResponse
listUserTagsResponse_tags = (ListUserTagsResponse -> [Tag])
-> (ListUserTagsResponse -> [Tag] -> ListUserTagsResponse)
-> Lens ListUserTagsResponse ListUserTagsResponse [Tag] [Tag]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserTagsResponse' {[Tag]
tags :: [Tag]
$sel:tags:ListUserTagsResponse' :: ListUserTagsResponse -> [Tag]
tags} -> [Tag]
tags) (\s :: ListUserTagsResponse
s@ListUserTagsResponse' {} [Tag]
a -> ListUserTagsResponse
s {$sel:tags:ListUserTagsResponse' :: [Tag]
tags = [Tag]
a} :: ListUserTagsResponse) (([Tag] -> f [Tag])
 -> ListUserTagsResponse -> f ListUserTagsResponse)
-> (([Tag] -> f [Tag]) -> [Tag] -> f [Tag])
-> ([Tag] -> f [Tag])
-> ListUserTagsResponse
-> f ListUserTagsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Tag] -> f [Tag]) -> [Tag] -> f [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListUserTagsResponse